/* ========= Tokens — pulled from Ella's emblem ========= */
:root {
  --blue: #4b46e6;       /* emblem ultramarine */
  --blue-deep: #2a2596;
  --red: #e5173f;        /* halftone red */
  --pink: #c95a78;       /* the shelving unit */
  --yellow: #fff27a;     /* snake yellow */
  --peach: #ffe0cc;      /* old site background */
  --paper: #fff7f1;
  --ink: #1c1940;
  --ink-soft: #5b5878;

  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Space Grotesk", system-ui, sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1280px;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; }

.eyebrow {
  margin: 0 0 18px;
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--blue);
}

/* ========= Buttons ========= */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 24px;
  border-radius: 999px;
  background: var(--blue); color: #fff;
  font-weight: 500; text-decoration: none;
  border: 2px solid var(--blue);
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-2px); background: var(--red); border-color: var(--red); }
.btn-ghost { background: transparent; color: var(--blue); }
.btn-ghost:hover { color: #fff; }
.btn-light { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.btn-small { padding: 9px 18px; font-size: 15px; }

/* ========= Nav ========= */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid color-mix(in srgb, var(--blue) 12%, transparent);
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; }
.nav-links { display: flex; gap: 28px; margin-left: auto; }
.nav-links a { text-decoration: none; font-size: 15px; color: var(--ink-soft); }
.nav-links a:hover { color: var(--blue); }

.nav-menu {
  display: none; place-content: center; gap: 5px;
  width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
  background: color-mix(in srgb, var(--blue) 10%, transparent); cursor: pointer;
}
.nav-menu span:not(.sr) { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .2s ease; }
.nav-open .nav-menu span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-open .nav-menu span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ========= Hero ========= */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(48px, 9vw, 120px) var(--gutter) clamp(56px, 8vw, 100px);
  display: grid; grid-template-columns: 1.15fr 1fr; align-items: center; gap: 48px;
}
.hero h1 {
  font-size: clamp(64px, 11vw, 168px);
  line-height: .88; letter-spacing: -0.045em;
  color: var(--blue);
}
.hero-line { margin: 28px 0 0; font-size: clamp(26px, 3.2vw, 40px); font-weight: 500; line-height: 1.1; }
.hero-line em { color: var(--red); }
.hero-sub { max-width: 34em; margin: 20px 0 0; color: var(--ink-soft); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.facts {
  list-style: none; padding: 0; margin: 40px 0 0;
  display: grid; grid-template-columns: repeat(4, auto); gap: 12px 32px; justify-content: start;
  font-size: 15px;
}
.facts span {
  display: block; margin-bottom: 2px;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft);
}

.hero-mark { position: relative; aspect-ratio: 1; max-width: 520px; justify-self: center; width: 100%; }
.hero-mark img { position: absolute; inset: 11%; width: 78%; height: 78%; object-fit: contain;
  filter: drop-shadow(0 24px 40px rgb(75 70 230 / .25)); }
/* SVG ring: 24 identical round-capped dashes (pathLength 96 = 24 × (2.6 dash + 1.4 gap)) */
.ring {
  position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible;
  animation: spin 40s linear infinite;
}
.ring circle {
  fill: none; stroke: var(--blue); stroke-width: 2.2; stroke-linecap: round;
  stroke-dasharray: 2.6 1.4;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========= Ticker ========= */
.ticker { overflow: hidden; background: var(--blue); color: var(--yellow); padding: 16px 0; }
.ticker-track { display: flex; gap: 28px; width: max-content; animation: tick 38s linear infinite;
  font-size: 22px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.ticker b { color: var(--red); font-weight: 400; }
@keyframes tick { to { transform: translateX(-50%); } }

/* ========= Sections ========= */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(72px, 10vw, 140px) var(--gutter) 0; }
.section-head { margin-bottom: 48px; }
.section h2, .shelf-teaser h2, .contact h2 { font-size: clamp(40px, 6vw, 80px); letter-spacing: -0.035em; }
.section h2 em { color: var(--blue); }

/* ========= Work grid ========= */
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  display: flex; flex-direction: column;
  text-decoration: none; background: #fff;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--blue) 14%, transparent);
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgb(28 25 64 / .12); }
.card-wide { grid-column: span 3; display: grid; grid-template-columns: 1.6fr 1fr; }
.card-wide .card-img { aspect-ratio: auto; min-height: 440px; }
.card-wide .card-body { align-self: end; padding: 40px; }
.card-wide h3 { font-size: 34px; }
.card-body { padding: 22px 24px 26px; }
.card-num { font-family: var(--serif); font-style: italic; color: var(--red); font-size: 22px; }
.card h3 { font-size: 22px; margin: 6px 0 8px; line-height: 1.15; }
.card p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.tags { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--peach); color: var(--ink); }

.card-img { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #e9e8ff; }
.card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: scale .5s ease; }
.card:hover .card-img img { scale: 1.04; }
.card-flip { grid-template-columns: 1fr 1.6fr; }
.card-flip .card-img { order: 2; }
.card-img-paper { background: #fff; }
.card-img-paper img { object-fit: contain; padding: 12px; }
.card-more { display: inline-block; margin-top: 16px; font-size: 13px; font-weight: 500; color: var(--blue); }
.card:hover .card-more { color: var(--red); }

/* Placeholder image: blueprint grid, swap for <img> later */
.ph-img {
  position: relative; aspect-ratio: 4 / 3;
  background-color: #e9e8ff;
  background-image:
    linear-gradient(rgb(75 70 230 / .14) 1px, transparent 1px),
    linear-gradient(90deg, rgb(75 70 230 / .14) 1px, transparent 1px);
  background-size: 24px 24px;
}
.ph-img::after {
  content: attr(data-label);
  position: absolute; left: 16px; bottom: 14px; right: 16px;
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--blue);
}

.ph-img.has-img { background: none; overflow: hidden; }
.ph-img.has-img::after { display: none; }
.ph-img.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ========= Shelf teaser ========= */
.shelf-teaser {
  margin-top: clamp(72px, 10vw, 140px);
  background: var(--peach);
  padding: clamp(64px, 9vw, 120px) var(--gutter);
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center;
}
.shelf-copy { max-width: 460px; justify-self: end; }
.shelf-teaser h2 em { color: var(--red); }
.shelf-copy p:not(.eyebrow) { color: var(--ink-soft); margin: 20px 0 28px; }

.shelf {
  max-width: 560px; width: 100%;
  border-left: 14px solid var(--pink); border-right: 14px solid var(--pink);
  background: color-mix(in srgb, var(--pink) 8%, transparent);
}
.shelf-row {
  position: relative; height: 104px;
  border-bottom: 14px solid var(--pink);
  display: flex; align-items: flex-end; padding: 0 18px;
}
.shelf-row:first-child { border-top: 14px solid var(--pink); }
.boxes { display: flex; align-items: flex-end; gap: 10px; margin-left: auto; }
.boxes i {
  display: block; width: 46px; height: 56px; border-radius: 3px;
  background: var(--blue); transition: transform .25s ease;
}
.boxes i:nth-child(3n+2) { background: var(--yellow); }
.boxes i:nth-child(3n) { background: var(--red); }
.boxes i.tall { height: 78px; width: 34px; }
.boxes i.wide { width: 84px; height: 40px; }
.shelf:hover .boxes i:hover, .shelf-row:hover .boxes i:first-child { transform: translateY(-10px); }
.tag {
  position: absolute; left: -14px; top: 16px;
  background: #8e96a3; color: #fff;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 0 4px 4px 0;
}

/* ========= Services ========= */
.services { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 2px solid var(--ink); }
.services article { padding: 28px 24px 8px 0; }
.services article + article { padding-left: 24px; border-left: 1px solid color-mix(in srgb, var(--ink) 15%, transparent); }
.services h3 { font-size: 22px; line-height: 1.15; }
.services p { margin: 14px 0 0; font-size: 15px; color: var(--ink-soft); }
.services .tools { font-size: 13px; color: var(--blue); }

/* ========= About ========= */
.about { display: grid; grid-template-columns: 0.8fr 1fr; gap: 64px; align-items: center; }
.ph-portrait { aspect-ratio: 4 / 5; border-radius: var(--radius); }
.about h2 em { color: var(--red); }
.about-text > p:not(.eyebrow) { color: var(--ink-soft); margin: 24px 0; }
.creds { list-style: none; padding: 0; margin: 0; border-top: 1px solid color-mix(in srgb, var(--ink) 15%, transparent); }
.creds li { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 12px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 15%, transparent); font-size: 15px; }
.creds li > span:first-child { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); padding-top: 3px; }

/* ========= Contact ========= */
.contact {
  margin-top: clamp(72px, 10vw, 140px);
  background: var(--blue); color: #fff;
  padding: clamp(72px, 10vw, 140px) var(--gutter) 40px;
  text-align: center;
}
.contact .eyebrow { color: var(--yellow); }
.contact h2 em { color: var(--yellow); }
.contact-email {
  display: inline-block; margin-top: 32px;
  font-size: clamp(20px, 3vw, 34px); font-weight: 500;
  text-decoration-thickness: 2px; text-underline-offset: 6px;
  overflow-wrap: anywhere;
}
.contact-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 28px; margin-top: 28px; }
.contact-links a { text-decoration: none; opacity: .85; }
.contact-links a:hover { opacity: 1; color: var(--yellow); }
.fine { margin: 96px 0 0; font-size: 13px; opacity: .6; }

/* ========= Placeholder highlighting (dev only) ========= */
.show-todo .todo { background: color-mix(in srgb, var(--yellow) 70%, transparent); outline: 1px dashed #c9a800; outline-offset: 2px; }
.show-todo .contact .todo { color: var(--ink); }
.todo-toggle {
  position: fixed; right: 16px; bottom: 16px; z-index: 20;
  font: 500 13px var(--sans); padding: 10px 14px; border-radius: 999px;
  border: 0; background: var(--ink); color: #fff; cursor: pointer;
}

/* ========= Responsive ========= */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .hero-mark { max-width: 340px; grid-row: 1; }
  .facts { grid-template-columns: repeat(2, auto); }
  .work-grid { grid-template-columns: 1fr 1fr; }
  .card-wide { grid-column: span 2; grid-template-columns: 1fr; }
  .card-flip .card-img { order: 0; }
  .card-wide .card-img { min-height: 0; aspect-ratio: 16 / 10; }
  .card-wide .card-body { padding: 24px; }
  .shelf-teaser { grid-template-columns: 1fr; }
  .shelf-copy { justify-self: start; }
  .services { grid-template-columns: 1fr 1fr; }
  .services article:nth-child(3) { padding-left: 0; border-left: 0; }
  .about { grid-template-columns: 1fr; gap: 40px; }
  .ph-portrait { max-width: 420px; }
}
@media (max-width: 640px) {
  .hero { padding-top: 32px; gap: 24px; }
  .hero-mark { max-width: 200px; justify-self: start; }
  .ring circle { stroke-width: 2.6; }
  .nav { flex-wrap: wrap; gap: 12px; }
  .nav .btn-small { margin-left: auto; }
  .nav-menu { display: grid; }
  .nav-links {
    display: none; order: 10; flex-basis: 100%; flex-direction: column; gap: 0; margin: 0;
    padding: 4px 0 8px;
  }
  .nav-open .nav-links { display: flex; }
  .nav-links a { padding: 12px 2px; font-size: 18px; color: var(--ink);
    border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); }
  .work-grid { grid-template-columns: 1fr; }
  .card-wide { grid-column: span 1; }
  .card-wide h3 { font-size: 26px; }
  .services { grid-template-columns: 1fr; }
  .services article, .services article + article { padding: 24px 0 8px; border-left: 0; }
  .services article + article { border-top: 1px solid color-mix(in srgb, var(--ink) 15%, transparent); }
  .creds li { grid-template-columns: 1fr; gap: 2px; }
  .boxes i { width: 30px; height: 44px; }
  .boxes i.wide { width: 54px; }
  .boxes i.tall { width: 24px; height: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .ring, .ticker-track { animation: none; }
  html { scroll-behavior: auto; }
}
