/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: "Ovo";
  src: url("../assets/fonts/ovo-latin.woff2") format("woff2");
  font-display: swap;
}
/* Ovo has no Hungarian ő/ű glyphs — those fall back to Alice */
@font-face {
  font-family: "Alice";
  src: url("../assets/fonts/alice-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
  font-display: swap;
}
@font-face {
  font-family: "Alice";
  src: url("../assets/fonts/alice-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2C60-2C7F, U+A720-A7FF;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Brand */
  --magenta: #88003b;
  --magenta-text: #992557;      /* lighter magenta used for headings and copy on white (from the Canva design) */
  --teal: #017e85;
  --navy: #182c60;

  /* Text */
  --ink: #2b2b2b;
  --on-dark: #fff;              /* text on dark and brand backgrounds */

  /* Surfaces */
  --surface: #fff;
  --surface-black: #000;
  --surface-charcoal: #252627;
  --surface-hero: #1a1a1a;      /* behind the hero photo while it loads */
  --surface-flow: #1d1d1f;      /* behind the flow video poster while it loads */
  --paper: #f4f4f4;             /* stacked document sheets */

  --font: "Ovo", "Alice", Georgia, "Times New Roman", serif;
  --wrap: 1100px;
  --wrap-wide: 1200px;
  --gutter: clamp(16px, 5vw, 48px);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  overflow-x: clip; /* entry animations start up to 56px off to the side */
}
body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.5;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, figure, blockquote, dl, dd { margin: 0; font-weight: 400; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
address { font-style: normal; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 10vw, 120px); position: relative; }
.section-title { font-size: clamp(2rem, 4vw, 2.75rem); text-align: center; line-height: 1.15; }
.rule { border: 0; border-top: 1px solid currentColor; margin: 28px 0 0; }
:is(a, button):focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* ---------- Language toggle ---------- */
.lang {
  display: flex; gap: 4px; font-size: .9rem; letter-spacing: .08em;
}
.lang a, .lang span {
  padding: 4px 8px; text-decoration: none; border: 1px solid transparent; border-radius: 3px;
}
.lang [aria-current] { border-color: currentColor; }
.lang a:hover { text-decoration: underline; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: clip;
  min-height: 100svh;
  display: flex; flex-direction: column;
  color: var(--on-dark);
  background: var(--surface-hero);
}
.hero-photo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 35%;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgb(0 0 0 / .25), rgb(0 0 0 / 0) 25%, rgb(0 0 0 / .2) 50%, rgb(0 0 0 / .6) 78%, rgb(0 0 0) 100%);
}
.hero > :not(.hero-photo) { position: relative; z-index: 1; }
.hero-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px var(--gutter);
}
.hero-bar .logo { width: clamp(190px, 26vw, 290px); }
.hero-text {
  margin-top: auto; text-align: center;
  padding: 0 var(--gutter) clamp(48px, 10vh, 110px);
  text-shadow: 0 1px 12px rgb(0 0 0 / .45);
}
.hero h1 { font-size: clamp(1.9rem, 4.6vw, 3.4rem); line-height: 1.1; max-width: 32ch; margin-inline: auto; }
.hero-text p { margin-top: 18px; font-size: clamp(1rem, 1.6vw, 1.15rem); max-width: 60ch; margin-inline: auto; }

/* ---------- What I do ---------- */
.services { background: var(--surface-black); color: var(--on-dark); padding-block: clamp(96px, 16vw, 200px); }
.services .section-title { font-size: clamp(2.5rem, 5vw, 3.6rem); }
.services-grid {
  display: grid; gap: 56px 40px; margin-top: clamp(64px, 9vw, 120px);
  grid-template-columns: repeat(4, 1fr); text-align: center;
}
.services h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); letter-spacing: .03em; margin-bottom: 18px; }
.services p { font-size: clamp(1.15rem, 1.6vw, 1.35rem); line-height: 1.4; max-width: 20ch; margin-inline: auto; }

/* ---------- About ---------- */
.about-grid {
  display: grid; grid-template-columns: minmax(220px, 1fr) 1.5fr auto;
  gap: clamp(32px, 5vw, 64px); align-items: center;
}
.about-photo { border-radius: 40px; aspect-ratio: 3 / 4; object-fit: cover; width: 100%; max-width: 360px; }
.about h2 { color: var(--magenta-text); font-size: clamp(2rem, 3.5vw, 2.5rem); margin-bottom: 20px; }
.about p { font-size: 1rem; line-height: 1.45; }
.about p + p { margin-top: 1em; }
.about-diamonds { display: grid; gap: 56px; }
.diamond { width: 42px; fill: var(--surface); }
.diamond--teal { color: var(--teal); }
.diamond--navy { color: var(--navy); }
.diamond--magenta { color: var(--magenta); }

/* ---------- The flow ---------- */
.flow {
  color: var(--on-dark); background: var(--surface-flow);
  padding-block: clamp(120px, 18vw, 240px);
}
/* JS plays the video unless reduced motion is requested; otherwise the poster stays */
.flow-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.flow::before { content: ""; position: absolute; inset: 0; z-index: 1; background: rgb(0 0 0 / .45); }
.flow > .wrap { position: relative; z-index: 2; }
.flow-steps {
  list-style: none; margin: clamp(48px, 7vw, 80px) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; text-align: center;
}
.flow-steps svg { width: 64px; margin: 0 auto 24px; }
.flow-steps span { font-size: 1.15rem; display: block; max-width: 18ch; margin-inline: auto; line-height: 1.35; }
.video-toggle {
  position: absolute; right: var(--gutter); bottom: 24px; z-index: 2;
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  color: var(--on-dark); background: rgb(0 0 0 / .3);
  border: 1px solid currentColor; border-radius: 50%; cursor: pointer;
}
.video-toggle[hidden] { display: none; }
.video-toggle svg { width: 18px; }
.video-toggle .icon-play, .video-toggle.is-paused .icon-pause { display: none; }
.video-toggle.is-paused .icon-play { display: block; }

/* ---------- Content strategy ---------- */
.strategy { background: var(--surface-charcoal); color: var(--on-dark); }
.strategy .rule { border-color: rgb(255 255 255 / .85); margin-bottom: clamp(48px, 7vw, 80px); }
.docs {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; text-align: center;
}
.doc-stack { position: relative; width: min(170px, 60%); margin: 0 auto 28px; }
.doc-stack::before, .doc-stack::after {
  content: ""; position: absolute; inset: 0; background: var(--paper);
  box-shadow: 0 2px 8px rgb(0 0 0 / .35);
}
.doc-stack::before { transform: rotate(-6deg) translate(-6px, 4px); }
.doc-stack::after { transform: rotate(4deg) translate(6px, 2px); }
.doc-stack img { position: relative; z-index: 1; width: 100%; aspect-ratio: 1 / 1.414; object-fit: cover; object-position: top; box-shadow: 0 2px 10px rgb(0 0 0 / .4); }
.docs p { font-size: .95rem; max-width: 16ch; margin-inline: auto; text-wrap: balance; }

/* ---------- Clients ---------- */
.clients { padding-top: 0; overflow: clip; z-index: 1; } /* clips the chevron's drop-in; sits above the testimonials logo mark */
.clients-head { position: relative; display: flex; justify-content: flex-end; align-items: flex-start; }
.chevron { position: absolute; left: 40%; top: 0; width: clamp(120px, 20vw, 220px); color: var(--magenta); fill: var(--surface); }
.clients h2 { color: var(--magenta-text); font-size: clamp(2.2rem, 4vw, 2.9rem); padding-top: clamp(16px, 3vw, 32px); margin-right: 5%; }
/* Hand-placed so the curved text tucks under the heading and over the first logo */
.take-a-look { width: 150px; margin: clamp(20px, 4vw, 48px) 0 -40px -10px; position: relative; z-index: 1; }
.take-a-look text { font-family: var(--font); font-size: 24px; fill: var(--magenta); }
.client-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 4vw, 56px);
}
.client-list a {
  display: grid; place-items: center;
  aspect-ratio: 5 / 7; border-radius: 999px; background: var(--surface);
  box-shadow: 0 6px 18px rgb(0 0 0 / .18); padding: 14%;
  transition: transform .2s ease, box-shadow .2s ease;
}
.client-list a:hover, .client-list a:focus-visible { transform: translateY(-4px); box-shadow: 0 10px 26px rgb(0 0 0 / .22); }
.client-list img { border-radius: 8px; }

/* ---------- Testimonials ---------- */
.testimonials { padding-bottom: 0; clip-path: inset(-100vh 0 0); } /* crops the phone mockup at the bottom; the logo mark may rise into the section above */
.testimonials-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.testimonials-grid > :first-child { padding-bottom: clamp(64px, 10vw, 120px); }
.testimonials h2 { color: var(--magenta-text); font-size: clamp(2.4rem, 4.5vw, 3.2rem); line-height: 1.05; margin-bottom: 36px; max-width: min-content; }
.testimonial { color: var(--magenta-text); max-width: 52ch; }
.testimonial p { font-size: .95rem; line-height: 1.5; }
.testimonial p + p { margin-top: 1em; }
.testimonial figcaption { text-align: right; margin-top: 16px; }
.testimonial-art { position: relative; min-height: 600px; display: flex; justify-content: center; align-items: flex-end; }
.testimonial-art .logo-mark { position: absolute; top: clamp(-360px, -24vw, -160px); left: -8%; width: 112%; color: var(--magenta); pointer-events: none; }
.testimonial-art .phone {
  --phone-w: min(290px, 66vw);
  position: relative; width: var(--phone-w); margin-left: auto;
  margin-bottom: calc(var(--phone-w) * 566 / 318 / -3); /* lower third runs off the section (image is 318×566) */
  transform: rotate(8deg); filter: drop-shadow(0 10px 20px rgb(0 0 0 / .25));
}

/* ---------- Contact ---------- */
.contact { background: var(--magenta); color: var(--on-dark); padding-bottom: 0; }
.contact .rule { border-color: rgb(255 255 255 / .85); margin-bottom: clamp(56px, 8vw, 96px); }
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; text-align: center; }
.contact dt { font-size: 1.1rem; margin-bottom: 10px; }
.contact a { text-decoration: none; overflow-wrap: anywhere; }
.contact dd a { display: block; }
.contact a:hover { text-decoration: underline; }

/* ---------- Legal links ---------- */
.legal { font-size: .85rem; text-align: center; }
.legal a { text-decoration: none; }
.legal a:hover { text-decoration: underline; }
.site-footer { background: var(--magenta); color: var(--on-dark); padding: clamp(96px, 14vw, 180px) var(--gutter) 24px; }
.site-footer .legal { opacity: .85; }
.case-page > .legal { padding: 0 var(--gutter) 24px; }

/* ---------- Case study pages ---------- */
.case-page { min-height: 100svh; display: flex; flex-direction: column; }
.case-bar { display: flex; justify-content: flex-end; padding: 20px var(--gutter); color: var(--magenta); }
.case {
  flex: 1; display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(32px, 5vw, 72px);
  align-items: center; max-width: var(--wrap-wide); margin: 0 auto; padding: 24px var(--gutter) 40px;
}
.case h1 { color: var(--magenta); font-size: clamp(2rem, 3.6vw, 2.6rem); line-height: 1.1; }
.case .kicker { color: var(--navy); text-transform: uppercase; letter-spacing: .18em; font-size: .9rem; margin-top: 8px; }
.case .rule { border-color: var(--ink); margin: 18px 0 24px; max-width: 420px; transform-origin: left; }
.case .lede { font-size: 1.2rem; margin-bottom: 20px; }
.case-body p { font-size: 1rem; line-height: 1.55; }
.case-body p + p { margin-top: 1em; }
.case-links { display: flex; gap: 16px; margin-top: 40px; padding-left: 64px; }
.case-links a { width: 34px; height: 34px; display: grid; place-items: center; }
.case-links a:hover { opacity: .7; }
.case-links svg { width: 100%; height: 100%; fill: var(--surface); }
.case-visual { box-shadow: 0 4px 22px rgb(0 0 0 / .18); background: var(--surface); padding: 2%; }
.home-link { position: fixed; right: var(--gutter); bottom: 20px; width: 34px; height: 34px; color: var(--surface-black); }
.home-link:hover { color: var(--magenta); }

/* ---------- Simple pages (legal, 404) ---------- */
.page { max-width: 70ch; margin: 0 auto; padding: clamp(48px, 8vw, 96px) var(--gutter); }
.page h1 { color: var(--magenta); font-size: clamp(2rem, 3.6vw, 2.6rem); line-height: 1.1; margin-bottom: 32px; }
.page h2 { color: var(--magenta-text); font-size: 1.3rem; margin: 32px 0 8px; }
.page p + p { margin-top: 1em; }

/* ---------- Entry animations (js/main.js adds .is-in) ---------- */
.js [data-anim] {
  opacity: 0;
  transition:
    opacity .9s ease var(--delay, 0ms),
    translate 1s cubic-bezier(.2, .7, .2, 1) var(--delay, 0ms),
    scale 1s cubic-bezier(.2, .7, .2, 1) var(--delay, 0ms);
}
.js [data-anim="rise"] { translate: 0 36px; }
.js [data-anim="drop"] { translate: 0 -48px; }
.js [data-anim="slide-right"] { translate: -56px 0; }
.js [data-anim="slide-left"] { translate: 56px 0; }
.js [data-anim="pop"] { scale: .82; }
.js [data-anim="grow"] { scale: 0 1; }
/* Zoom only scales, never fades: it's used on the hero photo, and hiding that would delay LCP */
.js [data-anim="zoom"] {
  opacity: 1; scale: 1.1;
  transition: scale 2.6s cubic-bezier(.2, .7, .2, 1);
}
.js [data-anim].is-in { opacity: 1; translate: none; scale: none; }

/* Safety net: if main.js never runs (failed to load, error), reveal everything after 2s.
   main.js adds .anim-ready on start, which cancels this. */
@keyframes reveal { to { opacity: 1; translate: none; scale: none; } }
.js:not(.anim-ready) [data-anim] { animation: reveal 0s 2s forwards; }

/* ---------- Responsive ---------- */
@media (width <= 900px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; justify-items: center; text-align: left; }
  .about-diamonds { grid-auto-flow: column; gap: 40px; }
  .client-list { grid-template-columns: repeat(2, 1fr); max-width: 460px; margin-inline: auto; }
  .testimonials-grid { grid-template-columns: 1fr; }
  .testimonial-art { min-height: 420px; }
  .testimonial-art .phone { margin-right: auto; }
  .testimonials-grid > :first-child { padding-bottom: 0; }
  .testimonial-art .logo-mark { top: 0; left: 50%; transform: translateX(-50%); width: min(400px, 90%); }
  .case { grid-template-columns: 1fr; }
  .case-links { padding-left: 0; }
  .case-visual { order: -1; }
}
@media (width <= 600px) {
  .services-grid, .flow-steps, .docs, .contact-grid { grid-template-columns: 1fr; }
  .flow-steps { gap: 48px; }
  .chevron { left: 0; }
  .clients h2 { margin-right: 0; }
  .take-a-look { margin-bottom: -24px; }
  .hero-photo { object-position: 58% 35%; }
  .home-link { position: static; margin: 0 var(--gutter) 24px auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-anim] { opacity: 1; translate: none; scale: none; transition: none; }
  .client-list a { transition: none; }
}

/* ---------- Print ---------- */
@media print {
  .js [data-anim] { opacity: 1; translate: none; scale: none; transition: none; animation: none; }
  .hero-photo, .hero::after, .flow-video, .video-toggle, .home-link,
  .about-diamonds, .testimonial-art, .take-a-look { display: none; }
  .hero, .services, .flow, .strategy, .contact, .site-footer { color: var(--ink); background: none; min-height: 0; }
  .flow::before { content: none; }
  .hero .logo { filter: invert(1); }
  .hero-text { text-shadow: none; }
  .section { padding-block: 32px; }
  .site-footer { padding-top: 32px; }
}
