/* ============================================================
   InflexiMedia — Graphite Studio
   Dark studio-portfolio UI. Two accents with strict roles:
     mint = action  (buttons, focus, primary CTA)
     blue = information & atmosphere (utility bar, meta, washes)
   Never swap them. See DESIGN.md.
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --ink-base:    #101317;
  --ink-surface: #181C22;
  --ink-raised:  #212730;
  --ink-blue:    #141B26;   /* blue-tinted surface for the utility bar */
  --hairline:    #2A313A;
  --hairline-lt: #38414D;

  --mint:        #5FD68A;   /* 10.17:1 on base — ACTION ONLY */
  --mint-light:  #8AE6AB;
  --mint-dim:    rgba(95, 214, 138, .38);

  --blue:        #5AA9FF;   /*  7.59:1 on base — INFORMATION */
  --blue-soft:   #8CC5FF;
  --blue-dim:    rgba(90, 169, 255, .34);
  --blue-glow:   rgba(90, 169, 255, .13);

  --tx-1: #EDEFF1;          /* 16.16:1 */
  --tx-2: #A6AEB6;          /*  8.29:1 */
  --tx-3: #7B848D;          /*  4.90:1 — never below 14px */

  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body:    'Work Sans', system-ui, sans-serif;

  --s-1: 8px;   --s-2: 16px;  --s-3: 24px;
  --s-4: 40px;  --s-5: 64px;  --s-6: 96px;  --s-7: 128px;

  --r-sm: 8px;  --r-md: 12px; --r-lg: 18px; --r-pill: 999px;
  --container: 1160px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important; transition-duration: .001ms !important;
  }
}
body {
  margin: 0;
  background: var(--ink-base);
  color: var(--tx-1);
  font: 400 1.0625rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); line-height: 1.08; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
input, select, button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--mint); color: #0C1013; padding: 12px 20px;
  font-weight: 600; border-radius: 0 0 var(--r-sm) 0;
}
.skip:focus { left: 0; }

/* Scoped to the list item because `.utility__list li` sets display:flex and would
   otherwise win on specificity, leaving these visible on mobile. */
.utility__list li.u-hide-sm { display: none; }
@media (min-width: 900px) { .utility__list li.u-hide-sm { display: flex; } }

/* ---------- atmosphere ---------- */
.grain {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  opacity: .15; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

/* ---------- layout ---------- */
.container {
  width: 100%; max-width: var(--container);
  margin-inline: auto; padding-inline: var(--s-3);
}
.section { padding-block: var(--s-6); }
.section--alt {
  background: var(--ink-surface);
  border-block: 1px solid var(--hairline);
}
@media (min-width: 900px) { .section { padding-block: var(--s-7); } }

.section__head {
  display: flex; flex-direction: column; gap: var(--s-2);
  margin-bottom: var(--s-5);
}
.section__note { color: var(--tx-3); font-size: .9375rem; max-width: 34ch; }
@media (min-width: 900px) {
  .section__head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .section__note { text-align: right; }
}

/* ---------- utility bar ---------- */
/* Micro trust signals, set in blue so they read as information, not action. */
.utility {
  background: var(--ink-blue);
  border-bottom: 1px solid var(--hairline);
  font-size: .8125rem;
}
.utility__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3); min-height: 42px;
}
.utility__list { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.utility__list li { display: flex; align-items: center; gap: 7px; color: var(--tx-2); }
.utility__list svg { width: 14px; height: 14px; color: var(--blue); flex: none; }
.utility__list a { color: var(--tx-2); transition: color .2s var(--ease); }
.utility__list a:hover { color: var(--blue-soft); }
.utility__right { display: none; color: var(--tx-3); }
@media (min-width: 1040px) { .utility__right { display: block; } }

/* ---------- logo ---------- */
.logo { display: flex; flex-direction: column; gap: 4px; }
.logo__mark {
  display: inline-block;
  background: #fff; color: #14171C;
  font: 800 1.0625rem/1 var(--font-display);
  letter-spacing: -.03em;
  padding: 9px 15px; border-radius: 9px;
}
.logo__mark--sm { font-size: .9375rem; padding: 8px 13px; }
.logo__sub {
  display: none;
  font: 500 .5625rem/1 var(--font-body);
  text-transform: uppercase; letter-spacing: .28em;
  color: var(--mint); padding-left: 2px;
}
@media (min-width: 560px) { .logo__sub { display: block; } }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  padding-block: var(--s-2);
  transition: background .3s var(--ease), border-color .3s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  background: rgba(16, 19, 23, .84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--hairline);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.nav__links { display: none; gap: 4px; }
.nav__links a {
  color: var(--tx-2); font-size: .9375rem; font-weight: 500;
  padding: 8px 14px; border-radius: var(--r-pill);
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav__links a:hover { color: var(--tx-1); background: rgba(255, 255, 255, .04); }
.nav__links a.is-active { color: var(--blue-soft); background: var(--blue-glow); }
@media (min-width: 900px) { .nav__links { display: flex; } }

/* ---------- type ---------- */
.eyebrow {
  font: 500 .75rem/1 var(--font-body);
  text-transform: uppercase; letter-spacing: .18em;
  color: var(--mint); margin-bottom: var(--s-2);
}
.eyebrow--blue { color: var(--blue); }
.display {
  font-weight: 700; letter-spacing: -.03em;
  font-size: clamp(2.5rem, 6.4vw, 5rem);
}
.display--sm { font-size: clamp(2.1rem, 5vw, 3.4rem); }
.display em {
  font-style: normal; color: var(--mint);
  position: relative; white-space: nowrap;
}
.display em::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: .06em; height: .07em;
  background: var(--mint-dim); border-radius: 2px;
}
.h2 {
  font-weight: 600; letter-spacing: -.02em;
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  max-width: 20ch;
}
.lede {
  color: var(--tx-2); font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
  max-width: 58ch; margin-top: var(--s-3);
}
.tag {
  display: inline-block;
  font: 500 .6875rem/1 var(--font-body);
  text-transform: uppercase; letter-spacing: .14em;
  color: var(--tx-3); margin-bottom: 10px;
}

/* Social-proof chip. Blue because it's a claim, not a call to action. */
.pill {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 16px; border-radius: var(--r-pill);
  background: var(--blue-glow);
  border: 1px solid var(--blue-dim);
  color: var(--blue-soft);
  font-size: .8125rem; font-weight: 500;
  margin-bottom: var(--s-3);
}
.pill svg { width: 15px; height: 15px; flex: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 46px; padding: 12px 22px;
  background: var(--mint); color: #0C1013;      /* 10.44:1 */
  font: 600 .9375rem/1 var(--font-body);
  border: 1px solid var(--mint); border-radius: var(--r-sm);
  cursor: pointer; white-space: nowrap;
  transition: transform .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:hover {
  background: var(--mint-light); border-color: var(--mint-light);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(95, 214, 138, .18);
}
.btn:active { transform: translateY(0); box-shadow: none; }
.btn--sm { min-height: 40px; padding: 10px 16px; font-size: .875rem; }
.btn--lg { min-height: 56px; padding: 16px 32px; font-size: 1.0625rem; }
.btn--ghost {
  background: transparent; color: var(--tx-1);
  border-color: var(--hairline-lt);
}
.btn--ghost:hover {
  background: transparent; color: var(--blue-soft);
  border-color: var(--blue); box-shadow: none;
}

/* ---------- hero ---------- */
.hero { position: relative; padding-block: var(--s-5) var(--s-6); overflow: hidden; }
@media (min-width: 900px) { .hero { padding-block: var(--s-6) var(--s-7); } }
.hero__content { position: relative; z-index: 2; }

.hero__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

/* Generated backdrop (scripts/make_hero.py) rather than stock photography — it
   carries the brand's own blue and mint, and can't date the way a photo would.
   Anchored right so the light sits away from the headline on the left. */
/* The artwork is opaque; the fade is done here with a mask so it can be tuned
   against the real layout rather than re-rendered. max-width overrides the global
   img reset, which would otherwise stop it bleeding past the container. */
.hero__img {
  position: absolute; top: 0; right: 0;
  width: 100%; height: 100%; max-width: none;
  object-fit: cover; object-position: right center;
  -webkit-mask-image:
    linear-gradient(100deg, transparent 2%, rgba(0,0,0,.42) 20%, rgba(0,0,0,.92) 44%, #000 62%),
    linear-gradient(to top, transparent 0%, #000 18%);
  mask-image:
    linear-gradient(100deg, transparent 2%, rgba(0,0,0,.42) 20%, rgba(0,0,0,.92) 44%, #000 62%),
    linear-gradient(to top, transparent 0%, #000 18%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
/* A little extra depth over the top of the photo-substitute. */
.hero__mesh {
  position: absolute; inset: 0;
  background: radial-gradient(34rem 22rem at 88% 34%, rgba(95, 214, 138, .10), transparent 66%);
}

/* On a narrow screen the crop lands on the brightest part of the artwork and the
   diagonal mask barely gets to act, which washes the text out. Pull it back hard —
   the headline has to win. */
@media (max-width: 719px) {
  .hero__img {
    object-position: 64% center;
    opacity: .38;
    -webkit-mask-image: linear-gradient(to top, transparent 2%, #000 30%);
    mask-image: linear-gradient(to top, transparent 2%, #000 30%);
  }
  .hero__mesh { background: linear-gradient(to bottom, rgba(16, 19, 23, .55), rgba(16, 19, 23, .2) 45%, var(--ink-base)); }
}

.hero__meta {
  display: flex; flex-wrap: wrap; gap: var(--s-3);
  margin-top: var(--s-4); padding-top: var(--s-3);
  border-top: 1px solid var(--hairline);
  color: var(--tx-3); font-size: .875rem;
}
.hero__meta li { display: flex; align-items: center; gap: 8px; }
.hero__meta li::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--blue); flex: none;
}

.hero__cta { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-4); }

/* ---------- work ---------- */
.work { display: grid; gap: var(--s-3); grid-template-columns: 1fr; }
@media (min-width: 720px)  { .work { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .work { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--ink-surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--blue-dim);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .4);
}
.card__preview {
  aspect-ratio: 4 / 3;
  background: linear-gradient(160deg, #1E242C, #14181D);
  border-bottom: 1px solid var(--hairline);
  padding: 18px; overflow: hidden;
}
.card__preview--shot { padding: 0; position: relative; display: block; }
.card__preview--shot img {
  width: 100%; height: 100%; object-fit: cover; object-position: top;
  filter: blur(3px) saturate(.75) brightness(.55); opacity: .85; transform: scale(1.04);
  transition: filter .4s var(--ease), opacity .4s var(--ease), transform .4s var(--ease);
}
.card__preview--shot::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(16,19,23,.15), rgba(16,19,23,.55));
  pointer-events: none;
}
.card:hover .card__preview--shot img { filter: blur(0) saturate(.9) brightness(.8); opacity: 1; transform: scale(1); }
.card__visit {
  position: absolute; top: 12px; right: 12px;
  background: rgba(16,19,23,.75); backdrop-filter: blur(6px);
  border: 1px solid var(--hairline-lt); border-radius: 999px;
  color: var(--tx-1); font-size: .8125rem; padding: 5px 12px;
  opacity: 0; transform: translateY(-4px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), border-color .3s var(--ease);
}
.card:hover .card__visit { opacity: 1; transform: translateY(0); border-color: var(--blue-dim); }

.card__body { padding: var(--s-3); }
.card__body h3 { font-size: 1.125rem; font-weight: 600; letter-spacing: -.01em; }
.card__body p { color: var(--tx-2); font-size: .9375rem; margin-top: 8px; }

/* ---------- steps ---------- */
.steps { display: grid; gap: var(--s-3); margin-top: var(--s-5); grid-template-columns: 1fr; }
@media (min-width: 880px) { .steps { grid-template-columns: repeat(3, 1fr); gap: var(--s-4); } }
.step {
  padding-top: var(--s-3);
  border-top: 2px solid var(--hairline);
  transition: border-color .3s var(--ease);
}
.step:hover { border-top-color: var(--blue); }
/* The last step is the one that costs money, so it carries the action colour. */
.step--final:hover { border-top-color: var(--mint); }
.step__n {
  display: block; font: 600 .8125rem/1 var(--font-body);
  letter-spacing: .14em; color: var(--blue); margin-bottom: var(--s-2);
}
.step--final .step__n { color: var(--mint); }
.step h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.01em; }
.step p { color: var(--tx-2); font-size: .9375rem; margin-top: 10px; }

/* ---------- features ---------- */
.grid-3 { display: grid; gap: var(--s-3); margin-top: var(--s-5); grid-template-columns: 1fr; }
@media (min-width: 880px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.feature {
  background: var(--ink-surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: var(--s-3);
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.feature:hover { border-color: var(--blue-dim); background: var(--ink-raised); }
.feature__ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: var(--r-md);
  background: var(--blue-glow); border: 1px solid var(--blue-dim);
  color: var(--blue); margin-bottom: var(--s-2);
}
.feature__ic svg { width: 21px; height: 21px; }
.feature h3 { font-size: 1.125rem; font-weight: 600; letter-spacing: -.01em; }
.feature p { color: var(--tx-2); font-size: .9375rem; margin-top: 10px; }

/* ---------- cta ---------- */
.cta {
  position: relative; padding-block: var(--s-6);
  border-top: 1px solid var(--hairline);
  background:
    radial-gradient(40rem 24rem at 50% 116%, rgba(90, 169, 255, .16), transparent 68%),
    radial-gradient(28rem 18rem at 50% 124%, rgba(95, 214, 138, .12), transparent 66%),
    var(--ink-base);
}
@media (min-width: 900px) { .cta { padding-block: var(--s-7); } }
.cta__inner { text-align: center; display: flex; flex-direction: column; align-items: center; }
.cta .lede { margin-inline: auto; }
.cta__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); justify-content: center; margin-top: var(--s-4); }
.fineprint { color: var(--tx-3); font-size: .875rem; margin-top: var(--s-3); }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--hairline);
  padding-block: var(--s-4);
  background: var(--ink-blue);
}
.footer__inner {
  display: flex; flex-direction: column; gap: var(--s-3);
  align-items: flex-start;
}
.footer__meta { color: var(--tx-3); font-size: .875rem; line-height: 1.7; margin-top: 12px; }
.footer__meta a { color: var(--tx-2); border-bottom: 1px solid var(--hairline-lt); }
.footer__meta a:hover { color: var(--blue-soft); border-bottom-color: var(--blue); }
.footer__copy { color: var(--tx-3); font-size: .8125rem; }
@media (min-width: 800px) {
  .footer__inner { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ---------- reveal ---------- */
.reveal {
  opacity: 0; transform: translateY(14px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }
.work .reveal:nth-child(2),  .grid-3 .reveal:nth-child(2), .steps .reveal:nth-child(2) { transition-delay: .07s; }
.work .reveal:nth-child(3),  .grid-3 .reveal:nth-child(3), .steps .reveal:nth-child(3) { transition-delay: .14s; }
.work .reveal:nth-child(4) { transition-delay: .21s; }
.work .reveal:nth-child(5) { transition-delay: .28s; }
.work .reveal:nth-child(6) { transition-delay: .35s; }
