@import url("/assets/fonts/fonts.css");

:root {
  --bg: #edccbe;
  --surface: #e6bfae;
  --ink: #351a2b;
  --muted: #5e3d4b;
  --field: #351a2b;
  --field-ink: #edccbe;

  --display: 'Libre Franklin', 'Helvetica Neue', Arial, sans-serif;
  --text: 'Source Serif 4', Georgia, 'Times New Roman', serif;

  --step-small: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --step-display: clamp(3.5rem, 10vw, 9.5rem);

  --m: clamp(16px, 2vw, 28px);
  --corner: calc(var(--m) + var(--step-display) * 0.85);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--step-body)/1.55 var(--text);
  overflow-x: clip;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -0.035em; line-height: 0.95; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.on-field :focus-visible { outline-color: var(--field-ink); }
[hidden] { display: none !important; }

/* language switch: both languages are in the HTML, one is shown */
html[data-lang="en"] [data-l="cs"],
html[data-lang="cs"] [data-l="en"] { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  min-height: 48px; padding: 0.7em 1.4em;
  background: var(--ink); color: var(--bg);
  font: 700 var(--step-small)/1 var(--display); letter-spacing: 0;
  text-decoration: none; border: 2px solid var(--ink); border-radius: 0; cursor: pointer;
  transition: transform .25s var(--ease), background-color .25s var(--ease), color .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); background: #4b2740; border-color: #4b2740; }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.arrow { display: inline-block; transition: transform .25s var(--ease); }
a:hover .arrow, button:hover .arrow { transform: translateX(4px); }
.link {
  font: 700 var(--step-small)/1.2 var(--display); letter-spacing: 0;
  text-decoration: none; display: inline-flex; align-items: center; gap: .5em;
  min-height: 44px;
}
.link span:not(.arrow) { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .25em; }
.lang-toggle {
  min-height: 44px; padding: 0 2px; background: none; border: 0; cursor: pointer; color: inherit;
  font: 700 var(--step-small)/1 var(--display);
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .25em;
}
.lang-toggle:hover { color: var(--muted); }

/* ---------- the pinned poster: name split to two corners, slides change between them ---------- */
.poster { position: relative; }
.pin { position: relative; }
.corners { position: absolute; inset: 0 0 auto 0; height: 100svh; z-index: 20; pointer-events: none; }
.corners h1 {
  position: absolute; inset: 0;
  font-size: var(--step-display); line-height: .85; text-transform: uppercase;
}
.corners .a { position: absolute; top: var(--m); left: var(--m); }
.corners .b { position: absolute; bottom: var(--m); right: var(--m); }
.slide { position: relative; min-height: 100svh; }

/* pinned mode (switched on by script when the screen is tall enough) */
.pinned { height: calc(100svh + 2 * 110svh); }
.pinned .pin { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.pinned .corners { inset: 0; height: auto; }
.pinned .slide { position: absolute; inset: 0; min-height: 0; opacity: 0; pointer-events: none; transition: opacity .55s var(--ease); }
.pinned .slide.is-active { opacity: 1; pointer-events: auto; transition-delay: .12s; }

/* ---------- hero ---------- */
.hero { height: 100svh; min-height: 600px; }
.pinned .hero { height: auto; min-height: 0; }
.hero-copy {
  position: absolute; left: calc(var(--m) + (100vw - 2 * var(--m)) / 12 * 2); top: 40%;
  max-width: 36ch;
  transition: transform .7s var(--ease);
}
.pinned .hero:not(.is-active) .hero-copy { transform: translateY(-40px); }
.hero-copy p { font-size: var(--step-lead); line-height: 1.4; }
.hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
.lang-inline { display: none; }
.hero-media {
  position: absolute; top: 0; right: 0; width: 25vw; height: 68svh; margin: 0;
  background: #120a10;
}
.hero-media video, .hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.hero-media figcaption {
  position: absolute; top: calc(100% + 12px); right: var(--m); width: calc(25vw - 2 * var(--m));
  font-size: var(--step-small); line-height: 1.4; color: var(--muted); text-align: right;
}
.hero-nav {
  position: absolute; right: calc(25vw + 40px); top: 40%;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.hero-nav a { font: 700 var(--step-small)/1 var(--display); text-decoration: none; min-height: 34px; display: inline-flex; align-items: center; }
.hero-nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .25em; }
.hero-nav .lang-toggle { min-height: 34px; margin-top: 12px; }

/* ---------- work: title torn at the seam ---------- */
.stage {
  min-height: 100svh;
  display: grid; grid-template-columns: 1fr 54vw 1fr; align-items: center; gap: 24px;
  padding: var(--corner) var(--m);
}
.pinned .stage { height: 100svh; min-height: 0; padding-block: calc(var(--corner) + 16px); }
.panes { position: relative; display: grid; grid-template-columns: 1fr 1fr; aspect-ratio: 8 / 5; max-height: 100%; }
.pane { margin: 0; overflow: hidden; background: var(--surface); transition: transform .8s var(--ease); }
.pane img { width: 100%; height: 100%; object-fit: cover; }
.torn {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  font-size: min(var(--step-display), var(--torn, 10vw)); line-height: .82; letter-spacing: -0.04em;
  text-transform: uppercase; white-space: nowrap; color: var(--title, var(--bg));
}
.torn .half { display: block; transition: transform .8s var(--ease); }
.torn .half.l { clip-path: inset(0 50% 0 0); }
.torn .half.r { position: absolute; inset: 0; clip-path: inset(0 0 0 50%); }
/* the tear: a slide that is not on stage has its halves pulled apart */
.pinned .slide.is-after  .pane.l, .pinned .slide.is-before .pane.r { transform: translateY(9svh); }
.pinned .slide.is-after  .pane.r, .pinned .slide.is-before .pane.l { transform: translateY(-9svh); }
.pinned .slide.is-after  .half.l, .pinned .slide.is-before .half.r { transform: translateY(16svh); }
.pinned .slide.is-after  .half.r, .pinned .slide.is-before .half.l { transform: translateY(-16svh); }

.side { align-self: center; }
.side-l .kind { font: 700 var(--step-small)/1.35 var(--display); letter-spacing: 0; margin-bottom: 16px; }
.side-r { justify-self: end; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 20px; }
.side-r .work-h { font-size: var(--step-lead); letter-spacing: -0.02em; line-height: 1.1; }
.facts { list-style: none; margin: 0; padding: 0; font-size: var(--step-small); line-height: 1.45; max-width: 22ch; }
.facts strong { font: 700 var(--step-lead)/1.1 var(--display); letter-spacing: -0.02em; display: block; }

/* ---------- live replay of the Overheard chat ---------- */
.section { padding: clamp(96px, 12vw, 200px) var(--m); }
.replay { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; align-items: start; }
.replay .chat-wrap { grid-column: 1 / span 7; }
.replay .replay-copy { grid-column: 9 / span 4; }
.replay h2, .about h2 { font-size: var(--step-head); }
.replay-copy > p { margin-top: 28px; }
.controls { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.chat {
  background: #e9e8ea; color: #1d1a1c; font-family: var(--text);
  height: min(560px, 72svh); display: flex; flex-direction: column;
}
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: #fff; }
.chat-head .av { width: 40px; height: 40px; border-radius: 50%; background: #2f7fd6; color: #fff; display: grid; place-items: center; font: 700 14px/1 var(--display); flex: none; }
.chat-head b { font: 700 16px/1.2 var(--display); letter-spacing: -0.01em; display: block; }
.chat-head small { font-size: 14px; color: #5f5a5d; }
.chat-log {
  list-style: none; margin: 0; padding: 20px; flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth;
}
.msg { align-self: flex-start; max-width: 82%; background: #fff; padding: 10px 14px 8px; }
.msg.me { align-self: flex-end; background: #dcefcf; }
.msg .who { font: 700 14px/1.2 var(--display); letter-spacing: 0; display: block; margin-bottom: 2px; }
.msg .txt { font-size: var(--step-body); line-height: 1.4; }
.msg .meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 6px; min-height: 26px; }
.msg time { font-size: 14px; color: #5f5a5d; }
.react {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px;
  background: #fff; color: #b42318; border: 2px solid #f0a99f; border-radius: 13px; font: 700 14px/1.3 var(--display);
}
.msg.me .react { background: #f6fbf2; }
.js .msg.enter { animation: rise .45s var(--ease) both; }
.js .react.enter { animation: pop .5s var(--ease) both; }
.c-mert { color: #c2410c; } .c-sefa { color: #15803d; } .c-mehmet { color: #0f766e; } .c-ata { color: #0369a1; } .c-yasin { color: #9d174d; }

.hook-h { font: 700 var(--step-lead)/1.15 var(--display); letter-spacing: -0.02em; margin-top: 36px; }
.hook { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.hook li { background: var(--surface); padding: 12px 16px; }
.hook b { font: 700 var(--step-small)/1.3 var(--display); letter-spacing: 0; display: block; }
.hook span { font-size: var(--step-small); }
.hook q { display: block; font-style: italic; font-size: var(--step-small); color: var(--muted); margin-top: 2px; }
.js .hook li.enter { animation: rise .5s var(--ease) both; }
.status { font-size: var(--step-small); color: var(--muted); margin-top: 14px; min-height: 2.9em; }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.4); } 70% { transform: scale(1.12); } 100% { opacity: 1; transform: none; } }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; background: var(--surface); }
.about-intro { grid-column: 1 / span 5; }
.about-intro p { font-size: var(--step-lead); line-height: 1.4; margin-top: 32px; max-width: 30ch; }
.rows { grid-column: 7 / span 6; list-style: none; margin: 0; padding: 0; display: grid; gap: 40px; }
.row-top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.row h3 { font-size: var(--step-lead); letter-spacing: -0.02em; line-height: 1.15; }
.row .where { font-size: var(--step-small); color: var(--muted); text-align: right; }
.row p { margin-top: 10px; max-width: 58ch; }

/* ---------- contact: the email as display type ---------- */
.contact {
  position: relative; min-height: 84svh; background: var(--field); color: var(--field-ink);
  padding: var(--m); display: grid; grid-template-rows: auto 1fr auto; gap: 32px;
}
.contact h2 { font-size: var(--step-lead); letter-spacing: -0.02em; line-height: 1.2; max-width: 22ch; }
.contact .mail {
  align-self: end; font: 700 var(--step-display)/.9 var(--display); letter-spacing: -0.045em;
  text-decoration: none; overflow-wrap: anywhere; padding-bottom: 6vh;
  transition: color .3s var(--ease);
}
.contact .mail:hover { color: #fff3ee; }
.contact .mail span { display: block; transition: transform .4s var(--ease); }
.contact .mail:hover span:last-child { transform: translateX(12px); }
.contact-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: var(--step-small); }
.contact-foot a { min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- footer: one quiet line ---------- */
.foot {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center;
  padding: 24svh var(--m) 30px; font-size: var(--step-small); color: var(--muted);
}
.foot nav { display: flex; gap: 24px; }
.foot nav a { color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; }
.foot .yr { text-align: right; }
.foot .lang-toggle { color: var(--ink); }

/* ---------- entrances (only when JS runs) ---------- */
.js .reveal > * { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.in > * { opacity: 1; transform: none; }
.js .reveal.in > *:nth-child(2) { transition-delay: 70ms; }
.js .reveal.in > *:nth-child(3) { transition-delay: 140ms; }
.js .reveal.in > *:nth-child(4) { transition-delay: 210ms; }
.js .reveal.in > *:nth-child(5) { transition-delay: 280ms; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal > * { transform: none !important; transition: opacity .3s linear; }
  .pane, .torn .half, .hero-copy { transform: none !important; transition: none; }
  .js .msg.enter, .js .react.enter, .js .hook li.enter { animation: none; }
}

/* ---------- tablet ---------- */
@media (max-width: 1024px) {
  .hero-copy { left: var(--m); top: auto; bottom: calc(var(--corner) + 48px); max-width: 30ch; }
  .hero-nav { display: none; }
  .lang-inline { display: inline-flex; }
  .hero-media { width: 40vw; height: 50svh; }
  .hero-media figcaption { display: none; }
  .stage { grid-template-columns: 1fr; align-content: center; justify-items: start; gap: 18px; }
  .panes { width: min(78vw, 46svh * 1.6); justify-self: center; }
  .side-l { order: 2; max-width: 60ch; }
  .side-r { order: 3; justify-self: start; text-align: left; align-items: flex-start; }
  .side-r .work-h, .facts { display: none; }
  .replay .chat-wrap { grid-column: 1 / -1; order: 2; }
  .replay .replay-copy { grid-column: 1 / -1; }
  .about-intro, .rows { grid-column: 1 / -1; }
  .rows { margin-top: 24px; }
  .contact { min-height: 0; gap: 18vh; }
}

/* ---------- phone ---------- */
@media (max-width: 640px) {
  :root { --step-display: 15vw; }
  .hero { min-height: 560px; }
  .hero-media { top: auto; bottom: calc(var(--corner) + 16px); left: 0; right: 0; width: 100%; height: 36svh; }
  .hero-media video, .hero-media img { object-position: 50% 32%; }
  .hero-copy { top: calc(var(--corner) + 28px); bottom: auto; left: var(--m); right: var(--m); max-width: none; }
  .hero-actions { margin-top: 18px; gap: 4px 22px; }
  .torn { font-size: 11.5vw; }
  .stage { gap: 12px; }
  .pinned .stage { padding-block: calc(var(--corner) + 12px); }
  .panes { width: 86%; }
  .side-l .kind { margin-bottom: 6px; }
  .pinned .side-l p:not(.kind) { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
  .chat { height: 64svh; }
  .contact { gap: 10vh; }
  .contact .mail { font-size: 11.5vw; padding-bottom: 2vh; }
  .contact-foot { flex-direction: column; gap: 0; }
  .foot { grid-template-columns: 1fr; gap: 4px; padding-top: 16svh; padding-bottom: 24px; }
  .foot nav { flex-wrap: wrap; gap: 0 20px; }
  .foot .yr { text-align: left; }
}
