/* XIS — redesign system
   60% dominant  : --bg
   30% secondary : --surface, --surface-2, --border
   10% accent    : --accent, --accent-soft (never a large fill)
   Dark, soft, low glare. "Built with restraint."
*/

:root {
  --bg: #2A303C;
  --surface: #343B49;
  --surface-2: #3D4555;
  --border: #4A586C;
  --border-bright: #5E6E85;

  --accent: #FFB48A;
  --accent-soft: #FFD0B4;

  --text: #F4F1EE;
  --text-muted: #CDD3DC;
  --text-dim: #AAB3C0;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* layout */
  --header-h: 72px;
  --peek: 120px;

  /* 8px scale */
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s5: 48px;
  --s6: 64px;
  --s8: 96px;

  --section-pad: clamp(96px, 12vw, 168px);
  --wrap: 1120px;
  --measure: 640px;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 1.0625rem; /* 17px */
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

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

.skip {
  position: absolute;
  left: -999px;
  top: var(--s1);
  background: var(--accent);
  color: #1F242E;
  padding: var(--s1) var(--s2);
  border-radius: 8px;
  z-index: 100;
}
.skip:focus { left: var(--s2); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--s3);
}

/* ---------- Type ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--text);
  margin: 0;
  font-variation-settings: "opsz" 144;
}

h1 {
  font-weight: 300;
  font-size: clamp(3.5rem, 8vw, 6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

h1 em, h2 em {
  font-style: italic;
  font-weight: 800;
  color: var(--accent-soft);
}

h2 {
  font-weight: 300;
  font-size: clamp(2.25rem, 4.6vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
}

h3 {
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1.25;
  letter-spacing: -0.005em;
}

p { margin: 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem; /* 12px */
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-soft);
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  margin-bottom: var(--s3);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s1);
  min-height: 48px;
  padding: 0 var(--s4);
  border-radius: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary {
  background: var(--accent);
  color: #1F242E;
  box-shadow: 0 8px 28px -10px rgba(255, 180, 138, 0.45);
}
.btn-primary:hover { transform: translateY(-2px); background: #FFC4A0; }

.link-arrow {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border-bright);
  padding-bottom: 2px;
  font-weight: 600;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.link-arrow:hover { color: var(--accent-soft); border-color: var(--accent-soft); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(42, 48, 60, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: var(--s3);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.875rem;
  color: #1F242E;
}
.brand-name { font-weight: 700; letter-spacing: 0.02em; }

.nav { display: flex; align-items: center; gap: var(--s1); }
.nav a {
  text-decoration: none;
  color: var(--text-muted);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.9375rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.nav .btn { min-height: 44px; padding: 0 var(--s3); color: #1F242E; margin-left: var(--s1); }
.nav .btn:hover { color: #1F242E; }

/* ---------- Sections ---------- */
section { padding: var(--section-pad) 0; }

.section-head { max-width: var(--measure); margin-bottom: var(--s6); }
.section-head p { margin-top: var(--s3); font-size: 1.1875rem; }

/* ---------- Hero: above-the-fold system, svh units ---------- */
.hero {
  position: relative;
  min-height: calc(100svh - var(--header-h) - var(--peek));
  display: flex;
  align-items: center;
  padding-top: clamp(32px, 6vh, 88px);
  padding-bottom: clamp(24px, 4vh, 56px);
  overflow: hidden;
}
.hero::before {
  /* subtle peach glow behind the visual, faded so it never clips hard */
  content: "";
  position: absolute;
  width: 760px;
  height: 760px;
  right: -180px;
  top: 40px;
  background: radial-gradient(circle, rgba(255, 180, 138, 0.14), transparent 65%);
  filter: blur(20px);
  mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
  pointer-events: none;
}
.hero::after {
  /* faint grid, under 4% */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(244, 241, 238, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 241, 238, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 30% 30%, #000 20%, transparent 75%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; width: 100%; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}
.hero-copy .eyebrow { margin-bottom: clamp(10px, 1.8vh, 16px); }
.hero-copy h1 {
  font-size: clamp(2.5rem, min(5.6vw, 9.5vh), 5.25rem);
  line-height: 1.02;
}
.hero-copy h1 .l1,
.hero-copy h1 .l2 { display: block; }
.hero-copy h1 .l1 { font-weight: 300; font-style: normal; color: var(--text); }
.hero-copy h1 .l2 { font-weight: 800; font-style: italic; color: var(--accent-soft); }
@media (min-width: 641px) {
  .hero-copy h1 .l1,
  .hero-copy h1 .l2 { white-space: nowrap; }
}
.hero-copy .lede {
  margin-top: clamp(12px, 2vh, 20px);
  font-size: clamp(1.0625rem, 2.4vh, 1.25rem);
  max-width: 34rem;
}
.hero-actions {
  margin-top: clamp(28px, 5vh, 48px);
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 24px);
  flex-wrap: wrap;
}
/* compact portrait + trust row: avatar left, two stacked lines right */
.byline {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-top: clamp(32px, 6vh, 64px);
  padding-top: clamp(16px, 3vh, 28px);
  border-top: 1px solid var(--border);
  max-width: 34rem;
}
.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  outline: 2px solid var(--accent-soft);
  outline-offset: 0;
  border: none;
}
.byline-lines { display: flex; flex-direction: column; gap: 4px; }
.byline-lines p { color: var(--text); font-weight: 600; }
.trust-live {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.trust-live a { color: var(--accent-soft); }
.dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ADE80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.16);
  flex: none;
}

/* Product visual: browser frame, image constrained to the first screen */
.frame {
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  overflow: hidden;
}
.frame-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.frame-bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-bright);
  display: block;
  flex: none;
}
.frame-url {
  margin-left: var(--s1);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}
.frame-body { padding: 8px; }
.hero .frame img.shot-full { object-position: center; }
.frame img.shot-full {
  width: 100%;
  max-height: calc(100svh - var(--header-h) - var(--peek) - 48px);
  object-fit: cover;
  object-position: top left;
}

/* No dead gap: first section tucks up under the hero */
#work { padding-top: clamp(20px, 3.5vh, 56px); scroll-margin-top: var(--header-h); }
#work .section-head { margin-bottom: clamp(24px, 4vh, 48px); }

/* ---------- Work showcase ---------- */
.work-featured {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 40px 80px -40px rgba(255, 180, 138, 0.18);
}
.work-featured .copy {
  padding: clamp(32px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  justify-content: center;
}
.work-featured h3 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.12;
}
.work-featured .visual {
  background: var(--surface-2);
  border-left: 1px solid var(--border);
  padding: clamp(24px, 4vw, 48px);
  display: grid;
  place-items: center;
}
.tools { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.04em; color: var(--text-dim); }

.work-grid {
  margin-top: var(--s5);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
  align-items: stretch;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s3);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  height: 100%;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  border-color: var(--border-bright);
  transform: translateY(-3px);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.7);
}
.card .family { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-soft); }
.more { margin-top: var(--s5); }

/* project images: shared crop, radius, border, shadow + inner legibility gradient */
.shot {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 50px -30px rgba(0, 0, 0, 0.65);
}
.shot img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top left;
  transition: transform 0.2s ease;
}
.card:hover a.shot img, .card:hover .shot img { transform: scale(1.03); }
.shot::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 42%;
  background: linear-gradient(transparent, rgba(11, 18, 32, 0.5));
  pointer-events: none;
}
.shot .more {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text);
  background: rgba(11, 18, 32, 0.82);
  border: 1px solid var(--border-bright);
  border-radius: 999px;
  padding: 4px 12px;
  margin: 0;
}

/* CSS-only lightbox (:target, no JavaScript) */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(11, 18, 32, 0.94);
  padding: 24px;
}
.lightbox:target { display: grid; place-items: center; }
.lightbox img {
  position: relative;
  z-index: 2;
  max-width: min(1200px, 100%);
  max-height: 86vh;
  width: auto;
  border: 1px solid var(--border-bright);
  border-radius: 12px;
}
.lb-backdrop { position: absolute; inset: 0; z-index: 1; }
.lb-close {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border-bright);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  text-decoration: none;
}

/* ---------- Kind words ---------- */
.reviews {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  align-items: stretch;
  width: 100%;
}
.review {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.review:hover {
  border-color: var(--border-bright);
  transform: translateY(-3px);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.7);
}
.review::before {
  content: "“";
  position: absolute;
  top: 8px;
  right: 20px;
  font-family: var(--font-display);
  font-size: 5rem;
  line-height: 1;
  color: var(--accent);
  opacity: 0.15;
  pointer-events: none;
}
.stars { color: var(--accent); letter-spacing: 0.2em; font-size: 0.875rem; }
.review blockquote {
  margin: 0;
  flex: 1;
  font-family: var(--font-display), serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--text);
}
.review figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  min-height: 84px;
}
.review figcaption .who { font-weight: 600; color: var(--text); }
.review figcaption .where { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim); }
.review figcaption .kind {
  flex-basis: 100%;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

/* ---------- Build (families) ---------- */
.families {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s4);
}
.family-card {
  border-top: 1px solid var(--border-bright);
  padding-top: var(--s3);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}
.family-card .n { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent-soft); letter-spacing: 0.1em; }

/* ---------- Persona band ---------- */
.persona {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: var(--s6);
  align-items: center;
}
.persona-photo { position: relative; isolation: isolate; max-width: 440px; }
.persona-photo img {
  width: 100%;
  border-radius: 20px;
  border: 1px solid var(--border-bright);
  box-shadow: 0 40px 80px -40px rgba(255, 180, 138, 0.22);
}
.persona-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--accent);
  border-radius: 20px;
  transform: translate(12px, 12px);
  z-index: -1;
}

/* ---------- How it works ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.steps > div {
  padding: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}
.steps > div + div { border-left: 1px solid var(--border); }
.steps p { font-size: 1rem; }
.steps .n { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent-soft); letter-spacing: 0.1em; }

/* ---------- Final CTA ---------- */
.cta-box {
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: 24px;
  padding: clamp(40px, 7vw, 96px);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  align-items: flex-start;
  position: relative;
  overflow: hidden;
}
.cta-box::before {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: -140px;
  bottom: -220px;
  background: radial-gradient(circle, rgba(255, 180, 138, 0.14), transparent 65%);
  pointer-events: none;
}
.cta-box > * { position: relative; }
.cta-box p { max-width: var(--measure); font-size: 1.1875rem; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--s6) 0;
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
  align-items: flex-start;
}
.footer-grid p { max-width: 30rem; margin-top: var(--s2); font-size: 1rem; }
.footer-nav { display: flex; gap: var(--s3); flex-wrap: wrap; }
.footer-nav a { text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.footer-nav a:hover { color: var(--text); }
.legal { margin-top: var(--s5); display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s2); }

/* ---------- Case pages ---------- */
.group-intro { color: var(--text-muted); max-width: var(--measure); margin: calc(var(--s6) * -1 + 32px) 0 var(--s5); }
.case { margin-bottom: var(--s6); }
.case:last-child { margin-bottom: 0; }
.case-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); margin-top: var(--s4); }
.case h3 { font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 300; }
.case .summary { color: var(--text-muted); font-size: 1.1875rem; max-width: var(--measure); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s4); }
.panel-label {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent-soft); margin: 0 0 var(--s2);
}
.panel ul, .panel ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--text-muted); }
.panel li strong { color: var(--text); }
.shots { display: grid; gap: var(--s3); align-content: start; }

/* ---------- Forms ---------- */
.form { display: grid; gap: var(--s3); max-width: var(--measure); }
.field { display: grid; gap: var(--s1); }
label { font-weight: 600; color: var(--text); }
input, textarea, select {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { min-height: 160px; resize: vertical; }
.hp-field { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form-alert { border-radius: 8px; padding: 20px 24px; }
.form-alert[hidden] { display: none; }
.form-success { border: 1px solid var(--accent); background: rgba(255, 180, 138, 0.1); color: var(--text); }
.form-error { border: 1px solid #c98a94; background: rgba(201, 138, 148, 0.1); color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero { min-height: 0; align-items: flex-start; }
  .hero-grid, .work-featured { grid-template-columns: 1fr; }
  .hero-grid { gap: var(--s6); }
  .hero h1 { font-size: clamp(2.25rem, 10.5vw, 3.25rem); }
  .work-featured .visual { border-left: 0; border-top: 1px solid var(--border); }
  .families { grid-template-columns: 1fr; gap: var(--s5); }
  .persona { grid-template-columns: 1fr; }
  .persona-photo { max-width: 380px; }
  .reviews { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .steps > div:nth-child(3) { border-left: 0; }
  .steps > div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .case-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
  .nav a:not(.btn) { display: none; }
  .nav a.nav-work { display: inline-flex; }
  /* Short portrait phones: the same Flowdit visual leads the work section
     directly below, so the hero frame steps aside and lets it peek in.
     (Copy, portrait, trust line and buttons are never hidden.) */
  .work-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .steps > div + div { border-left: 0; border-top: 1px solid var(--border); }
  .hero-actions { gap: var(--s3); }
  .hero-actions .btn-primary, .cta-box .btn-primary, .form .btn-primary { width: 100%; flex: 1 1 auto; }
  .hero-grid { gap: 40px; }
  .card { padding: var(--s4); }
  .frame-bar .frame-url { display: none; }
}

/* Short portrait phones only: hero frame yields so #work peeks above the fold */
@media (max-width: 640px) and (max-height: 740px) {
  .hero .frame { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
