/* ============================================================
   Nir & Far — redesign concept (private preview)
   Warm editorial "behavioral-science notebook".
   Fraunces display · Hanken Grotesk body · bone paper · ink.
   Three pillar colors thread Behavior / Attention / Belief.
   ============================================================ */

:root {
  /* palette */
  --paper:      #F3ECDE;
  --paper-2:    #EDE4D2;
  --paper-3:    #E6DBC5;
  --ink:        #191510;
  --ink-soft:   #524A3D;
  --ink-faint:  #8A806E;
  --line:       rgba(25, 21, 16, 0.14);
  --line-soft:  rgba(25, 21, 16, 0.08);

  /* pillars */
  --behavior:   #B4472B;  /* Hooked        — clay   */
  --attention:  #2E5D63;  /* Indistractable— teal   */
  --belief:     #B7842A;  /* Beyond Belief — amber  */
  --accent:     var(--behavior);

  /* type */
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body:    "Hanken Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;

  /* scale */
  --wrap: 1180px;
  --gut: clamp(20px, 5vw, 64px);
  --radius: 3px;

  --shadow: 0 1px 0 rgba(25,21,16,.05), 0 18px 40px -28px rgba(25,21,16,.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* paper grain + soft top glow for atmosphere */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.035;
  mix-blend-mode: multiply;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---------- typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 460;
  line-height: 1.03;
  letter-spacing: -0.015em;
  margin: 0;
  font-optical-sizing: auto;
}
.kicker {
  font-family: var(--body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: inline-flex; align-items: center; gap: 10px;
}
.kicker::before {
  content: ""; width: 26px; height: 1px; background: currentColor; opacity: .6;
}
.serif-i { font-style: italic; }

.lede {
  font-size: clamp(19px, 2.3vw, 24px);
  line-height: 1.5;
  color: var(--ink-soft);
  font-weight: 400;
}

/* ---------- layout ---------- */
.wrap { width: min(100% - var(--gut) * 2, var(--wrap)); margin-inline: auto; position: relative; z-index: 1; }
section { position: relative; z-index: 1; }
.pad { padding-block: clamp(64px, 9vw, 130px); }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ============================================================
   GATE
   ============================================================ */
#gate {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: radial-gradient(120% 90% at 50% -10%, #2a241b 0%, #17130d 60%, #100d08 100%);
  color: #f3ecde;
  transition: opacity .6s ease, visibility .6s;
}
#gate.hide { opacity: 0; visibility: hidden; }
.gate-grain {
  position: absolute; inset: 0; opacity: .06; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.gate-card {
  position: relative; text-align: center; width: min(92vw, 440px);
  padding: 12px; animation: rise .8s cubic-bezier(.2,.8,.2,1) both;
}
.gate-crest {
  font-family: var(--display); font-size: 15px; letter-spacing: .38em;
  text-transform: uppercase; color: #cbb98f; margin-bottom: 30px;
}
.gate-kicker {
  font-size: 11px; letter-spacing: .3em; text-transform: uppercase;
  color: #9c8f74; margin: 0 0 14px;
}
.gate-name {
  font-family: var(--display); font-size: clamp(38px, 7vw, 58px);
  color: #f6efe1; font-weight: 420; line-height: .98; margin-bottom: 18px;
}
.gate-sub { color: #b9ac91; font-size: 15px; margin: 0 auto 30px; max-width: 30ch; line-height: 1.5; }
#gate-form { display: flex; gap: 8px; justify-content: center; }
#gate-pass {
  flex: 1; max-width: 240px; background: rgba(255,255,255,.05);
  border: 1px solid rgba(230,219,197,.28); border-radius: var(--radius);
  color: #f3ecde; padding: 13px 16px; font-family: var(--body); font-size: 15px;
  outline: none; transition: border-color .2s, background .2s;
}
#gate-pass:focus { border-color: #cbb98f; background: rgba(255,255,255,.09); }
#gate-pass::placeholder { color: #8a7d64; }
#gate-btn {
  background: #cbb98f; color: #17130d; border: 0; border-radius: var(--radius);
  padding: 0 22px; font-family: var(--body); font-weight: 700; font-size: 14px;
  letter-spacing: .02em; cursor: pointer; transition: transform .15s, background .2s;
}
#gate-btn:hover { background: #ddcda3; transform: translateY(-1px); }
.gate-err { color: #e0a48c; font-size: 13px; min-height: 20px; margin-top: 16px; }
.gate-err.shake { animation: shake .4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-6px)} 40%,80%{transform:translateX(6px)} }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ============================================================
   APP reveal
   ============================================================ */
#app { opacity: 0; transition: opacity .7s ease .1s; }
#app.show { opacity: 1; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 15px var(--gut);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(10px) saturate(1.1);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand b { font-family: var(--display); font-weight: 500; font-size: 21px; letter-spacing: -.01em; }
.brand small { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint); }
.topnav { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); }
.topnav a {
  text-decoration: none; font-size: 14.5px; font-weight: 500; color: var(--ink-soft);
  position: relative; padding: 4px 0; transition: color .2s;
}
.topnav a:hover, .topnav a[aria-current="page"] { color: var(--ink); }
.topnav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 2px;
  background: var(--accent); border-radius: 2px;
}
.nav-cta {
  background: var(--ink); color: var(--paper) !important; text-decoration: none;
  padding: 10px 18px; border-radius: 100px; font-size: 14px; font-weight: 600;
  transition: transform .16s, background .2s; white-space: nowrap;
}
.nav-cta:hover { transform: translateY(-1px); background: var(--behavior); }
.nav-toggle { display: none; }

/* ---------- hero ---------- */
.hero { padding-top: clamp(48px, 8vw, 96px); padding-bottom: clamp(40px, 6vw, 80px); }
.hero-grid { display: grid; grid-template-columns: 1.35fr .9fr; gap: clamp(30px, 5vw, 72px); align-items: end; }
.hero h1 {
  font-size: clamp(46px, 8.4vw, 108px);
  line-height: .92; letter-spacing: -0.03em; margin: 22px 0 0;
}
.hero h1 .em { font-style: italic; color: var(--accent); }
.hero-sub { margin-top: 28px; max-width: 46ch; }
.hero-cta { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hero-aside { padding-bottom: 8px; }
.hero-aside .quote {
  font-family: var(--display); font-style: italic; font-size: clamp(20px, 2.4vw, 27px);
  line-height: 1.28; color: var(--ink);
}
.hero-aside .cite { margin-top: 16px; font-size: 13px; letter-spacing: .04em; color: var(--ink-faint); }

.btn {
  display: inline-flex; align-items: center; gap: 9px; text-decoration: none;
  padding: 14px 24px; border-radius: 100px; font-weight: 600; font-size: 15px;
  transition: transform .16s, background .2s, box-shadow .2s; cursor: pointer; border: 0;
  font-family: var(--body);
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { transform: translateY(-2px); background: var(--behavior); box-shadow: 0 12px 26px -14px rgba(180,71,43,.7); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- proof marquee ---------- */
.proof { border-block: 1px solid var(--line); background: var(--paper-2); overflow: hidden; }
.proof-inner { display: flex; align-items: center; gap: 18px; padding: 20px var(--gut); flex-wrap: wrap; }
.proof-label { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }
.proof-logos { display: flex; gap: clamp(18px, 3vw, 40px); flex-wrap: wrap; align-items: center; margin-left: auto; }
.proof-logos span { font-family: var(--display); font-size: 19px; font-weight: 500; color: var(--ink-soft); letter-spacing: .01em; }

/* ---------- stat row ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--paper); padding: clamp(26px, 4vw, 44px) clamp(20px, 3vw, 34px); }
.stat .n { font-family: var(--display); font-size: clamp(38px, 5.5vw, 62px); line-height: 1; font-weight: 480; letter-spacing: -.02em; }
.stat .l { margin-top: 12px; font-size: 14.5px; color: var(--ink-soft); max-width: 26ch; }

/* ---------- section head ---------- */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(34px, 5vw, 60px); }
.sec-head h2 { font-size: clamp(32px, 5vw, 56px); max-width: 18ch; }
.sec-num { font-family: var(--display); font-size: 15px; color: var(--ink-faint); letter-spacing: .04em; }

/* ---------- the trilogy arc ---------- */
.arc-intro { max-width: 60ch; margin-bottom: clamp(40px, 5vw, 68px); }
.arc { display: grid; gap: 20px; }
.book {
  --c: var(--behavior);
  display: grid; grid-template-columns: 88px 1fr auto; gap: clamp(20px, 3vw, 44px);
  align-items: center; padding: clamp(26px, 3.4vw, 40px);
  background: var(--paper-2); border: 1px solid var(--line);
  border-left: 4px solid var(--c); border-radius: var(--radius);
  text-decoration: none; color: inherit;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, background .25s;
}
.book:hover { transform: translateY(-4px); box-shadow: var(--shadow); background: var(--paper); }
.book .stage { font-family: var(--display); }
.book .stage .idx { font-size: 15px; color: var(--c); font-weight: 600; letter-spacing: .06em; }
.book .stage .pillar { font-size: clamp(22px, 3vw, 30px); font-weight: 500; margin-top: 6px; line-height: 1; }
.book .body h3 { font-size: clamp(22px, 2.6vw, 30px); }
.book .body h3 em { color: var(--c); font-style: italic; }
.book .body .thesis { margin-top: 10px; color: var(--ink-soft); max-width: 52ch; font-size: 15.5px; }
.book .body .tag { margin-top: 14px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.book .go {
  width: 46px; height: 46px; border-radius: 100px; border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 18px; color: var(--c);
  transition: background .2s, color .2s, border-color .2s;
}
.book:hover .go { background: var(--c); color: #fff; border-color: var(--c); }

/* connective spine between books */
.arc { position: relative; }
.arc-line { position: absolute; left: calc(clamp(26px, 3.4vw, 40px) + 0px); top: 0; bottom: 0; width: 4px; }

/* ---------- speaking teaser ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 5vw, 70px); align-items: center; }
.panel { background: var(--ink); color: var(--paper); border-radius: var(--radius); padding: clamp(34px, 5vw, 64px); position: relative; overflow: hidden; }
.panel::after {
  content: ""; position: absolute; right: -30%; top: -40%; width: 70%; height: 180%;
  background: radial-gradient(circle, rgba(180,71,43,.35), transparent 70%);
}
.panel .kicker { color: #cbb98f; }
.panel h2 { color: var(--paper); font-size: clamp(30px, 4vw, 46px); margin-top: 18px; }
.panel p { color: rgba(243,236,222,.72); margin-top: 18px; max-width: 40ch; position: relative; }
.panel .btn-primary { background: #cbb98f; color: var(--ink); margin-top: 28px; position: relative; }
.panel .btn-primary:hover { background: #ddcda3; box-shadow: none; }
.topic-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.topic-list li { padding: 20px 4px; border-top: 1px solid var(--line); display: flex; gap: 18px; align-items: baseline; }
.topic-list li:last-child { border-bottom: 1px solid var(--line); }
.topic-list .tn { font-family: var(--display); color: var(--ink-faint); font-size: 14px; min-width: 30px; }
.topic-list .tt { font-family: var(--display); font-size: clamp(19px, 2.2vw, 24px); font-weight: 500; }
.topic-list .td { display: block; font-family: var(--body); font-size: 14.5px; color: var(--ink-soft); margin-top: 4px; }

/* ---------- newsletter ---------- */
.news { background: var(--paper-3); border-block: 1px solid var(--line); }
.news-inner { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.news h2 { font-size: clamp(30px, 4.4vw, 52px); max-width: 16ch; }
.news p { color: var(--ink-soft); margin-top: 16px; max-width: 42ch; }
.news-form { display: flex; gap: 10px; margin-top: 8px; }
.news-form input {
  flex: 1; padding: 15px 18px; border: 1px solid var(--line); background: var(--paper);
  border-radius: 100px; font-family: var(--body); font-size: 15px; color: var(--ink); outline: none;
  transition: border-color .2s;
}
.news-form input:focus { border-color: var(--ink); }
.news-note { margin-top: 14px; font-size: 13.5px; color: var(--ink-faint); min-height: 20px; }
.news-note.ok { color: var(--attention); }

/* ---------- generic content ---------- */
.prose { max-width: 68ch; }
.prose p { margin: 0 0 20px; }
.prose h3 { font-size: clamp(24px, 3vw, 34px); margin: 46px 0 16px; }
.pull {
  font-family: var(--display); font-style: italic; font-size: clamp(24px, 3.6vw, 38px);
  line-height: 1.24; margin: clamp(40px,6vw,72px) 0; color: var(--ink); max-width: 24ch;
}
.pull .mk { color: var(--accent); }

/* about layout */
.bio-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(30px, 5vw, 70px); align-items: start; }
.portrait {
  aspect-ratio: 4/5; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--paper-2), var(--paper-3));
  display: grid; place-items: center; position: sticky; top: 96px; overflow: hidden;
}
.portrait .mono { font-family: var(--display); font-size: clamp(80px, 12vw, 150px); color: var(--line); font-weight: 400; }
.portrait .cap { position: absolute; bottom: 18px; left: 20px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }

.creds { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 0; }
.creds li { padding: 16px 0; border-top: 1px solid var(--line); display: flex; gap: 16px; align-items: baseline; font-size: 15px; }
.creds li:last-child { border-bottom: 1px solid var(--line); }
.creds .yr { font-family: var(--display); color: var(--ink-faint); min-width: 66px; font-size: 14px; }

/* pillar grid (trilogy page detail) */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pcard { background: var(--paper-2); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: var(--radius); padding: clamp(24px,3vw,34px); }
.pcard.behavior { --c: var(--behavior); }
.pcard.attention { --c: var(--attention); }
.pcard.belief { --c: var(--belief); }
.pcard .pk { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--c); font-weight: 700; }
.pcard h3 { margin-top: 12px; font-size: clamp(24px, 3vw, 32px); }
.pcard h3 span { display: block; font-size: 14px; font-family: var(--body); font-style: normal; color: var(--ink-faint); letter-spacing: .02em; margin-top: 6px; font-weight: 500; }
.pcard p { margin-top: 16px; color: var(--ink-soft); font-size: 15px; }
.pcard .loop { margin-top: 20px; font-family: var(--display); font-style: italic; color: var(--c); font-size: 17px; }

/* faq / process steps */
.steps { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.step { background: var(--paper); padding: clamp(24px,3vw,36px); }
.step .sn { font-family: var(--display); color: var(--accent); font-size: 15px; }
.step h4 { margin-top: 8px; font-size: clamp(20px, 2.4vw, 26px); }
.step p { margin-top: 10px; color: var(--ink-soft); font-size: 15px; }

/* ---------- footer ---------- */
.foot { background: var(--ink); color: var(--paper); padding: clamp(52px, 7vw, 92px) var(--gut) 40px; margin-top: 0; }
.foot-inner { width: min(100%, var(--wrap)); margin-inline: auto; }
.foot-top { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: end; padding-bottom: 44px; border-bottom: 1px solid rgba(243,236,222,.14); }
.foot-top h2 { color: var(--paper); font-size: clamp(30px, 5vw, 56px); max-width: 16ch; }
.foot-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.foot .btn-primary { background: #cbb98f; color: var(--ink); }
.foot .btn-primary:hover { background: #ddcda3; box-shadow: none; }
.foot .btn-ghost { color: var(--paper); border-color: rgba(243,236,222,.3); }
.foot .btn-ghost:hover { border-color: var(--paper); }
.foot-bottom { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-top: 30px; font-size: 13.5px; color: rgba(243,236,222,.6); }
.foot-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot-nav a { color: rgba(243,236,222,.72); text-decoration: none; transition: color .2s; }
.foot-nav a:hover { color: var(--paper); }
.foot-disc { margin-top: 22px; font-size: 12.5px; color: rgba(243,236,222,.42); max-width: 60ch; line-height: 1.6; }

/* ---------- scroll reveal ---------- */
.reveal-init { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .split, .news-inner, .bio-grid, .foot-top { grid-template-columns: 1fr; }
  .stats, .pillars { grid-template-columns: 1fr; }
  .hero-aside { border-top: 1px solid var(--line); padding-top: 26px; }
  .portrait { position: static; }
  .book { grid-template-columns: 1fr auto; }
  .book .stage { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 12px; }
  .book .stage .pillar { margin-top: 0; }
}
@media (max-width: 760px) {
  .topnav { position: fixed; inset: 0 0 0 auto; width: min(80vw, 320px); flex-direction: column;
    align-items: flex-start; justify-content: flex-start; gap: 6px; padding: 84px 30px 30px;
    background: var(--paper-2); border-left: 1px solid var(--line); transform: translateX(100%);
    transition: transform .35s cubic-bezier(.2,.8,.2,1); z-index: 45; }
  .topnav.open { transform: none; box-shadow: -30px 0 60px -30px rgba(25,21,16,.5); }
  .topnav a { font-size: 19px; padding: 10px 0; }
  .nav-cta { margin-top: 14px; }
  .nav-toggle { display: inline-flex; flex-direction: column; gap: 5px; background: none; border: 0;
    cursor: pointer; padding: 8px; z-index: 46; }
  .nav-toggle span { width: 24px; height: 2px; background: var(--ink); transition: transform .3s, opacity .2s; }
  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .foot-bottom { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal-init { opacity: 1 !important; transform: none !important; transition: none !important; }
  .gate-card { animation: none; }
}
