/* The AI Survival Guide: site components, built on the tokens in asg.css.
   Square frames, hairline rules, no shadows. Contour lines and the dashed
   route are the only decoration; gold marks the one thing that matters. */

/* ---------- shared pieces ---------- */
.topo{position:absolute;inset:0;pointer-events:none;background:url("/assets/topo-forest.svg") center/cover no-repeat}
.topo--paper{background-image:url("/assets/topo-paper.svg");opacity:.7}
.mark{width:22px;height:22px;flex:none;color:var(--gold-rich)}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;font-family:var(--font-body);font-size:13px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;line-height:1;padding:16px 24px;border:0;border-radius:var(--radius-none);background:var(--forest-deep);color:var(--cream);text-decoration:none;cursor:pointer;white-space:nowrap;transition:background-color .15s linear,color .15s linear}
.btn:hover{background:var(--forest);color:var(--cream)}
.btn--gold{background:var(--gold-rich);color:var(--forest-deep)}
.btn--gold:hover{background:var(--cream);color:var(--forest-deep)}
.btn--ghost{background:transparent;color:var(--ink);box-shadow:inset 0 0 0 1px var(--ink)}
.btn--ghost:hover{background:var(--ink);color:var(--surface)}
.btn[disabled]{opacity:.7;cursor:progress}

.arrow-link{font-size:var(--small);font-weight:600;text-decoration:none;color:var(--ink);white-space:nowrap}
.arrow-link span{display:inline-block;transition:transform .15s ease}
.arrow-link:hover span{transform:translateX(3px)}

.input{font:inherit;font-size:16px;color:var(--ink-black);background:var(--field);border:1px solid var(--field-border);border-radius:var(--radius-sm);padding:14px 16px;width:100%;min-width:0}
.input::placeholder{color:#6B7268}

.subscribe-form{display:flex;gap:var(--space-1);max-width:480px;width:100%}
.subscribe-form .input{flex:1}
@media (max-width:520px){.subscribe-form{flex-direction:column}.subscribe-form .btn{width:100%}}
.form-success{display:flex;align-items:flex-start;gap:14px;max-width:480px;padding:16px 18px;border:1px solid var(--contour);background:var(--surface-raised)}
.form-success svg{width:26px;height:26px;flex:none;color:var(--accent);margin-top:2px}
.form-success b{display:block;font-family:var(--font-display);font-weight:400;text-transform:uppercase;font-size:22px;letter-spacing:.5px;line-height:1.1;margin-bottom:4px}
.form-success p{font-size:var(--small);color:var(--ink-muted)}

.section{position:relative;padding-block:var(--space-7)}
.section--tight{padding-block:var(--space-6)}
.section-head{display:flex;align-items:center;gap:var(--space-2);margin-bottom:var(--space-4)}
.section-head .rule{flex:1;height:1px;background:var(--contour)}
.section-head .hand{white-space:nowrap}
@media (max-width:720px){.section{padding-block:56px}.section--tight{padding-block:40px}.section-head .hand{display:none}}

/* ---------- masthead ---------- */
.masthead{position:sticky;top:0;z-index:50;background:var(--forest-deep);border-bottom:1px solid rgba(111,138,122,.35)}
.masthead-row{display:flex;align-items:center;gap:var(--space-4);height:68px}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--cream)}
.brand-name{font-family:var(--font-display);font-size:21px;letter-spacing:.8px;text-transform:uppercase;line-height:1;white-space:nowrap}
.nav{display:flex;gap:var(--space-3);margin-left:auto}
.nav a{font-size:14px;font-weight:500;color:var(--cream);text-decoration:none;padding:6px 0;border-bottom:2px solid transparent}
.nav a:hover{border-bottom-color:var(--sage)}
.nav a.is-active{border-bottom-color:var(--gold-rich)}
.masthead .btn{padding:12px 18px}
@media (max-width:860px){
  .masthead-row{height:auto;flex-wrap:wrap;padding-block:12px;gap:10px var(--space-2)}
  .masthead .btn{margin-left:auto}
  .nav{order:3;width:100%;margin-left:0;gap:var(--space-3);overflow-x:auto;scrollbar-width:none;padding-bottom:2px}
  .nav::-webkit-scrollbar{display:none}
  .brand-name{font-size:18px}
}
/* phones: one compact sticky row; the page is a single scroll */
@media (max-width:720px){
  .masthead-row{flex-wrap:nowrap;height:60px;padding-block:0}
  .nav{display:none}
  .brand{gap:8px}
  .brand-name{font-size:16px;letter-spacing:.5px}
  .mark{width:20px;height:20px}
  .masthead .btn{padding:10px 12px;font-size:12px}
}

/* ---------- hero ---------- */
.hero{position:relative;overflow:hidden}
.hero-grid{position:relative;display:grid;grid-template-columns:minmax(0,7fr) minmax(0,5fr);gap:var(--space-5);align-items:center;padding-block:var(--space-7) var(--space-7)}
.hero-copy{display:grid;justify-items:start;gap:0}
.hero .eyebrow{display:flex;align-items:center;gap:10px;color:var(--ink-muted);margin-bottom:var(--space-3)}
.hero .eyebrow i{display:inline-block;width:6px;height:6px;border-radius:var(--radius-round);background:var(--gold-rich)}
.hero-title{max-width:11ch}
.hero-underline{width:min(460px,78%);height:16px;color:var(--gold-rich);margin:14px 0 10px}
.hero-hand{margin-bottom:var(--space-3)}
.hero-deck{max-width:540px;margin-bottom:var(--space-4);color:var(--ink)}
.hero-proof{margin-top:var(--space-2);font-size:var(--small);color:var(--ink-muted)}
.hero-proof b{color:var(--ink);font-weight:600}
.hero-map{position:relative;width:100%;max-width:500px;justify-self:end;color:var(--cream)}
.hero-map text{font-family:var(--font-hand);font-size:19px;fill:var(--cream);text-transform:lowercase}
@media (max-width:960px){
  .hero-grid{grid-template-columns:1fr;padding-block:var(--space-6) var(--space-5)}
  .hero-map{justify-self:center;max-width:420px;margin-top:calc(var(--space-2) * -1)}
}
@media (max-width:520px){.hero-map{display:none}}

/* route draw-in: the one decorative motion */
@media (prefers-reduced-motion:no-preference){
  .route-reveal{stroke-dasharray:1;stroke-dashoffset:1;animation:route-draw 1.6s cubic-bezier(.45,0,.25,1) .35s forwards}
  .route-dest{opacity:0;transform-box:fill-box;transform-origin:center;animation:dest-in .45s cubic-bezier(.2,0,0,1) 1.75s forwards}
  .route-label{opacity:0;animation:label-in .4s linear forwards}
  .route-label--start{animation-delay:.2s}
  .route-label--end{animation-delay:2s}
  @keyframes route-draw{to{stroke-dashoffset:0}}
  @keyframes dest-in{from{opacity:0;transform:scale(.6)}to{opacity:1;transform:none}}
  @keyframes label-in{to{opacity:1}}
}

/* ---------- latest issue ---------- */
.latest{display:grid;grid-template-columns:minmax(0,4fr) minmax(0,8fr);border:1px solid var(--forest-deep)}
.latest-meta{position:relative;overflow:hidden;display:flex;flex-direction:column;gap:var(--space-2);padding:var(--space-4)}
.latest-meta .topo{opacity:.55}
.latest-meta>*:not(.topo){position:relative}
.issue-no{font-family:var(--font-display);font-size:var(--display-l);line-height:.9;letter-spacing:1px;text-transform:uppercase;color:var(--cream)}
.issue-no small{display:block;font-family:var(--font-body);font-size:var(--eyebrow);font-weight:600;letter-spacing:.14em;color:var(--ink-muted);margin-bottom:10px}
.latest-meta .hand{margin-top:auto;padding-top:var(--space-3)}
.latest-body{display:flex;flex-direction:column;justify-content:center;gap:var(--space-2);padding:var(--space-5);background:var(--surface-raised)}
.latest-body .h1 a{text-decoration:none}
.latest-body .h1 a:hover{text-decoration:underline;text-decoration-color:var(--gold-deep);text-decoration-thickness:3px;text-underline-offset:6px}
.latest-lede{color:var(--ink-muted);max-width:var(--measure)}
.latest-body .btn{align-self:flex-start;margin-top:var(--space-2)}
@media (max-width:860px){
  .latest{grid-template-columns:1fr}
  .latest-meta{flex-direction:row;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;padding:var(--space-3)}
  .latest-meta .hand{display:none}
  .latest-body{padding:var(--space-3)}
}

/* ---------- inside every issue: a five-stop route ---------- */
.legend{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:var(--space-3);counter-reset:stop}
.legend li{position:relative;padding-top:42px}
.legend li::before{content:"";position:absolute;top:9px;left:0;right:calc(var(--space-3) * -1);border-top:2px dashed var(--ink-muted);opacity:.55}
.legend li:last-child::before{display:none}
.legend .stop{position:absolute;top:2px;left:0;width:16px;height:16px;border-radius:var(--radius-round);background:var(--surface);box-shadow:inset 0 0 0 2px var(--ink)}
.legend li:last-child .stop{width:24px;height:24px;top:-2px;left:-4px;box-shadow:inset 0 0 0 3px var(--gold-deep);background:radial-gradient(circle,var(--gold-deep) 0 4px,var(--surface) 5px)}
.legend .num{display:block;font-family:var(--font-display);font-size:15px;letter-spacing:1px;color:var(--ink-muted);margin-bottom:6px}
.legend h3{margin-bottom:10px}
.legend p{font-size:var(--small);line-height:1.55;color:var(--ink-muted)}
.legend p em{font-style:normal;color:var(--ink);font-weight:500}
@media (max-width:1024px){
  .legend{grid-template-columns:1fr;gap:0}
  .legend li{padding:0 0 var(--space-4) 44px}
  .legend li::before{top:16px;bottom:0;left:7px;right:auto;border-top:0;border-left:2px dashed var(--ink-muted)}
  .legend li:last-child{padding-bottom:0}
  .legend .stop{top:4px}
  .legend li:last-child .stop{top:0}
  .legend p{max-width:var(--measure)}
}

/* ---------- start here ---------- */
.start-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--space-3)}
.start-card{position:relative;display:flex;flex-direction:column;gap:12px;padding:var(--space-4) var(--space-3) var(--space-3);background:var(--surface-raised);border-top:3px solid var(--forest-deep);text-decoration:none;color:var(--ink);transition:background-color .15s linear}
.start-card:hover{background:#E1DACB}
.start-card .caption{display:flex;justify-content:space-between;gap:var(--space-1)}
.start-card p{font-size:var(--small);color:var(--ink-muted);flex:1}
.start-card .arrow-link{margin-top:var(--space-1)}
.start-card:hover .arrow-link span{transform:translateX(3px)}
@media (max-width:960px){.start-grid{grid-template-columns:1fr}}

/* ---------- archive ---------- */
.archive-tools{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--space-2);margin-bottom:var(--space-3)}
.search{position:relative;flex:1;max-width:420px;min-width:240px}
.search svg{position:absolute;left:14px;top:50%;width:18px;height:18px;transform:translateY(-50%);color:var(--ink-muted);pointer-events:none}
.search .input{padding-left:42px}
.archive-list{list-style:none;margin:0;padding:0;border-top:1px solid var(--contour)}
.archive-row{border-bottom:1px solid var(--contour)}
.archive-row a{display:grid;grid-template-columns:120px minmax(0,1fr) auto;gap:var(--space-3);align-items:baseline;padding:20px 8px;text-decoration:none;color:var(--ink);transition:background-color .12s linear}
.archive-row a:hover{background:var(--surface-raised)}
.archive-date{font-size:var(--caption);font-weight:500;letter-spacing:.04em;text-transform:uppercase;color:var(--ink-muted)}
.archive-title{font-size:var(--body-lg);font-weight:600;line-height:1.3;margin-bottom:4px}
.archive-sub{font-size:var(--small);color:var(--ink-muted)}
.archive-read{font-size:var(--caption);color:var(--ink-muted);white-space:nowrap}
.archive-row a:hover .archive-title{text-decoration:underline;text-decoration-color:var(--gold-deep);text-decoration-thickness:2px;text-underline-offset:4px}
.archive-more{display:flex;justify-content:center;margin-top:var(--space-4)}
.archive-empty{padding:var(--space-5) 0;text-align:center;color:var(--ink-muted)}
mark{background:rgba(201,162,58,.32);color:inherit;padding:0 1px}
@media (max-width:720px){
  .archive-row a{grid-template-columns:1fr;gap:6px;padding:18px 4px}
  .archive-read{display:none}
}

/* ---------- about ---------- */
.about{position:relative;overflow:hidden}
.about .topo{background-position:20% 70%;transform:scaleX(-1)}
.about-grid{position:relative;display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:var(--space-6);align-items:center}
/* round photo inside a gold ring: the "you are here" marker */
.portrait-wrap{display:grid;justify-items:center;padding:14px}
.portrait{width:100%;max-width:400px;aspect-ratio:1;border-radius:var(--radius-round);background:var(--forest);outline:3px solid var(--gold-rich);outline-offset:10px}
.portrait img{width:100%;height:100%;border-radius:var(--radius-round);object-fit:cover}
.portrait-note{margin-top:calc(var(--space-3) + 6px)}
.about-copy{display:grid;gap:var(--space-2);justify-items:start}
.about-copy .eyebrow{color:var(--ink-muted)}
.about-copy p{max-width:var(--measure);color:var(--ink)}
.about-copy p.muted{color:var(--ink-muted)}
.about-copy a:not(.btn){color:var(--cream)}
.stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;border-top:1px solid rgba(111,138,122,.5);border-bottom:1px solid rgba(111,138,122,.5);margin-block:var(--space-2)}
.stats>div{padding:var(--space-2) var(--space-2) var(--space-2) 0}
.stats>div+div{border-left:1px solid rgba(111,138,122,.5);padding-left:var(--space-2)}
.stat-num{font-family:var(--font-display);font-size:var(--h1);line-height:1;letter-spacing:.5px}
.stat-label{font-size:var(--caption);letter-spacing:.04em;text-transform:uppercase;color:var(--ink-muted);margin-top:6px}
.about-links{display:flex;flex-wrap:wrap;gap:var(--space-2);align-items:center;margin-top:var(--space-1)}
@media (max-width:960px){
  .about-grid{grid-template-columns:1fr;gap:var(--space-5)}
  .portrait-wrap{justify-items:start}
  .portrait{max-width:280px}
}

/* ---------- closing call to action ---------- */
.cta{position:relative;overflow:hidden;text-align:center}
.cta-inner{position:relative;display:grid;justify-items:center;gap:var(--space-2)}
.cta .subscribe-form{margin-top:var(--space-2)}
.cta .form-success{text-align:left}
.cta-title{max-width:16ch}

/* ---------- footer ---------- */
.footer{padding-top:var(--space-6)}
.footer-grid{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:var(--space-5);padding-bottom:var(--space-5)}
.footer-tag{margin-top:var(--space-2);max-width:420px;font-size:var(--small);color:var(--ink-muted)}
.footer-nav{display:grid;grid-template-columns:repeat(2,auto);gap:10px var(--space-5);align-content:start}
.footer-nav a{font-size:var(--small);color:var(--cream);text-decoration:none}
.footer-nav a:hover{text-decoration:underline;text-decoration-color:var(--gold-rich)}
.footer-bottom{display:flex;flex-wrap:wrap;justify-content:space-between;gap:var(--space-2);padding-block:var(--space-3);border-top:1px solid rgba(111,138,122,.35);font-size:var(--caption);color:var(--ink-muted)}
@media (max-width:720px){.footer-grid{grid-template-columns:1fr}}

/* ---------- subscribe popup ---------- */
.popup-scrim{position:fixed;inset:0;z-index:100;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(10,20,14,.62)}
.popup-scrim[hidden]{display:none}
.popup{position:relative;overflow:hidden;width:min(540px,100%);max-height:calc(100vh - 40px);overflow-y:auto;background:var(--surface);border:1px solid var(--forest-deep)}
.popup-inner{position:relative;display:grid;justify-items:start;gap:var(--space-2);padding:var(--space-5) var(--space-4) var(--space-4)}
.popup .topo{opacity:.5}
.popup .eyebrow{display:flex;align-items:center;gap:10px;color:var(--ink-muted)}
.popup-close{position:absolute;top:10px;right:10px;z-index:2;width:40px;height:40px;display:grid;place-items:center;background:none;border:0;cursor:pointer;color:var(--ink-muted);font-size:26px;line-height:1}
.popup-close:hover{color:var(--ink)}
@media (max-width:520px){.popup-inner{padding:var(--space-4) var(--space-3) var(--space-3)}}
@media (prefers-reduced-motion:no-preference){
  .popup-scrim:not([hidden]){animation:fade .18s linear}
  .popup-scrim:not([hidden]) .popup{animation:rise .22s cubic-bezier(.2,0,0,1)}
  @keyframes fade{from{opacity:0}}
  @keyframes rise{from{opacity:0;transform:translateY(8px)}}
}
