/* ==========================================================================
   Cortessian — site stylesheet
   Token system carried over from the brand guidelines for visual continuity.
   ========================================================================== */

:root {
  color-scheme: light;

  /* Fixed brand palette */
  --brand-ink:    #1B2340;
  --brand-slate:  #565E78;
  --brand-paper:  #F1F2F6;
  --brand-line:   #D7DBE7;
  --brand-teal:   #1E7F72;
  --brand-gold:   #C08A34;

  /* Semantic page tokens */
  --bg:            var(--brand-paper);
  --surface:       #FFFFFF;
  --surface-2:     #E9EAF1;
  --text:          var(--brand-ink);
  --text-muted:    var(--brand-slate);
  --border:        var(--brand-line);
  --accent:        var(--brand-teal);
  --accent-soft:   #E4F1EE;
  --accent-2:      var(--brand-gold);
  --accent-2-soft: #F3E8D6;
  --danger:        #B23B3B;
  --success:       #1E7F72;

  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --shadow-1: 0 1px 2px rgba(27,35,64,0.06);
  --shadow-2: 0 12px 32px rgba(27,35,64,0.10);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:            #12162A;
    --surface:       #1A1F3B;
    --surface-2:     #232948;
    --text:          #ECEDF3;
    --text-muted:    #A9AFC6;
    --border:        #333C5E;
    --accent:        #4FB3A4;
    --accent-soft:   rgba(79,179,164,0.14);
    --accent-2:      #D9A64F;
    --accent-2-soft: rgba(217,166,79,0.14);
    --danger:        #E1685F;
    --success:       #4FB3A4;
    --shadow-1: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-2: 0 12px 32px rgba(0,0,0,0.4);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:            #12162A;
  --surface:       #1A1F3B;
  --surface-2:     #232948;
  --text:          #ECEDF3;
  --text-muted:    #A9AFC6;
  --border:        #333C5E;
  --accent:        #4FB3A4;
  --accent-soft:   rgba(79,179,164,0.14);
  --accent-2:      #D9A64F;
  --accent-2-soft: rgba(217,166,79,0.14);
  --danger:        #E1685F;
  --success:       #4FB3A4;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-2: 0 12px 32px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; text-wrap: balance; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.3rem, 2.6vw + 1.4rem, 3.6rem); line-height: 1.1; }
h2 { font-size: clamp(1.6rem, 1.2vw + 1.2rem, 2.3rem); line-height: 1.18; }
h3 { font-size: 1.25rem; line-height: 1.3; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 920px; margin: 0 auto; padding: 0 24px; }
.wrap--wide { max-width: 1120px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; background: var(--accent); color: #fff;
  padding: 10px 16px; border-radius: 3px; z-index: 100; transition: top .15s ease;
  font-family: var(--font-mono); font-size: 0.85rem;
}
.skip-link:focus { top: 12px; }

/* ---------- Reusable mark ---------- */
.mark-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.mark { display: inline-block; color: var(--accent); flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.98rem;
  padding: 13px 24px; border-radius: 3px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; line-height: 1;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, black); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 16px 30px; font-size: 1.05rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---------- Nav ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-nav .bar { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand .mark { width: 26px; height: 26px; }
.brand span { font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: 1.25rem; }
.brand:hover { text-decoration: none; }

.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted); text-decoration: none; border-bottom: 1px solid transparent; padding-bottom: 3px;
}
.nav-links a:hover, .nav-links a:focus-visible, .nav-links a[aria-current="page"] { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.nav-cta { margin-left: 6px; }
/* NOTE (unreadable nav CTA text): ".nav-links a" (color: var(--text-muted))
   has higher CSS specificity than ".btn-primary" (color: #fff), so it
   silently wins and paints the "Book a conversation" button text in the
   muted slate/grey instead of white — .btn-primary already asks for #fff,
   it just isn't winning the cascade.
   Recommended colour: #FFFFFF — it's what .btn-primary already specifies,
   and gives ~5.4:1 contrast against the teal background (--brand-teal
   #1E7F72), comfortably passing WCAG AA for button text (needs 4.5:1) in
   both light mode and the dark-mode accent (#4FB3A4, even higher contrast).
   To fix, add a selector at least as specific as ".nav-links a":
     .nav-cta .btn-primary,
     .nav-cta .btn-primary:hover,
     .nav-cta .btn-primary:focus-visible { color: #fff; }
*/
.nav-cta .btn-primary,
.nav-cta .btn-primary:hover,
.nav-cta .btn-primary:focus-visible { color: #fff; padding-bottom: 13px; }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--border); border-radius: 3px;
  width: 42px; height: 38px; align-items: center; justify-content: center; cursor: pointer; color: var(--text);
}
.nav-toggle svg { width: 18px; height: 18px; }

@media (max-width: 860px) {
  .nav-links { position: fixed; inset: 68px 0 auto 0; flex-direction: column; align-items: flex-start;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 20px 24px 28px; gap: 18px;
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity .15s ease, transform .15s ease; }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-toggle { display: inline-flex; }
  .nav-cta { margin-left: 0; }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding: 84px 0 76px; overflow: hidden; border-bottom: 1px solid var(--border); }
.hero--compact { padding: 56px 0 52px; }
.hero::before {
  content: ""; position: absolute; inset: -10%;
  background-image:
    repeating-linear-gradient(to right, var(--border) 0, var(--border) 1px, transparent 1px, transparent 64px),
    repeating-linear-gradient(to bottom, var(--border) 0, var(--border) 1px, transparent 1px, transparent 64px);
  opacity: 0.4;
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 25% 30%, black, transparent 72%);
          mask-image: radial-gradient(ellipse 60% 55% at 25% 30%, black, transparent 72%);
  pointer-events: none;
}
.hero-inner { position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono);
  font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 20px;
}
.hero h1 { max-width: 16ch; margin-bottom: 22px; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-sub { font-size: 1.15rem; color: var(--text-muted); max-width: 52ch; margin-bottom: 32px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-meta { margin-top: 28px; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }

/* ---------- Sections ---------- */
section.block { padding: 76px 0; border-bottom: 1px solid var(--border); }
section.block:last-of-type { border-bottom: none; }
.block-head { max-width: 62ch; margin-bottom: 44px; }
.block-head p { color: var(--text-muted); font-size: 1.03rem; }
.prose { max-width: 68ch; }
.prose p { color: var(--text); }
.prose .lede { font-size: 1.15rem; }
.lede { font-size: 1.15rem; max-width: 66ch; }

/* ---------- Pillars / offer cards ---------- */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); }
@media (max-width: 780px) { .pillars { grid-template-columns: 1fr; } }
.pillar { background: var(--surface); padding: 32px 28px; }
.pillar .num { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 14px; display: block; }
.pillar h3 { margin-bottom: 10px; }
.pillar p { color: var(--text-muted); font-size: 0.96rem; margin-bottom: 0; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 3px; padding: 28px; }
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 720px) { .card-grid { grid-template-columns: 1fr; } }

/* ---------- Founder (photo + bio) ---------- */
.founder { display: flex; gap: 28px; align-items: flex-start; }
@media (max-width: 520px) { .founder { flex-direction: column; } }
.founder-photo {
  flex: none; width: 148px; height: 148px; border-radius: 4px; overflow: hidden;
  position: relative; border: 1px solid var(--border);
}
.founder-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: grayscale(1) contrast(1.06);
}
.founder-photo::after {
  /* Tints the grayscale photo with the brand accent so a studio backdrop
     doesn't fight the rest of the palette — same "spend the boldness in
     one place" logic as the mark and the accent color itself. */
  content: ""; position: absolute; inset: 0;
  background: var(--accent); opacity: 0.3; mix-blend-mode: color; pointer-events: none;
}
.founder-body { flex: 1; min-width: 0; }
.founder-body h3 { margin-bottom: 10px; }

/* ---------- Service detail blocks ---------- */
.service {
  display: grid; grid-template-columns: 220px 1fr; gap: 40px; padding: 46px 0; border-top: 1px solid var(--border);
}
.service:first-of-type { border-top: none; padding-top: 0; }
@media (max-width: 760px) { .service { grid-template-columns: 1fr; gap: 16px; } }
.service .tag { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.service h3 { margin-top: 8px; }
.service ul { margin: 18px 0 0; padding-left: 20px; color: var(--text-muted); font-size: 0.96rem; }
.service li { margin-bottom: 8px; }

/* ---------- Statement / quote card ---------- */
.statement-card {
  border: 1px solid var(--border); border-left: 3px solid var(--accent); background: var(--surface);
  padding: 30px 34px; border-radius: 2px;
}
.statement-card .eyebrow { color: var(--accent); margin-bottom: 12px; }
.statement-card p { font-family: var(--font-display); font-size: 1.22rem; line-height: 1.5; margin-bottom: 0; }

/* ---------- FAQ ---------- */
.faq-list { border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 22px 4px; font-family: var(--font-body); font-weight: 600; font-size: 1.02rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .icon { flex: none; width: 20px; height: 20px; color: var(--accent); transition: transform .18s ease; }
.faq-item[open] summary .icon { transform: rotate(45deg); }
.faq-item .answer { padding: 0 4px 24px; color: var(--text-muted); max-width: 68ch; }
.faq-item .answer p:last-child { margin-bottom: 0; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 20px; }
.field.full { grid-column: 1 / -1; }
.field label { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.field input, .field select, .field textarea {
  font-family: var(--font-body); font-size: 1rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 3px; padding: 12px 14px; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field textarea { resize: vertical; min-height: 130px; }
.field .hint { font-size: 0.82rem; color: var(--text-muted); }
.hp-field { position: absolute; left: -9999px; top: -9999px; }
.form-status { margin-top: 16px; font-family: var(--font-mono); font-size: 0.88rem; padding: 12px 14px; border-radius: 3px; display: none; }
.form-status.show { display: block; }
.form-status.ok { background: var(--accent-soft); color: var(--success); }
.form-status.err { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }

/* ---------- Contact split ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 56px; align-items: start; }
@media (max-width: 840px) { .contact-grid { grid-template-columns: 1fr; gap: 40px; } }
.contact-info dl { margin: 0; }
.contact-info dt { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-top: 22px; }
.contact-info dt:first-child { margin-top: 0; }
.contact-info dd { margin: 6px 0 0; font-size: 1.02rem; }

/* ---------- CTA band ---------- */
.cta-band { padding: 72px 0; background: var(--brand-ink); color: var(--brand-paper); }
.cta-band .wrap { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta-band h2 { color: var(--brand-paper); margin-bottom: 8px; }
.cta-band p { color: var(--brand-line); margin-bottom: 0; max-width: 44ch; }
.cta-band .btn-primary { background: var(--brand-teal); }
.cta-band .btn-primary:hover { background: color-mix(in srgb, var(--brand-teal) 86%, white); }

/* ---------- Footer ---------- */
.site-footer { padding: 56px 0 60px; border-top: 1px solid var(--border); }
.footer-grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-brand .brand { margin-bottom: 12px; }
.footer-brand p { color: var(--text-muted); font-size: 0.92rem; max-width: 34ch; }
.footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h4 { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--text); font-size: 0.92rem; }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-muted); }

/* ---------- Legal pages ---------- */
.legal .prose h2 { margin-top: 2em; }
.legal .prose h3 { margin-top: 1.5em; }
.legal .prose ul { padding-left: 22px; color: var(--text); }
.legal .prose li { margin-bottom: 8px; }
.legal .updated { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-muted); margin-bottom: 40px; }

/* ---------- 404 ---------- */
.error-page { padding: 120px 0; text-align: center; }
.error-page .code { font-family: var(--font-mono); color: var(--accent); font-size: 0.9rem; letter-spacing: 0.1em; margin-bottom: 18px; }

/* ---------- Reveal ----------
   Visible by default. The hidden pre-reveal state only applies once
   /assets/js/main.js has confirmed it actually ran (by adding "js" to
   <html>) and can guarantee it'll un-hide things again — so content never
   depends on JavaScript to be seen if a script is blocked or fails. */
.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

.scale-wrap { overflow-x: auto; }
