/* tzimopoulos.name — "The Plan": a labyrinth of four rooms on a technical grid.
   Without JavaScript the rooms are an ordinary scrolling page; main.js adds
   the screen-by-screen behaviour (html.js). */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-greek-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

:root {
  --bg: #0b0e13;
  --ink: #e8ecf2;
  --body: #c5cedb;
  --muted: #98a4b6;
  --accent: #86b6ff;
  --accent-dim: rgba(134, 182, 255, 0.55);
  --line: rgba(134, 182, 255, 0.2);
  --line-faint: rgba(134, 182, 255, 0.09);
  --top: 60px;
  --bar: 68px;
  --strip: 240px;
  --gutter: 20px;
  --dur: 360ms;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --ox: 40px; /* room travel offset: horizontal on small screens, vertical on wide ones */
  --oy: 0px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font: 400 1rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
h1:focus, h2:focus { outline: none; }
::selection { background: rgba(134, 182, 255, 0.3); }

.arrow { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: transform 200ms var(--ease); }

.skip-link { position: fixed; left: 12px; top: -80px; z-index: 50; padding: 12px 16px; background: var(--accent); color: var(--bg); font-weight: 600; border-radius: 4px; }
.skip-link:focus { top: 12px; outline-color: var(--ink); }

/* ---------- technical grid ---------- */
.grid {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 85% 80% at 62% 42%, #000 25%, transparent 100%);
  mask-image: radial-gradient(ellipse 85% 80% at 62% 42%, #000 25%, transparent 100%);
}
.grid-plane {
  position: absolute; inset: -120px;
  --gl: rgba(134, 182, 255, 0.055);
  --gm: rgba(134, 182, 255, 0.11);
  background-image:
    linear-gradient(var(--gm) 1px, transparent 1px),
    linear-gradient(90deg, var(--gm) 1px, transparent 1px),
    linear-gradient(var(--gl) 1px, transparent 1px),
    linear-gradient(90deg, var(--gl) 1px, transparent 1px);
  background-size: 224px 224px, 224px 224px, 56px 56px, 56px 56px;
  background-position: var(--gx, 0px) var(--gy, 0px);
  will-change: transform;
}
.is-ready .grid-plane { transition: background-position var(--dur) var(--ease), transform 600ms var(--ease); }

/* ---------- chrome: header + wayfinding ---------- */
.site-header {
  position: fixed; z-index: 20; top: 0; left: 0; right: 0; height: var(--top);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 calc(var(--gutter) - 8px) 0 var(--gutter);
  background: linear-gradient(var(--bg) 55%, rgba(11, 14, 19, 0));
}
.wordmark { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.18em; color: var(--ink); display: inline-flex; align-items: center; min-height: 44px; }
.language-switch { display: flex; align-items: center; gap: 0; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.08em; color: var(--muted); }
.language-switch a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 8px; transition: color 150ms; }
.language-switch a:hover { color: var(--ink); }
.language-switch a[aria-current="page"] { color: var(--accent); }

.rooms {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(11, 14, 19, 0.94);
  border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.rooms ol { display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.rooms a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 5px;
  min-height: var(--bar); padding: 14px 4px 8px; text-align: center; color: var(--muted);
  font-size: 0.6875rem; line-height: 1.2; font-weight: 500; transition: color 150ms;
}
.rooms a:hover, .rooms a[aria-current="location"] { color: var(--ink); }
.rooms .num { display: none; }
.rooms .node {
  width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--accent-dim);
  transition: background 200ms, border-color 200ms, box-shadow 200ms; position: relative; z-index: 1;
}
.rooms a[aria-current="location"] .node { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(134, 182, 255, 0.16); }
.rooms-track { position: absolute; z-index: 0; top: 19px; left: 12.5%; right: 12.5%; height: 1px; background: var(--line); }
.rooms-fill { position: absolute; inset: 0; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
.is-ready .rooms-fill { transition: transform var(--dur) var(--ease); }

/* ---------- rooms ---------- */
.room {
  position: relative; z-index: 1; display: flex; flex-direction: column;
  min-height: 100svh;
  padding: calc(var(--top) + 12px) var(--gutter) calc(var(--bar) + 40px + env(safe-area-inset-bottom));
}
.room-inner { width: 100%; max-width: 64rem; margin: auto 0; }
.eyebrow { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.16em; color: var(--accent); margin-bottom: 0.9rem; }
h1, h2 { font-weight: 600; color: var(--ink); letter-spacing: -0.035em; line-height: 1.02; }
h2 { font-size: clamp(2.2rem, 10vw, 3.4rem); }
.lead { color: var(--muted); font-size: 1.0625rem; max-width: 40rem; margin-top: 1.25rem; }
.js body { height: 100vh; height: 100dvh; overflow: hidden; }
.js main { position: fixed; inset: 0; z-index: 1; }
.js .room {
  position: absolute; inset: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur) ease, transform var(--dur) var(--ease), visibility 0s linear var(--dur);
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.js .room[data-state="before"] { transform: translate(calc(var(--ox) * -1), calc(var(--oy) * -1)); }
.js .room[data-state="after"] { transform: translate(var(--ox), var(--oy)); }
.js .room.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

/* intro */
.intro { display: grid; gap: 28px; align-items: center; }
.portrait { position: relative; order: -1; width: min(36vw, 136px); aspect-ratio: 429 / 700; margin: 0; outline: 1px solid var(--line-faint); background: #05070a; }
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }
.corner { position: absolute; width: 14px; height: 14px; border: 0 solid var(--accent); }
.corner.tl { top: -6px; left: -6px; border-width: 1.5px 0 0 1.5px; }
.corner.tr { top: -6px; right: -6px; border-width: 1.5px 1.5px 0 0; }
.corner.bl { bottom: -6px; left: -6px; border-width: 0 0 1.5px 1.5px; }
.corner.br { bottom: -6px; right: -6px; border-width: 0 1.5px 1.5px 0; }
h1 { --h1: clamp(2.2rem, 11vw, 4.5rem); letter-spacing: -0.045em; line-height: 1.04; }
h1 .line { white-space: nowrap; display: block; overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.1em; }
h1 .line > span { display: block; }
.js .room:not(.is-active) h1 .line > span { transform: translateY(110%); }
.js .room.is-active h1 .line > span { animation: rise 700ms var(--ease) both; }
.js .room.is-active h1 .line:nth-child(2) > span { animation-delay: 110ms; }
.js .room.is-active h1 .line:nth-child(3) > span { animation-delay: 220ms; }
@keyframes rise { from { transform: translateY(110%); } to { transform: none; } }
.tagline { margin-top: 1.4rem; color: var(--body); font-size: 1.125rem; max-width: 34rem; }
.doors { margin-top: 2rem; max-width: 36rem; }
.doors li { border-top: 1px solid var(--line-faint); }
.doors li:last-child { border-bottom: 1px solid var(--line-faint); }
.doors a {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name arrow" "hint arrow"; column-gap: 16px; align-items: center;
  min-height: 60px; padding: 10px 0;
}
.door-name { grid-area: name; color: var(--ink); font-weight: 600; font-size: 0.9375rem; transition: color 150ms; }
.door-hint { grid-area: hint; color: var(--muted); font-size: 0.875rem; }
.doors .arrow { grid-area: arrow; width: 1.1rem; height: 1.1rem; color: var(--accent-dim); }
.doors a:hover .door-name { color: var(--accent); }
.doors a:hover .arrow { transform: translateX(4px); color: var(--accent); }

/* about: beats */
.prose { margin-top: 2rem; counter-reset: beat; max-width: 44rem; }
.prose p { position: relative; counter-increment: beat; padding-left: 2.6rem; margin-bottom: 1.2rem; font-size: 1.0625rem; color: var(--body); }
.prose p::before {
  content: counter(beat, decimal-leading-zero); position: absolute; left: 0; top: 0.55em;
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.14em; color: var(--accent-dim);
}
.prose p:first-child { font-size: 1.25rem; line-height: 1.5; color: var(--ink); }
.prose p:first-child::before { top: 0.65em; }
.js .room.is-active .prose p { animation: beat 650ms var(--ease) both; }
.js .room.is-active .prose p:nth-child(1) { animation-delay: 100ms; }
.js .room.is-active .prose p:nth-child(2) { animation-delay: 220ms; }
.js .room.is-active .prose p:nth-child(3) { animation-delay: 340ms; }
.js .room.is-active .prose p:nth-child(4) { animation-delay: 460ms; }
.js .room.is-active .prose p:nth-child(5) { animation-delay: 580ms; }
@keyframes beat { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* labyrinth: one drawn line, two paths */
.paths { --lead: 40px; --gap: 2rem; --by: 1.7rem; --sx: 6px; margin-top: 2.5rem; padding-left: var(--lead); max-width: 46rem; }
.path {
  position: relative; display: block; padding: 1rem 1rem 1.1rem 1.1rem; border: 1px solid transparent; border-radius: 6px;
  transition: background 200ms, border-color 200ms;
}
.path + .path { margin-top: var(--gap); }
.path:hover { background: rgba(134, 182, 255, 0.05); border-color: var(--line); }
/* branch from the trunk to the path */
.path::before {
  content: ""; position: absolute; left: calc(var(--lead) * -1 + var(--sx)); top: var(--by); height: 9px; margin-top: -4px;
  width: calc(var(--lead) - var(--sx) + 1px);
  background:
    linear-gradient(var(--accent-dim), var(--accent-dim)) 0 50% / calc(100% - 9px) 1px no-repeat,
    radial-gradient(circle, var(--accent) 0 3.5px, transparent 4px) 100% 50% / 9px 9px no-repeat;
  transform-origin: 0 50%;
}
/* trunk */
.path::after {
  content: ""; position: absolute; left: calc(var(--lead) * -1 + var(--sx)); width: 1px; background: var(--accent-dim); transform-origin: 50% 0;
}
.path-medium::after { top: var(--by); bottom: calc(var(--gap) * -1); }
.path-wip::after { top: calc(var(--gap) * -1); height: calc(var(--gap) + var(--by)); }
.path-medium::before { box-shadow: none; }
/* work in progress: the branch peters out in dashes and ends on a hollow node */
.path-wip::before {
  background:
    repeating-linear-gradient(90deg, var(--accent-dim) 0 5px, transparent 5px 10px) 0 50% / calc(100% - 9px) 1px no-repeat,
    radial-gradient(circle, transparent 0 2.4px, var(--accent-dim) 2.8px 4px, transparent 4.4px) 100% 50% / 9px 9px no-repeat;
}
.path-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.path-title { font-size: clamp(1.4rem, 5vw, 1.9rem); font-weight: 600; letter-spacing: -0.02em; color: var(--ink); line-height: 1.2; transition: color 150ms; }
.path-head .arrow { width: 1.1rem; height: 1.1rem; color: var(--accent-dim); }
.path:hover .path-title { color: var(--accent); }
.path:hover .arrow { transform: translate(2px, -2px); color: var(--accent); }
.wip { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.14em; color: var(--muted); padding: 4px 9px; border: 1px dashed var(--accent-dim); border-radius: 3px; }
.path-desc { display: block; margin-top: 0.7rem; color: var(--body); font-size: 1rem; max-width: 38rem; }
.path-url { display: block; margin-top: 0.7rem; color: var(--accent); font-size: 0.8125rem; letter-spacing: 0.04em; }
.js .room.is-active .path-medium::after { animation: draw-y 450ms var(--ease) 100ms both; }
.js .room.is-active .path-medium::before { animation: draw-x 450ms var(--ease) 300ms both; }
.js .room.is-active .path-wip::after { animation: draw-y 400ms var(--ease) 450ms both; }
.js .room.is-active .path-wip::before { animation: draw-x 500ms var(--ease) 700ms both; }
.js .room.is-active .path-head, .js .room.is-active .path-desc, .js .room.is-active .path-url { animation: beat 600ms var(--ease) both; }
.js .room.is-active .path-medium > * { animation-delay: 350ms; }
.js .room.is-active .path-wip > * { animation-delay: 750ms; }
@keyframes draw-y { from { transform: scaleY(0); } to { transform: none; } }
@keyframes draw-x { from { transform: scaleX(0); opacity: 0; } to { transform: none; opacity: 1; } }

/* connect */
.socials { margin-top: 2rem; max-width: 46rem; display: grid; grid-template-columns: 1fr; column-gap: 48px; }
.social-link {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; padding: 10px 0;
  border-bottom: 1px solid var(--line-faint); font-size: 1.25rem; font-weight: 500; color: var(--ink); letter-spacing: -0.01em;
  transition: color 150ms, border-color 150ms;
}
.socials li:first-child .social-link { border-top: 1px solid var(--line-faint); }
.social-link .arrow { width: 1.1rem; height: 1.1rem; color: var(--accent-dim); }
.social-link:hover { color: var(--accent); border-color: var(--line); }
.social-link:hover .arrow { transform: translate(3px, -3px); color: var(--accent); }
.footer { margin-top: 2.5rem; color: var(--muted); font-size: 0.8125rem; }

/* the name never breaks mid-word: cap its size to the copy column */
.intro-copy { container-type: inline-size; }
.intro-copy h1 { font-size: min(var(--h1), 12.4cqw); }

/* ---------- tablet+: larger type, still the bottom bar ---------- */
@media (min-width: 700px) {
  :root { --gutter: 48px; --ox: 56px; }
  h1 { --h1: clamp(3.4rem, 9vw, 6rem); }
  h2 { font-size: clamp(2.8rem, 6.5vw, 4.25rem); }
  .portrait { width: 132px; }
  .tagline { font-size: 1.3rem; }
  .doors a { grid-template-columns: 12rem 1fr auto; grid-template-areas: "name hint arrow"; column-gap: 20px; }
  .prose p { font-size: 1.125rem; padding-left: 3.2rem; }
  .prose p:first-child { font-size: 1.4rem; }
  .paths { --lead: 64px; --by: 2rem; }
  .socials { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 56rem; }
  .rooms a { font-size: 0.8125rem; }
}

/* ---------- desktop: left strip, vertical travel ---------- */
@media (min-width: 1100px) {
  :root { --ox: 0px; --oy: 48px; --gutter: 72px; }
  .site-header { padding: 0 20px 0 28px; background: none; pointer-events: none; }
  .site-header > * { pointer-events: auto; }
  .rooms {
    top: 0; right: auto; bottom: 0; width: var(--strip); padding: 0; background: none; border: 0;
    -webkit-backdrop-filter: none; backdrop-filter: none; display: flex; align-items: center;
  }
  .rooms ol { display: block; width: 100%; }
  .rooms a {
    flex-direction: row; justify-content: flex-start; align-items: center; gap: 14px; min-height: 64px; height: 64px;
    padding: 0 20px 0 30px; text-align: left; font-size: 0.9375rem;
  }
  .rooms .num { display: inline; font-size: 0.6875rem; letter-spacing: 0.14em; color: var(--accent-dim); font-weight: 600; }
  .rooms a[aria-current="location"] .num { color: var(--accent); }
  .rooms-track { top: calc(50% - 96px + 32px); bottom: auto; left: 35px; right: auto; width: 1px; height: 192px; }
  .rooms-fill { transform-origin: 50% 0; transform: scaleY(var(--p, 0)); }
  .room { padding: calc(var(--top) + 24px) var(--gutter) 56px calc(var(--strip) + var(--gutter) - 24px); }
  h1 { --h1: clamp(4rem, 6.4vw, 7.5rem); }
  h2 { font-size: clamp(3.4rem, 5vw, 5rem); }
  .intro { grid-template-columns: minmax(0, 1fr) 260px; gap: 80px; }
  .portrait { order: 0; width: 260px; }
  .tagline { font-size: 1.4rem; }
  .paths { --lead: 88px; max-width: 52rem; }
  .prose { max-width: 48rem; }
}

/* very short desktop windows: stop centering, let the room scroll */
@media (min-width: 1100px) and (max-height: 700px) { .room-inner { margin: 0; } }


/* short windows: landscape phones and low desktop windows */
@media (max-height: 520px) and (max-width: 1099px) {
  :root { --top: 44px; --bar: 54px; }
  .rooms a { min-height: var(--bar); padding-top: 11px; gap: 3px; }
  .rooms-track { top: 15px; }
  .room { padding-top: calc(var(--top) + 8px); padding-bottom: calc(var(--bar) + 20px + env(safe-area-inset-bottom)); }
  .intro { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 28px; }
  .portrait { order: -1; width: 112px; }
  h1 { --h1: clamp(2rem, 11vh, 3.4rem); }
  .tagline { margin-top: 0.9rem; font-size: 1rem; }
  .doors { margin-top: 1.2rem; }
  h2 { font-size: clamp(2rem, 9vh, 3rem); }
}
@media (min-width: 1100px) and (max-height: 760px) {
  h1 { --h1: min(clamp(4rem, 6.4vw, 7.5rem), 14vh); }
  .portrait { width: min(260px, 30vh); }
  .tagline { font-size: 1.15rem; margin-top: 1rem; }
  .doors { margin-top: 1.2rem; }
  .doors a { min-height: 52px; }
  h2 { font-size: clamp(2.6rem, 9vh, 4rem); }
}

/* touch: quieter grid */
@media (pointer: coarse) { .grid-plane { opacity: 0.7; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .room:not(.is-active) h1 .line > span { transform: none; }
}

/* 404 page */
.not-found { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.not-found h1 { font-size: clamp(2.2rem, 9vw, 4rem); }
.not-found .lead a { color: var(--accent); padding: 12px 4px; display: inline-block; }
