/* Raccoon site: one stylesheet for every page. */

:root {
  --bg: #000;
  --veil: rgba(9, 9, 9, 0.72);
  --card: #121212;
  --card-raised: #212121;
  --button: #424242;
  --text: rgba(255, 255, 255, 0.87);
  --text-2: rgba(255, 255, 255, 0.6);
  --text-3: rgba(255, 255, 255, 0.38);
  --divider: rgba(255, 255, 255, 0.08);
  --outline: rgba(255, 255, 255, 0.12);
  --link: #2196f3;
  --steel: #486674;
  --orange: #ff9800;
  --green: #4caf50;
  --blue: #2196f3;
  --purple: #9c27b0;
  --font-body: 'Nunito', system-ui, sans-serif;
  --font-head: 'Josefin Sans', 'Nunito', sans-serif;
  --radius: 8px;
  --page-max: 1840px;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 400; margin: 0; }

::selection { background: rgba(33, 150, 243, 0.35); }

/* Scrollbars: thin steel, like the old overlay pages. */
* { scrollbar-width: thin; scrollbar-color: var(--steel) transparent; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: var(--steel); border-radius: 10px; }

/* ---------- Starfield ---------- */

.stars { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.stars i {
  position: absolute;
  top: 0;
  left: 0;
  background: transparent;
  animation: star-drift linear infinite;
}
.stars i::after {
  content: '';
  position: absolute;
  top: 2000px;
  width: inherit;
  height: inherit;
  box-shadow: inherit;
}
.stars i:nth-child(1) { width: 1px; height: 1px; animation-duration: 50s; }
.stars i:nth-child(2) { width: 2px; height: 2px; animation-duration: 100s; }
.stars i:nth-child(3) { width: 3px; height: 3px; animation-duration: 150s; }

@keyframes star-drift {
  from { transform: translateY(0); }
  to { transform: translateY(-2000px); }
}

@media (prefers-reduced-motion: reduce) {
  .stars i { animation: none; }
}

/* ---------- Home: the prism menu ---------- */

.home { height: 100vh; height: 100dvh; overflow: hidden; }
.home h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.prism-wrap {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  align-items: center;
  transform: translateY(-5%);
}

.prism {
  display: block;
  flex-shrink: 0;
  height: 100vh;
  width: 100%;
  transform: translateX(-15%);
  transition: transform 1s, width 1s;
}
@media (max-width: 1263px) { .prism { width: 200%; transform: translateX(-40%); } }
@media (max-width: 599px) { .prism { width: 300%; transform: translateX(-50%); } }

.prism .bgSquare { display: none; }

/* The light beams sweep in from the bottom-left corner once on load. */
.prism .colors { clip-path: circle(0% at 0% 100%); }
.prism .colors.shown { clip-path: circle(150% at 0% 100%); transition: clip-path 1.1s cubic-bezier(0.3, 0.7, 0.3, 1); }
@media (prefers-reduced-motion: reduce) {
  .prism .colors { clip-path: none; }
}

.prism .beam { cursor: pointer; text-decoration: none; }
.prism .beam .color { fill-opacity: 1; transition: fill-opacity 0.2s ease-in-out; }
.prism .textColors:hover .color { fill-opacity: 0.5; }
.prism .textColors .beam:hover .color,
.prism .textColors .beam:focus-visible .color { fill-opacity: 1; }
.prism .beam:focus { outline: none; }
.prism .beam:focus-visible text { fill: #fff; }
.prism text { pointer-events: none; }

/* ---------- Home: wedding invitation peek ---------- */

/* Shown by site.js only when the `svatba` cookie exists. The entrance animates `translate`,
   hover animates `transform`, so the two never fight (and hover has no entrance delay).
   Absolute, not fixed: the home page never scrolls, and on phones the wide prism stretches Chrome's
   layout viewport, which would push a fixed card below the visible screen. */
.invite-peek {
  position: absolute;
  z-index: 3;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 10px 16px 10px 10px;
  min-height: 44px;
  background: rgba(18, 18, 18, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(245, 165, 90, 0.35);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 20px rgba(245, 165, 90, 0.12);
  color: var(--text);
  text-decoration: none;
  opacity: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.invite-peek.shown { animation: invite-peek-in 0.6s ease 0.9s both; }
@keyframes invite-peek-in {
  from { opacity: 0; translate: 0 12px; }
  to { opacity: 1; translate: 0 0; }
}
.invite-peek:hover,
.invite-peek:focus-visible {
  text-decoration: none;
  border-color: rgba(245, 165, 90, 0.6);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), 0 0 26px rgba(245, 165, 90, 0.2);
  transform: translateY(-2px);
}
.invite-peek:focus-visible { outline: 2px solid #f5a55a; outline-offset: 3px; }
.invite-peek svg { flex-shrink: 0; }
.invite-peek-text { display: flex; flex-direction: column; line-height: 1.3; }
.invite-peek-title { font-family: var(--font-body); font-weight: 600; font-size: 0.95rem; color: var(--text); }
.invite-peek-sub {
  font-family: var(--font-head);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f5a55a;
}
@media (max-width: 599px) {
  .invite-peek {
    left: 0;
    right: 0;
    width: max-content;
    margin-inline: auto;
    bottom: max(16px, env(safe-area-inset-bottom));
  }
}
@media (prefers-reduced-motion: reduce) {
  .invite-peek.shown { animation: none; opacity: 1; }
  .invite-peek { transition: none; }
}

/* ---------- Inner pages ---------- */

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* The veil dims the starfield behind the whole viewport, including under the back bar. */
.page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--veil);
  pointer-events: none;
}

.page-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 24px 24px 64px 88px;
}

/* Back to the prism: a tall strip on the left on desktop, a bar on phones. */
.back {
  position: fixed;
  z-index: 2;
  top: 0;
  left: 0;
  width: 72px;
  height: 100vh;
  display: grid;
  place-items: center;
  color: var(--text-2);
  font-size: 28px;
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: background 0.2s, color 0.2s;
}
.back:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); text-decoration: none; }

@media (max-width: 959px) {
  .page-inner { padding: 8px var(--gutter) 48px; }
  .back {
    position: sticky;
    width: 100%;
    height: 64px;
    justify-items: start;
    padding-left: var(--gutter);
    padding-bottom: 16px;
    background: linear-gradient(to bottom, rgba(6, 6, 6, 0.97) 0%, rgba(6, 6, 6, 0.95) 62%, rgba(6, 6, 6, 0) 100%);
    border-radius: 0;
  }
  .back:hover { background: linear-gradient(to bottom, rgba(6, 6, 6, 0.97) 0%, rgba(6, 6, 6, 0.95) 62%, rgba(6, 6, 6, 0) 100%); }
}

.page-head { margin: 8px 0 32px; }
.page-head h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.page-head p { margin: 8px 0 0; color: var(--text-2); max-width: 100ch; }

.section-title {
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 20px;
}

.muted { color: var(--text-2); }
.faint { color: var(--text-3); }

.link-row { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; }
.link-row a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

/* ---------- Project cards ---------- */

.cards {
  display: grid;
  /* At most four columns: extra width makes cards wider instead of adding a fifth. */
  grid-template-columns: repeat(auto-fill, minmax(max(280px, calc((100% - 3 * 20px) / 4)), 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 620px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); }

.card-img { display: block; aspect-ratio: 345 / 250; background: #070707; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card:hover .card-img img { transform: scale(1.03); }
.card-img.contain img { object-fit: contain; }

/* Images that are still loading fade in instead of popping over an empty slot (class set by site.js). */
img.fade-in { opacity: 0; transition: opacity 0.4s ease; }
img.fade-in.loaded { opacity: 1; }
@media (prefers-reduced-motion: reduce) { img.fade-in { transition: none; } }

.card-body { padding: 16px 16px 0; flex: 1; display: flex; flex-direction: column; }
.card h2 { font-family: var(--font-body); font-size: 1.5rem; font-weight: 400; line-height: 1.3; color: var(--text); }
.card .subtitle { margin: 14px 0 6px; color: var(--text-3); }
.card .text { border-top: 1px solid var(--divider); padding-top: 10px; color: var(--text-2); }
.card .text p { margin: 0 0 8px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--outline);
  color: var(--text-2);
}
.tag.wip { border-color: rgba(255, 152, 0, 0.55); color: var(--orange); }
.tag.ai { border-color: rgba(156, 39, 176, 0.7); color: #ce93d8; }

.card-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 24px 16px; margin-top: auto; }
.btn {
  display: inline-block;
  padding: 14px 26px;
  background: var(--button);
  color: var(--link);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 4px;
  transition: background 0.2s;
}
.btn:hover { background: #505050; text-decoration: none; }
.btn.disabled { color: var(--text-3); background: var(--card-raised); pointer-events: none; }

@media (max-width: 599px) {
  .card { min-height: 0; }
}

/* ---------- About ---------- */

.profile { display: grid; grid-template-columns: 1fr auto; gap: 24px 48px; align-items: end; margin-bottom: 32px; }
.profile h1 { font-size: clamp(2.2rem, 5vw, 3.75rem); letter-spacing: 0.02em; line-height: 1.1; }
.profile .role { font-size: 1.25rem; margin: 12px 0 16px; }
.profile .photo { width: 250px; height: 250px; border-radius: 24px; object-fit: cover; }
.profile-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 48px; }
.socials { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.socials a { display: inline-flex; align-items: center; gap: 14px; }
.socials .mdi { font-size: 30px; line-height: 1; }
.resume {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 2.5vw, 2.1rem);
  line-height: 1.15;
  text-align: center;
}

@media (max-width: 759px) {
  .profile { grid-template-columns: 1fr; }
  .profile .photo { order: -1; margin: 0 auto; width: 200px; height: 200px; }
}

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 64px; }
@media (max-width: 959px) { .two-col { grid-template-columns: 1fr; } }

.prose p { margin: 0 0 16px; }
.experience h3 { font-family: var(--font-body); font-weight: 700; font-size: 1.05rem; margin: 18px 0 4px; }
.experience h3:first-child { margin-top: 0; }
.experience p { margin: 0; }
.skills b { color: var(--text); }
.skills p { margin: 0 0 8px; }

.chips { display: flex; flex-wrap: wrap; gap: 16px 12px; margin: 4px 0 32px; padding: 0; list-style: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px 4px 10px;
  border: 1px solid var(--outline);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: transform 0.2s ease, border-color 0.2s;
}
.chip:hover { transform: scale(1.06); border-color: rgba(255, 255, 255, 0.3); }
.chip .mdi { font-size: 22px; line-height: 1; }

/* ---------- Contact ---------- */

.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li + li { border-top: 1px solid var(--divider); }
.contact-list a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 26px 8px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  border-radius: var(--radius);
  transition: background 0.2s;
}
.contact-list a:hover { background: rgba(255, 255, 255, 0.04); text-decoration: none; }
.contact-list .mdi { font-size: 32px; line-height: 1; }

/* ---------- Articles (Camino and friends) ---------- */

.article { max-width: 780px; margin: 0 auto; }
.article .hero { width: 100%; border-radius: var(--radius); margin: 8px 0 28px; }
.article h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.15; }
.article .date { color: var(--text-3); margin: 10px 0 24px; }
.article p { color: var(--text-2); font-size: 1.1rem; }

/* ---------- 404 ---------- */

.lost { min-height: 100vh; display: grid; place-content: center; text-align: center; gap: 12px; position: relative; z-index: 1; }
.lost h1 { font-size: clamp(3rem, 12vw, 7rem); color: var(--text-2); }
