/* ============================================================
   Andrew Tan — refined editorial-tech
   Palette: warm paper + deep ink-teal, single teal accent,
   warm sand secondary. Fraunces (display) + Hanken Grotesk (body).
   ============================================================ */

:root {
  --paper: #f6f1e7;
  --paper-2: #efe7d8;
  --ink: #16201f;
  --ink-soft: #43504e;
  --deep: #0d1a1c;
  --deep-2: #112426;
  --teal: #0c7a6f;        /* on-light accent — deepened to meet WCAG-AA contrast */
  --teal-deep: #0a685f;   /* CTA hover / pressed */
  --teal-bright: #2ec4b6; /* on-dark accent */
  --sand: #c79a63;
  --sand-soft: #e6cfa8;
  --line: rgba(22, 32, 31, .14);
  --line-dark: rgba(255, 255, 255, .12);
  --shadow: 0 24px 60px -28px rgba(13, 26, 28, .45);
  --maxw: 1180px;
  --r: 18px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  letter-spacing: -0.005em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.serif-italic { font-family: "Fraunces", serif; font-style: italic; font-weight: 400; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.2rem, 4vw, 3rem); }

.eyebrow {
  font-size: .74rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--teal);
  display: inline-block;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .85rem 1.45rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .98rem;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .35s var(--ease), background .25s, color .25s, box-shadow .35s var(--ease);
  will-change: transform;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 18px 30px -16px rgba(13,26,28,.6); }
.btn-accent { background: var(--teal); color: #fff; }
.btn-accent:hover { transform: translateY(-3px); background: var(--teal-deep); box-shadow: 0 18px 34px -14px rgba(15,140,128,.7); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--ink); }
.btn-light { background: rgba(255,255,255,.08); color: var(--paper); border-color: var(--line-dark); }
.btn-light:hover { transform: translateY(-3px); background: rgba(255,255,255,.16); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { font-family: "Fraunces", serif; font-weight: 600; font-size: 1.32rem; letter-spacing: -0.02em; display: flex; align-items: center; gap: .5rem; }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal-bright); box-shadow: 0 0 0 4px rgba(46,196,182,.2); }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a { font-size: .95rem; font-weight: 500; color: var(--ink-soft); transition: color .2s; }
.nav-links a:hover { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: .8rem; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; transition: .3s; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 7vw, 6rem); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 { font-size: clamp(2.7rem, 6.4vw, 5rem); margin: 1.3rem 0 0; }
.hero h1 .accent { color: var(--teal); }
.hero-role {
  font-size: clamp(1.02rem, 1.7vw, 1.22rem);
  color: var(--ink-soft);
  margin-top: 1.4rem;
  max-width: 34ch;
  font-weight: 500;
}
.hero-role strong { color: var(--ink); font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 2.1rem; }
.hero-meta { display: flex; gap: 1.6rem; margin-top: 2.4rem; flex-wrap: wrap; }
.hero-meta span { font-size: .85rem; color: var(--ink-soft); display: flex; align-items: center; gap: .45rem; }
.hero-meta b { color: var(--teal); }

.hero-media { position: relative; }
.hero-portrait {
  border-radius: 220px 220px var(--r) var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  position: relative;
  z-index: 2;
  aspect-ratio: 4 / 5;
}
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; }
.hero-badge {
  position: absolute; z-index: 3; bottom: 1.4rem; left: -1.6rem;
  background: var(--deep); color: var(--paper);
  border-radius: 14px; padding: .85rem 1.1rem;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: .7rem;
  font-size: .82rem; line-height: 1.25;
}
.hero-badge .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--teal-bright); box-shadow: 0 0 0 0 rgba(46,196,182,.6); animation: pulse 2.4s infinite; }
.hero-badge b { color: var(--teal-bright); font-family: "Fraunces", serif; font-size: 1.1rem; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(46,196,182,0); } 100% { box-shadow: 0 0 0 0 rgba(46,196,182,0); } }
.hero-blob { position: absolute; inset: -8% -10% auto auto; width: 78%; aspect-ratio: 1; background: radial-gradient(circle at 40% 40%, var(--sand-soft), transparent 62%); filter: blur(8px); z-index: 1; }

/* ---------- Sections ---------- */
section { position: relative; }
.section-pad { padding: clamp(3.5rem, 8vw, 7rem) 0; }
.section-head { max-width: 60ch; }
.section-head h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); margin-top: 1rem; }
.section-head p { color: var(--ink-soft); margin-top: 1.1rem; font-size: 1.08rem; }

.dark { background: var(--deep); color: var(--paper); }
.dark .section-head p { color: rgba(246,241,231,.72); }
.dark .eyebrow { color: var(--teal-bright); }
.dark .eyebrow::before { background: var(--teal-bright); }

/* ---------- Trifecta ---------- */
.trifecta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin-top: 3rem; }
.tri-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 2rem 1.7rem 2.1rem;
  position: relative;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.tri-card:nth-child(2) { transform: translateY(2.2rem); }
.tri-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.tri-card:nth-child(2):hover { transform: translateY(calc(2.2rem - 6px)); }
.tri-num { font-family: "Fraunces", serif; font-size: 2.4rem; color: var(--sand); line-height: 1; }
.tri-card h3 { font-size: 1.45rem; margin: 1rem 0 .7rem; }
.tri-card p { color: var(--ink-soft); font-size: .98rem; }
.tri-icon { width: 38px; height: 38px; color: var(--teal); margin-bottom: .2rem; }

/* ---------- Feature split ---------- */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.feature.rev .feature-text { order: 2; }
.feature-media { border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line-dark); aspect-ratio: 16 / 11; }
.feature-media img { width: 100%; height: 100%; object-fit: cover; }
.feature-text h2 { font-size: clamp(1.9rem, 3.8vw, 2.9rem); margin: 1rem 0 1.1rem; }
.feature-list { list-style: none; margin-top: 1.6rem; display: grid; gap: 1.1rem; }
.feature-list li { display: flex; gap: .9rem; align-items: flex-start; }
.feature-list .ico { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px; background: rgba(46,196,182,.14); color: var(--teal-bright); display: grid; place-items: center; }
.dark .feature-list .ico { background: rgba(46,196,182,.16); }
.feature-list .ico svg { width: 18px; height: 18px; }
.feature-list h4 { font-size: 1.05rem; font-family: "Hanken Grotesk", sans-serif; font-weight: 700; margin-bottom: .15rem; }
.feature-list p { font-size: .95rem; color: var(--ink-soft); }
.dark .feature-list p { color: rgba(246,241,231,.7); }
.takeaway { margin-top: 1.8rem; padding: 1.1rem 1.3rem; border-left: 3px solid var(--teal-bright); background: rgba(255,255,255,.05); border-radius: 0 12px 12px 0; font-size: .98rem; }
.dark .takeaway b { color: var(--teal-bright); }

/* ---------- Build cards ---------- */
.build-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; margin-top: 3rem; }
.build-card { border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--paper-2); transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.build-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.build-card .img { aspect-ratio: 16 / 9; overflow: hidden; }
.build-card .img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.build-card:hover .img img { transform: scale(1.05); }
.build-card .body { padding: 1.6rem 1.7rem 1.9rem; }
.build-card h3 { font-size: 1.4rem; margin-bottom: .6rem; }
.build-card p { color: var(--ink-soft); font-size: .97rem; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); background: rgba(15,140,128,.1); padding: .3rem .7rem; border-radius: 999px; margin-bottom: .9rem; }

/* ---------- Tools ---------- */
.tools-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; margin-top: 2.6rem; }
.tool-group { border: 1px solid var(--line-dark); border-radius: var(--r); padding: 1.5rem 1.4rem; background: rgba(255,255,255,.03); }
.tool-group h4 { font-family: "Hanken Grotesk", sans-serif; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--teal-bright); margin-bottom: 1rem; font-weight: 700; }
.tool-group ul { list-style: none; display: grid; gap: .55rem; }
.tool-group li { font-size: 1rem; color: rgba(246,241,231,.9); display: flex; align-items: center; gap: .55rem; }
.tool-group li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--sand); }

/* ---------- Teaching ---------- */
.badges { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.7rem; }
.badge { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1rem; border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; font-weight: 600; }
.badge svg { width: 16px; height: 16px; color: var(--teal); }

/* ---------- Testimonials ---------- */
.testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin-top: 3rem; }
.testi { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r); padding: 1.8rem 1.7rem; display: flex; flex-direction: column; }
.stars { color: var(--sand); letter-spacing: 2px; font-size: 1rem; margin-bottom: 1rem; }
.testi blockquote { font-family: "Fraunces", serif; font-size: 1.12rem; line-height: 1.42; font-style: italic; color: var(--ink); flex: 1; }
.testi .by { margin-top: 1.4rem; font-size: .88rem; color: var(--ink-soft); display: flex; align-items: center; gap: .5rem; }
.testi .by b { color: var(--ink); font-weight: 700; }
.testi .by a { color: var(--teal-bright); font-weight: 600; border-bottom: 1px solid rgba(46,196,182,.4); transition: border-color .2s; }
.testi .by a:hover { border-bottom-color: var(--teal-bright); }

/* ---------- Tiers ---------- */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin-top: 3rem; }
.tier { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--paper); }
.tier-head { padding: 1.4rem 1.6rem; border-bottom: 1px solid var(--line); }
.tier-head .lvl { font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--sand); }
.tier-head h3 { font-size: 1.35rem; margin-top: .4rem; }
.tier ul { list-style: none; padding: 1.2rem 1.6rem 1.7rem; display: grid; gap: .8rem; }
.tier li { font-size: .96rem; color: var(--ink-soft); display: flex; gap: .6rem; align-items: flex-start; }
.tier li svg { flex: 0 0 16px; width: 16px; height: 16px; color: var(--teal); margin-top: .28rem; }
.tier:nth-child(2) { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; margin-top: 1rem; }
.stat { text-align: center; padding: 1.4rem .6rem; }
.stat .n { font-family: "Fraunces", serif; font-size: clamp(2.4rem, 5vw, 3.6rem); color: var(--teal-bright); line-height: 1; }
.stat .l { font-size: .85rem; color: rgba(246,241,231,.72); margin-top: .6rem; }

/* ---------- Final CTA ---------- */
.cta-final { text-align: center; max-width: 46ch; margin-inline: auto; }
.cta-final h2 { font-size: clamp(2.2rem, 5.5vw, 4rem); }
.cta-final h2 em { color: var(--teal); }
.cta-final p { color: rgba(246,241,231,.78); margin: 1.3rem auto 2.2rem; font-size: 1.12rem; }
.cta-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.cta-alt { margin-top: 1.6rem; font-size: .92rem; color: rgba(246,241,231,.6); }
.cta-alt a { color: var(--teal-bright); border-bottom: 1px solid rgba(46,196,182,.4); }

/* ---------- Footer ---------- */
.footer { background: var(--deep-2); color: rgba(246,241,231,.78); padding: clamp(3rem, 6vw, 4.5rem) 0 2.5rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; align-items: start; }
.footer h4 { color: var(--paper); font-family: "Hanken Grotesk", sans-serif; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 1.1rem; }
.footer a { color: rgba(246,241,231,.78); transition: color .2s; }
.footer a:hover { color: var(--teal-bright); }
.footer ul { list-style: none; display: grid; gap: .7rem; }
.footer .brand { color: var(--paper); font-size: 1.5rem; margin-bottom: .8rem; }
.footer .blurb { font-size: .95rem; max-width: 38ch; }
.footer-map { border-radius: 14px; overflow: hidden; border: 1px solid var(--line-dark); margin-top: .4rem; }
.footer-map img { width: 100%; height: auto; opacity: .9; }
.footer-bottom { margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid var(--line-dark); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-size: .85rem; color: rgba(246,241,231,.55); }

/* ---------- Systems gallery ---------- */
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; margin-top: 2.8rem; }
.gallery figure { position: relative; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-dark); aspect-ratio: 16 / 10; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.gallery figure:hover img { transform: scale(1.04); }
.gallery figcaption { position: absolute; left: 1.1rem; bottom: 1rem; font-size: .9rem; font-weight: 600; color: var(--paper); background: rgba(13,26,28,.6); backdrop-filter: blur(6px); padding: .4rem .8rem; border-radius: 999px; }

/* ---------- Work-together cards (links) ---------- */
.work-card { display: block; color: inherit; }
.work-card .body { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.work-card .arrow { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; transition: background .25s, color .25s, transform .35s var(--ease); }
.work-card:hover .arrow { background: var(--teal); color: #fff; border-color: var(--teal); transform: rotate(-45deg); }
.work-card .arrow svg { width: 18px; height: 18px; }

/* ---------- Final CTA with image backdrop ---------- */
.cta-section { position: relative; overflow: hidden; isolation: isolate; }
.cta-section .cta-bg { position: absolute; inset: 0; z-index: -2; }
.cta-section .cta-bg img { width: 100%; height: 100%; object-fit: cover; }
.cta-section::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(120% 100% at 50% 0%, rgba(20,48,51,.82) 0%, rgba(13,26,28,.94) 65%); }

/* ---------- Contact / lead form ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.contact-copy h2 { font-size: clamp(2rem, 4.6vw, 3.2rem); }
.contact-copy h2 em { color: var(--teal-bright); font-style: italic; }
.contact-copy p { color: rgba(246,241,231,.78); margin: 1.2rem 0 1.6rem; font-size: 1.08rem; }
.contact-assure { list-style: none; display: grid; gap: .75rem; margin-top: 1.6rem; }
.contact-assure li { display: flex; align-items: center; gap: .65rem; font-size: .96rem; color: rgba(246,241,231,.88); }
.contact-assure svg { flex: 0 0 18px; width: 18px; height: 18px; color: var(--teal-bright); }
.contact-alt { margin-top: 1.8rem; font-size: .92rem; color: rgba(246,241,231,.6); }
.contact-alt a { color: var(--teal-bright); border-bottom: 1px solid rgba(46,196,182,.4); }

.lead-card { background: var(--paper); color: var(--ink); border-radius: var(--r); padding: clamp(1.5rem, 3vw, 2.2rem); box-shadow: var(--shadow); }
.lead-card h3 { font-size: 1.45rem; margin-bottom: .35rem; }
.lead-card .sub { color: var(--ink-soft); font-size: .95rem; margin-bottom: 1.4rem; }
.field { display: grid; gap: .4rem; margin-bottom: 1rem; }
.field label { font-size: .82rem; font-weight: 600; color: var(--ink); letter-spacing: .01em; }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: 1rem; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: .8rem .95rem; width: 100%; transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(12,122,111,.16);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.lead-card .btn-accent { width: 100%; justify-content: center; margin-top: .4rem; }
.form-fine { font-size: .82rem; color: var(--ink-soft); text-align: center; margin-top: .9rem; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.form-success { display: none; text-align: center; padding: 1.5rem .5rem; }
.form-success.show { display: block; }
.lead-form.hide { display: none; }
.form-success .ok { width: 54px; height: 54px; border-radius: 50%; background: rgba(12,122,111,.12); color: var(--teal); display: grid; place-items: center; margin: 0 auto 1rem; }
.form-success .ok svg { width: 28px; height: 28px; }
.form-success h3 { margin-bottom: .4rem; }
.form-success p { color: var(--ink-soft); font-size: .98rem; }

@media (max-width: 940px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: .08s; }
.reveal[data-d="2"] { transition-delay: .16s; }
.reveal[data-d="3"] { transition-delay: .24s; }

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .nav-links, .nav-cta .btn-ghost { display: none; }
  .nav-toggle { display: block; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { max-width: 420px; margin: 0 auto; }
  .feature, .build-grid, .testi-grid, .tiers, .footer-grid { grid-template-columns: 1fr; }
  .feature.rev .feature-text { order: 0; }
  .trifecta { grid-template-columns: 1fr; }
  .tri-card:nth-child(2) { transform: none; }
  .tri-card:nth-child(2):hover { transform: translateY(-6px); }
  .tools-grid { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr 1fr; }
  /* mobile nav panel */
  .nav-links.open { display: flex; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--paper); border-bottom: 1px solid var(--line); padding: .5rem 0; }
  .nav-links.open a { padding: .9rem clamp(1.2rem, 4vw, 3rem); width: 100%; }
}
@media (max-width: 560px) {
  .tools-grid, .stats { grid-template-columns: 1fr 1fr; }
  .hero-badge { left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
