/* ============================================================
   ECHO EAST — Dark / High-end redesign
   Tokens · Base · Components
   Heading: Sorts Mill Goudy · Body: Aeonik (Hanken Grotesk stand-in)
   ============================================================ */

/* ---- Aeonik (real brand body font) ---- */
@font-face {
  font-family: "Aeonik";
  src: url("fonts/Aeonik-Regular.ttf") format("truetype");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Aeonik";
  src: url("fonts/Aeonik-Bold.ttf") format("truetype");
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}

/* ---- Sorts Mill Goudy (real brand display font) ---- */
@font-face {
  font-family: "Sorts Mill Goudy";
  src: url("fonts/SortsMillGoudy-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sorts Mill Goudy";
  src: url("fonts/SortsMillGoudy-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  /* ---------- Surfaces ---------- */
  --bg:        #14151a;   /* page base */
  --bg-2:      #181a20;   /* alt section */
  --surface:   #1b1d24;   /* cards */
  --surface-2: #212430;   /* raised / hover */
  --surface-3: #2a2d3a;

  /* ---------- Lines ---------- */
  --line:      rgba(255,255,255,0.09);
  --line-2:    rgba(255,255,255,0.14);
  --line-3:    rgba(255,255,255,0.22);

  /* ---------- Text ---------- */
  --fg:        #f4f3f1;   /* primary */
  --fg-2:      #c5c6cc;   /* secondary */
  --fg-3:      #8b8d97;   /* muted / meta */
  --fg-4:      #5d5f68;   /* faint */

  /* ---------- Primary (crimson) ---------- */
  --primary:       #b91515;
  --primary-bright:#e21f1f;
  --primary-deep:  #8c0f0f;
  --primary-tint:  rgba(185,21,21,0.14);
  --primary-glow:  rgba(185,21,21,0.45);

  /* ---------- Signature gradient (logo line only) ---------- */
  --ee-green:  #49A078;
  --ee-yellow: #E3B911;
  --ee-orange: #CF5906;
  --ee-red:    #BB1D13;
  --star-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.95 6.46 7.05.77-5.27 4.74 1.5 6.93L12 18.1l-6.23 3.7 1.5-6.93L2 10.23l7.05-.77z'/%3E%3C/svg%3E"); /* @kind other */
  --ee-gradient: linear-gradient(90deg,
    var(--ee-green) 0%, var(--ee-yellow) 40%,
    var(--ee-orange) 75%, var(--ee-red) 100%);

  /* ---------- Type ---------- */
  --font-display: "Sorts Mill Goudy", Georgia, "Times New Roman", serif;
  --font-body:    "Aeonik", "Hanken Grotesk", ui-sans-serif, system-ui,
                  -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono:    "Aeonik", "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif; /* @kind font */ /* no separate mono — 2 fonts only */

  --fs-display: clamp(34px, 5vw, 50px); /* @kind font */
  --fs-h1:      clamp(40px, 5vw, 50px);   /* @kind font */
  --fs-h2:      clamp(30px, 3.6vw, 48px);  /* @kind font */
  --fs-h3:      clamp(24px, 2.4vw, 36px);  /* @kind font */
  --fs-h4:      clamp(20px, 1.6vw, 24px);  /* @kind font */
  --fs-lead:    clamp(18px, 1.4vw, 22px);  /* @kind font */
  --fs-body:    17px;   /* @kind font */
  --fs-small:   15px;   /* @kind font */
  --fs-eyebrow: 12.5px; /* @kind font */

  --lh-display: 0.98; /* @kind font */
  --lh-tight:   1.04; /* @kind font */
  --lh-head:    1.12; /* @kind font */
  --lh-body:    1.62; /* @kind font */

  --ls-display: -0.015em; /* @kind font */
  --ls-head:    -0.01em;  /* @kind font */
  --ls-eyebrow: 0.22em;   /* @kind font */
  --ls-button:  0.14em;   /* @kind font */

  /* ---------- Radii ---------- */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* ---------- Spacing ---------- */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --s-9: 96px; --s-10: 128px; --s-11: 176px;

  /* ---------- Layout (wide, thin gutters) ---------- */
  --gutter: clamp(20px, 4.2vw, 72px); /* @kind spacing */
  --maxw:   1720px; /* @kind spacing */
  --maxw-text: 760px; /* @kind spacing */

  /* ---------- Motion ---------- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);     /* @kind other */
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);  /* @kind other */
  --d1: 160ms; /* @kind other */
  --d2: 300ms; /* @kind other */
  --d3: 560ms; /* @kind other */

  --shadow-1: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-2: 0 18px 48px rgba(0,0,0,0.45);
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
/* mobile-only side-scroll guard — on body (not html) so it can't turn the root into a
   clip container, which broke window scrolling + the featured-video sticky on desktop.
   csv is the only sticky element and it's static on mobile, so body clip is safe here. */
@media (max-width: 760px) { body { overflow-x: clip; } }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--fg-2);
  background: var(--bg);
  font-weight: 400;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
::selection { background: var(--primary); color: #fff; }

/* ---------- Type elements ---------- */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--fg);
  letter-spacing: var(--ls-head);
  margin: 0;
  text-wrap: balance;
}
.display { font-size: var(--fs-display); line-height: var(--lh-display); letter-spacing: var(--ls-display); }
h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-h2); line-height: var(--lh-head); }
h3 { font-size: var(--fs-h3); line-height: var(--lh-head); }
h4 { font-family: var(--font-body); font-weight: 600; font-size: var(--fs-h4); color: var(--fg); margin: 0; letter-spacing: -0.01em; }
p  { margin: 0; text-wrap: pretty; }
a  { color: inherit; text-decoration: none; }

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--fg-3);
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
}
.eyebrow--primary { color: var(--primary-bright); }
.eyebrow::before {
  content: "";
  width: 28px; height: 1px;
  background: currentColor;
  opacity: 0.6;
}
.eyebrow.no-tick::before { display: none; }

.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--fg-2); }
.muted { color: var(--fg-3); }
.serif-italic { font-family: var(--font-display); font-style: italic; }

/* ============================================================
   LAYOUT
   ============================================================ */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: clamp(72px, 9vw, 152px); }
.section--tight { padding-block: clamp(48px, 6vw, 96px); }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* signature gradient hairline (used sparingly) */
.ee-rule { height: 2px; width: 100%; background: var(--ee-gradient); border: 0; }
[hidden] { display: none !important; }

/* ---------- 4 continuous vertical lines (column frame) ---------- */
.frame-lines { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.frame-lines__inner {
  max-width: var(--maxw); height: 100%; margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid; grid-template-columns: repeat(3, 1fr);
}
.frame-lines__inner > span { border-left: 1px solid rgba(255,255,255,0.06); }
.frame-lines__inner > span:last-child { border-right: 1px solid rgba(255,255,255,0.06); }
@media (max-width: 760px) {
  /* just the two outer lines, full height (3 stacked spans broke the right line) */
  .frame-lines__inner { display: block;
    border-left: 1px solid rgba(255,255,255,0.06); border-right: 1px solid rgba(255,255,255,0.06); }
  .frame-lines__inner > span { display: none; }
}

/* ---------- Page loader: black screen, EE mark, 4 lines; middle 3 panels slide up to REVEAL ---------- */
.loader { position: fixed; inset: 0; z-index: 9999; background: transparent; }
.loader__cols { position: absolute; inset: 0; max-width: var(--maxw); margin-inline: auto;
  padding-inline: var(--gutter); display: grid; grid-template-columns: repeat(3, 1fr); }
.loader__col { position: relative; background: #000; will-change: transform;
  transition: transform 0.85s cubic-bezier(0.76, 0, 0.24, 1); }
/* outer panels carry the page margins up with them */
.loader__col:first-child::before { content: ""; position: absolute; top: 0; bottom: 0; right: 100%; width: 100vw; background: #000; }
.loader__col:last-child::after { content: ""; position: absolute; top: 0; bottom: 0; left: 100%; width: 100vw; background: #000; }
.loader__lines { position: absolute; inset: 0; max-width: var(--maxw); margin-inline: auto;
  padding-inline: var(--gutter); display: grid; grid-template-columns: repeat(3, 1fr); pointer-events: none; }
.loader__lines > span { border-left: 1px solid rgba(255,255,255,0.10); }
.loader__lines > span:last-child { border-right: 1px solid rgba(255,255,255,0.10); }
.loader__mark { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: clamp(96px, 12vw, 150px); height: auto; opacity: 1; }
.loader.go .loader__mark { opacity: 0; transform: translate(-50%, -54%); transition: opacity 0.4s var(--ease), transform 0.4s var(--ease); }
.loader.go .loader__col { transform: translateY(-100%); }
.loader.go .loader__col:nth-child(1) { transition-delay: 0.04s; }
.loader.go .loader__col:nth-child(2) { transition-delay: 0.16s; }
.loader.go .loader__col:nth-child(3) { transition-delay: 0.28s; }
.loader.done { display: none; }
@media (max-width: 760px) {
  .loader__cols, .loader__lines { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .loader__mark { animation: none; opacity: 1; }
  .loader.go .loader__col { transition: none; }
}

/* ---------- images: square corners everywhere ---------- */
.ph, .ws-card__img, .work-card__media, .cs-hero__media, .csv__frame,
.cs-gallery .ph, .cs-block__media, .tslide__media,
.work-card__media img, .work-card__media video { border-radius: 0 !important; }

/* ============================================================
   BUTTONS — white pill, brand-gradient outline, 360° spin on hover
   ============================================================ */
@property --ee-angle { syntax: "<angle>"; inherits: true; initial-value: 0deg; }
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: var(--ls-button);
  text-transform: uppercase;
  padding: 16px 32px;
  border-radius: var(--r-pill);
  border: 1.5px solid transparent;
  background: linear-gradient(#fff, #fff) padding-box,
    conic-gradient(from var(--ee-angle),
      var(--ee-green), var(--ee-yellow), var(--ee-orange), var(--ee-red), var(--ee-green)) border-box;
  color: #0a0a0a;
  white-space: nowrap;
  line-height: 1;
  transition: transform var(--d1) var(--ease), --ee-angle 0.9s linear;
}
.btn:active { transform: translateY(1px); }
/* variants now all read as the white gradient-outline button */
.btn--sm { padding: 12px 24px; font-size: 12px; }
.btn--lg { padding: 19px 40px; font-size: 14px; }
.btn .arrow { transition: transform var(--d1) var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* text link — matches nav menu items: bold, uppercase, 0.5px gradient underline */
.link-u {
  position: relative;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--fg-2);
  display: inline-flex; align-items: center; gap: 8px;
  background-image: var(--ee-gradient);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 0.5px;
  transition: background-size var(--d2) var(--ease);
  padding-bottom: 4px;
}
.link-u:hover { color: var(--fg-2); background-size: 100% 0.5px; }

/* ============================================================
   NAV — sticky, no bg, top fade so items read
   ============================================================ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 200;
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: var(--s-6);
  padding: clamp(18px, 2.4vw, 30px) var(--gutter);
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav__actions { justify-self: end; display: flex; align-items: center; gap: var(--s-4); }
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(10,11,14,0.85) 0%, rgba(10,11,14,0.4) 45%, rgba(10,11,14,0) 100%);
  opacity: 1; transition: opacity var(--d2) var(--ease);
  pointer-events: none;
}
.nav__logo { position: relative; z-index: 130; display: inline-block; }
.nav__logo svg, .nav__logo img { height: 26px; width: auto; }

/* ---- Hamburger toggle (circular, top-right) ---- */
.nav__burger {
  position: relative; z-index: 160;
  display: inline-flex; align-items: center; justify-content: center;
  width: clamp(46px, 5vw, 54px); height: clamp(46px, 5vw, 54px);
  border-radius: 50%;
  border: 1.5px solid rgba(244, 243, 241, 0.5);
  background: transparent; padding: 0; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color var(--d1) var(--ease);
}
.nav__burger:hover { border-color: var(--fg); }
.nav__burger-lines { position: relative; width: 20px; height: 12px; }
.nav__burger-lines span {
  position: absolute; left: 0; width: 100%; height: 1.5px; border-radius: 2px;
  background: var(--fg);
  transition: transform var(--d2) var(--ease), background var(--d1) var(--ease);
}
.nav__burger-lines span:nth-child(1) { top: 1px; }
.nav__burger-lines span:nth-child(2) { bottom: 1px; }
/* open → X, sitting on the white panel so it flips dark */
.nav__burger.is-open { border-color: rgba(10, 10, 10, 0.45); }
.nav__burger.is-open:hover { border-color: #0a0a0a; }
.nav__burger.is-open .nav__burger-lines span { background: #0a0a0a; }
.nav__burger.is-open .nav__burger-lines span:nth-child(1) { top: 5px; transform: rotate(45deg); }
.nav__burger.is-open .nav__burger-lines span:nth-child(2) { bottom: 6px; transform: rotate(-45deg); }

/* ---- Popup menu panel (anchored top-right, scales in) ---- */
.navpop {
  position: fixed; z-index: 150;
  /* burger sits at nav-padding top / gutter right; inset the panel 10px past it
     on both edges so the X has equal space on top and right */
  top: calc(clamp(18px, 2.4vw, 30px) - 10px);
  right: calc(var(--gutter) - 10px);
  width: min(300px, calc(100vw - 2 * var(--gutter)));
  background: #fff; color: #0a0a0a;
  border-radius: 26px;
  padding: clamp(74px, 8vw, 86px) clamp(24px, 3vw, 32px) clamp(24px, 3vw, 30px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  transform-origin: top right;
  transform: scale(0.84); opacity: 0; visibility: hidden;
  transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.28s var(--ease),
              visibility 0s linear 0.42s;
}
.navpop.open {
  transform: scale(1); opacity: 1; visibility: visible;
  transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.26s var(--ease);
}
.navpop__links { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.navpop__links a {
  position: relative;
  font-family: var(--font-body);
  font-size: clamp(22px, 2.4vw, 26px); font-weight: 500; letter-spacing: -0.01em;
  line-height: 1.34; color: #0a0a0a;
}
.navpop__links a::after {
  content: ""; position: absolute; left: 0; bottom: 3px; width: 100%; height: 1.5px;
  background: var(--ee-gradient); transform: scaleX(0); transform-origin: left;
  transition: transform var(--d2) var(--ease);
}
.navpop__links a:hover::after, .navpop__links a[aria-current="page"]::after { transform: scaleX(1); }
.navpop__cta { margin-top: clamp(20px, 2.4vw, 26px); align-self: flex-start; }

/* ---- Scrim behind the panel ---- */
.navpop-scrim {
  position: fixed; inset: 0; z-index: 105;
  background: rgba(8, 9, 12, 0.5);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.32s var(--ease), visibility 0s linear 0.32s;
}
.navpop-scrim.open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 0.32s var(--ease); }

/* mobile landscape & below: drop the bar CTA, leave just the hamburger */
@media (max-width: 900px) {
  .nav__actions > .btn { display: none; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--bg-2); border-top: 1px solid var(--line); padding-block: clamp(56px, 7vw, 104px) var(--s-7); }
.footer__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-8); }
.footer__cols { display: flex; flex-wrap: wrap; gap: clamp(40px, 6vw, 96px); }
.footer__col h5 {
  font-family: var(--font-body); font-size: 12.5px; font-weight: 600;
  letter-spacing: var(--ls-eyebrow); text-transform: uppercase; color: var(--fg-3);
  margin: 0 0 var(--s-5);
}
.footer__col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-3); }
.footer__col a { color: var(--fg-2); font-size: 15px;
  background-image: var(--ee-gradient); background-repeat: no-repeat; background-position: 0 100%;
  background-size: 0% 0.5px; transition: background-size var(--d2) var(--ease); padding-bottom: 2px; }
.footer__col a:hover { color: var(--fg-2); background-size: 100% 0.5px; }
.footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s-4);
  margin-top: var(--s-8); padding-top: var(--s-6); border-top: 2px solid transparent; border-image: var(--ee-gradient) 1;
  font-size: 13.5px; color: var(--fg-3);
}

/* ============================================================
   REVEAL — scroll entrance
   ============================================================ */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: 0.08s; }
.reveal[data-d="2"] { transition-delay: 0.16s; }
.reveal[data-d="3"] { transition-delay: 0.24s; }
.reveal[data-d="4"] { transition-delay: 0.32s; }
.reveal[data-d="5"] { transition-delay: 0.40s; }
.reveal[data-d="6"] { transition-delay: 0.48s; }
.reveal[data-d="7"] { transition-delay: 0.56s; }

/* fade only — no upward shift */
.reveal.rv-fade { transform: none; }

/* wipe out from a frame line (clip reveal, left→right or right→left) */
.reveal.rv-wipe-l, .reveal.rv-wipe-r {
  opacity: 1; transform: none;
  transition: clip-path 0.9s var(--ease), opacity 0.5s var(--ease);
}
.reveal.rv-wipe-l { clip-path: inset(0 100% 0 0); }
.reveal.rv-wipe-r { clip-path: inset(0 0 0 100%); }
.reveal.rv-wipe-l.in, .reveal.rv-wipe-r.in { clip-path: inset(0 0 0 0); }

/* pop up with a little bounce */
.reveal.rv-pop { transform: translateY(28px) scale(0.94);
  transition: opacity 0.55s var(--ease), transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1); }
.reveal.rv-pop.in { opacity: 1; transform: translateY(0) scale(1); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .reveal.rv-wipe-l, .reveal.rv-wipe-r { clip-path: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   PLACEHOLDER (labelled drop-zones for real assets)
   ============================================================ */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.022) 0 14px, rgba(255,255,255,0) 14px 28px),
    var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: var(--fg-4);
}
.ph__label {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em;
  color: var(--fg-3); text-transform: lowercase;
  padding: 6px 12px; border: 1px solid var(--line-2); border-radius: var(--r-pill);
  background: rgba(0,0,0,0.3); backdrop-filter: blur(4px);
}
