/* Home, Philosophy and the founding note, plus the check-in dialog on the home page.
   Every colour, size, space, radius and duration comes from the tokens in /site.css. */

/* Base */
:root{color:var(--ink);background:var(--paper);font-family:var(--sans);scroll-behavior:smooth}
*{box-sizing:border-box}
body{margin:0;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
figure,h1,h2,h3,p{margin:0}
a{color:inherit}
button{font:inherit;color:inherit;cursor:pointer}
:where(a,button,summary,[tabindex]):focus-visible{outline:var(--focus-ring);outline-offset:var(--focus-offset)}
h1,h2,h3{font-family:var(--serif);font-weight:450;font-optical-sizing:auto;text-wrap:balance}
h1{font-size:var(--text-h1);line-height:var(--leading-tight);letter-spacing:var(--tracking-heading)}
h2{font-size:var(--text-h2);line-height:1.08;letter-spacing:var(--tracking-heading)}
em{font-family:var(--serif);font-style:italic;font-weight:inherit;color:var(--blue)}
.wrap{width:min(var(--container),100% - 2*var(--gutter));margin-inline:auto}
.skip{position:fixed;left:10px;top:-80px;z-index:20;background:var(--surface);padding:var(--space-3);border-radius:var(--radius-md)}
.skip:focus{top:10px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}

/* Labels: small capitals with an orange rule */
.eyebrow{display:flex;align-items:center;gap:var(--space-3);font:600 var(--text-label)/1.4 var(--sans);letter-spacing:var(--tracking-label);text-transform:uppercase;color:var(--orange-ink)}
.eyebrow i{display:inline-block;flex-shrink:0;width:20px;height:2px;border-radius:2px;background:var(--orange)}

/* Buttons and links */
.pill{display:inline-flex;align-items:center;justify-content:center;gap:var(--space-2);min-height:48px;padding:0 var(--space-5);border:1px solid transparent;border-radius:var(--radius-md);font:600 1rem/1.1 var(--sans);text-decoration:none;cursor:pointer;transition:background-color var(--dur-fast) var(--ease)}
.pill:disabled{opacity:.45;cursor:default}
.orange{background:var(--orange);color:var(--on-orange)}
.orange:not(:disabled):hover{background:var(--orange-hover)}
.dark{background:var(--ink);color:var(--on-dark)}
.dark:not(:disabled):hover{background:var(--ink-hover)}
.how,.reading-link{color:var(--ink);font-weight:500;text-decoration:underline;text-decoration-color:var(--orange);text-decoration-thickness:1px;text-underline-offset:6px;transition:color var(--dur-fast) var(--ease),text-decoration-thickness var(--dur-fast) var(--ease)}
.how:hover,.reading-link:hover{color:var(--orange-ink);text-decoration-thickness:2px}
.text-button{min-height:44px;padding:0;border:0;background:none;font-size:var(--text-small);font-weight:500;text-decoration:underline;text-decoration-color:transparent;text-underline-offset:5px;transition:text-decoration-color var(--dur-fast) var(--ease)}
.text-button:hover{text-decoration-color:var(--orange)}

/* Hero */
.hero{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);gap:var(--space-8);align-items:center;padding-block:var(--space-8) var(--section-space)}
.hero h1{font-size:var(--text-display);line-height:1;letter-spacing:var(--tracking-display);margin:var(--space-5) 0}
.hero-copy>p{max-width:27em;font:400 var(--text-lead)/1.5 var(--serif);color:var(--muted);text-wrap:pretty}
.hero-actions{display:flex;flex-wrap:wrap;gap:var(--space-3) var(--space-6);align-items:center;margin:var(--space-6) 0 var(--space-4)}
.hero-foot,.card-info{display:flex;align-items:center;gap:var(--space-2);font-size:.875rem;color:var(--subtle)}
.card-info{flex-wrap:wrap;row-gap:var(--space-1)}
.dot{color:var(--subtle)}
.clock{position:relative;display:inline-block;flex-shrink:0;width:14px;height:14px;border:1.3px solid currentColor;border-radius:50%}
.clock:after{position:absolute;content:"";left:5px;top:2px;width:3px;height:4px;border-left:1px solid;border-bottom:1px solid}

/* Hero illustration: the engraved brain with its two callouts */
.specimen{position:relative;width:100%;aspect-ratio:1.33;isolation:isolate;background:var(--paper)}
.grid-paper{position:absolute;inset:0 0 8%;background-image:linear-gradient(90deg,var(--grid-line) 1px,transparent 1px),linear-gradient(var(--grid-line) 1px,transparent 1px);background-size:24px 24px;mask-image:radial-gradient(ellipse,var(--ink) 25%,transparent 72%)}
.brain{position:absolute;left:11%;top:7%;width:77%;height:83%;object-fit:contain;mix-blend-mode:multiply}
.callout,.specimen-caption{font:600 .6875rem/1.4 var(--sans);letter-spacing:var(--tracking-label);text-transform:uppercase}
.callout{position:absolute;color:var(--blue)}
.callout b{position:absolute;display:block;height:1px;background:currentColor;width:44px}
.callout b:before,.callout b:after{content:"";display:block;position:absolute}
.callout b:before{height:1px;width:39px;background:currentColor}
.callout b:after{width:6px;height:6px;outline:3px solid var(--halo);background:var(--blue);border-radius:50%}
.top{right:2%;top:10%}
.top b{right:100%;top:50%;margin-right:7px}
.top b:before{right:100%;transform:rotate(-43deg);transform-origin:100% 50%}
.top b:after{right:calc(100% + 25px);top:24px}
.bottom{bottom:23%;left:1%}
.bottom b{left:100%;top:50%;margin-left:7px}
.bottom b:before{left:100%;transform:rotate(-36deg);transform-origin:0 50%}
.bottom b:after{left:calc(100% + 28px);top:-25px}
.specimen-caption{position:absolute;bottom:0;left:0;right:0;text-align:center;color:var(--subtle);font-weight:500}
.specimen-caption span{color:var(--orange);padding-inline:6px}

/* Assessments */
.library{background:var(--surface-sunken);border-block:1px solid var(--rule);padding-block:var(--section-space);scroll-margin-top:var(--space-4)}
.library-heading{display:flex;justify-content:space-between;align-items:end;gap:var(--space-6);margin:var(--space-4) 0 var(--space-7)}
.library-heading p{max-width:27em;font:400 var(--text-lead)/1.45 var(--serif);color:var(--muted);text-wrap:balance}
.cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--space-5)}
.card{position:relative;display:flex;flex-direction:column;align-items:stretch;padding:var(--space-5) 28px var(--space-5);text-align:left;text-decoration:none;color:inherit;font:inherit;background:var(--surface);border:1px solid var(--rule);border-top:var(--accent-bar) solid var(--accent);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);transition:transform var(--dur) var(--ease),box-shadow var(--dur) var(--ease)}
.card:hover{transform:translateY(-2px);box-shadow:var(--shadow-md)}
.card-top{height:104px}
.category{display:inline-block;padding:5px 10px;border-radius:var(--radius-pill);background:var(--tint);color:var(--tone-ink);font:600 .6875rem/1.3 var(--sans);letter-spacing:.08em;text-transform:uppercase}
/* The motif sits on a soft tile in the card's tint, in its usual top-right place. */
.card-top:after{content:"";position:absolute;z-index:0;top:var(--space-5);right:var(--space-5);width:120px;height:98px;border-radius:var(--radius-lg);background:var(--tint)}
.motif{position:absolute;z-index:1;top:calc(var(--space-5) + 7px);right:calc(var(--space-5) + 9px);width:102px;height:84px}
.card h3{max-width:14em;margin:var(--space-5) 0 var(--space-2);font-size:var(--text-h3);font-weight:500;line-height:1.15;letter-spacing:-.01em}
.card p{max-width:24em;margin:0 0 var(--space-5);font-size:1rem;line-height:1.55;color:var(--muted)}
.card-info{margin-top:auto;padding-top:var(--space-4);border-top:1px solid var(--rule)}
.card-info .clock{width:13px;height:13px}
.card-action{margin-left:auto;color:var(--ink);font-weight:600;transition:color var(--dur-fast) var(--ease)}
/* The arrow is an inline-block so it can move; its leading space would collapse, hence the margin. */
.card-action span{display:inline-block;margin-left:.3em;transition:transform var(--dur) var(--ease)}
.card:hover .card-action{color:var(--orange-ink)}
.card:hover .card-action span{transform:translateX(3px)}

/* Founding note on the home page */
.journal-inner{display:grid;grid-template-columns:1.1fr 1fr;gap:var(--space-8);align-items:center;padding-block:var(--section-space)}
.journal-inner h2{margin-top:var(--space-4)}
.journal-inner p,.reading-list p{max-width:30em;font:400 var(--text-lead)/1.5 var(--serif);color:var(--muted)}
/* Quote of the day: the reading-page blockquote (italic serif, 2 px orange rule) with its attribution. */
.quote-band{padding-block:var(--section-space);border-bottom:1px solid var(--rule)}
.quote{max-width:44rem;margin:var(--space-5) 0 0}
.quote blockquote{margin:0;padding-left:var(--space-5);border-left:2px solid var(--orange);font:italic 400 var(--text-lead)/1.5 var(--serif);color:var(--ink);text-wrap:pretty}
.quote figcaption{margin-top:var(--space-4);padding-left:var(--space-5);font-size:var(--text-small);color:var(--muted)}
.quote cite{font-style:italic}
.reading-link{display:inline-block;margin-top:var(--space-5);line-height:1.6}

/* Reading pages: Philosophy and the founding note */
.reading-page{width:min(var(--measure),100% - 2*var(--gutter));margin:0 auto;padding-block:var(--space-8) var(--section-space)}
.reading-page>.reading-link:first-child{margin:0 0 var(--space-6)}
.reading-page h1{margin:var(--space-4) 0 var(--space-5)}
.standfirst{margin-bottom:var(--space-7);font:italic 400 var(--text-lead)/1.5 var(--serif);color:var(--muted)}
.article-body,.reading-list,.reading-end{border-top:1px solid var(--rule)}
.article-body{padding-top:var(--space-6);font:400 var(--text-reading)/var(--leading-reading) var(--serif)}
.article-body p,.article-body ul{margin:0 0 1em}
.article-body h2{margin:var(--space-7) 0 var(--space-4);font-size:clamp(1.6rem,2.4vw,2rem);font-weight:500;line-height:1.2;letter-spacing:-.012em}
.article-body ul{padding-left:1.2em}
.article-body li{margin-bottom:.6em;padding-left:.2em}
.article-body li::marker{color:var(--orange)}
.article-body strong{font-weight:600}
.article-body blockquote{margin:var(--space-6) 0;padding-left:var(--space-5);border-left:2px solid var(--orange);font-size:1.35rem;font-style:italic;line-height:1.5}
.article-body p:last-child{font-family:var(--brand-serif);font-size:1.65rem}
.reading-end{margin-top:var(--space-6);padding-top:var(--space-5)}
.reading-list article{padding-block:var(--space-6);border-bottom:1px solid var(--rule)}
.reading-list h2{margin:var(--space-3) 0;font-size:clamp(1.9rem,3vw,2.4rem)}

/* Dialog (check-ins, results, My check-ins, privacy) */
dialog{width:min(580px,100% - 28px);max-height:90dvh;padding:0;border:1px solid var(--rule);border-radius:var(--radius-xl);background:var(--surface);color:var(--ink);box-shadow:var(--shadow-lg)}
dialog::backdrop{background:var(--backdrop);backdrop-filter:blur(3px)}
dialog[open]{animation:dialog-in var(--dur-slow) var(--ease)}
dialog[open]::backdrop{animation:fade-in var(--dur-slow) var(--ease)}
@keyframes dialog-in{from{opacity:0;transform:translateY(8px)}}
@keyframes fade-in{from{opacity:0}}
body:has(dialog[open]){overflow:hidden}
.dialog-head{display:flex;justify-content:space-between;align-items:center;padding:var(--space-3) var(--space-5);border-bottom:1px solid var(--rule)}
.brand,.small-brand{display:inline-flex;align-items:center;gap:10px;text-decoration:none;font:500 1.4rem/.98 var(--brand-serif);letter-spacing:-.045em}
.small-brand img{display:block;width:40px;height:auto;margin:-3px -4px -2px}
.close{width:40px;height:40px;border:0;border-radius:var(--radius-md);background:transparent;color:var(--muted);font:1.7rem/1 var(--sans);transition:background-color var(--dur-fast) var(--ease),color var(--dur-fast) var(--ease)}
.close:hover{background:var(--hover-tint);color:var(--ink)}
#panel-body{padding:var(--space-6)}
#panel h2:focus{outline:none}
dialog h2{margin:var(--space-4) 0;font-size:var(--text-question);line-height:var(--leading-heading);letter-spacing:-.015em}
dialog p{line-height:1.55;color:var(--muted)}
.meta{font-size:.875rem;color:var(--subtle)}
.progress{display:flex;gap:4px;margin:var(--space-3) 0 var(--space-5)}
.progress i{flex:1;height:4px;border-radius:4px;background:var(--rule)}
.progress i.filled{background:var(--blue)}
fieldset{display:grid;gap:var(--space-2);margin:var(--space-5) 0;padding:0;border:0}
.option{display:flex;align-items:center;gap:var(--space-3);min-height:52px;padding:var(--space-3) var(--space-4);border:1px solid var(--rule-control);border-radius:var(--radius-md);background:var(--surface);cursor:pointer;transition:border-color var(--dur-fast) var(--ease),background-color var(--dur-fast) var(--ease)}
.option:hover{border-color:var(--muted)}
.option:has(:checked){border-color:var(--blue);background:var(--blue-tint);box-shadow:inset 0 0 0 1px var(--blue)}
.option:focus-within{outline:var(--focus-ring);outline-offset:2px}
input[type=radio]{width:18px;height:18px;margin:0;accent-color:var(--blue)}
.dialog-actions{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);margin-top:var(--space-5)}
.practice{margin:var(--space-5) 0 var(--space-3);padding:var(--space-5);border:1px solid var(--rule);border-radius:var(--radius-lg);background:var(--surface-sunken)}
.practice h3{margin:var(--space-2) 0;font-size:1.6rem;font-weight:500;line-height:1.15}
.list-result{display:flex;justify-content:space-between;align-items:center;gap:var(--space-4);width:100%;min-height:52px;padding:var(--space-4) 0;border:0;border-bottom:1px solid var(--rule);background:transparent;text-align:left;transition:color var(--dur-fast) var(--ease)}
.list-result:hover{color:var(--orange-ink)}
.list-result strong{font-weight:600}
.prose p+p{margin-top:var(--space-3)}
.prose a{color:var(--ink);text-decoration-color:var(--orange);text-underline-offset:3px}

@media(prefers-reduced-motion:reduce){
  :root{scroll-behavior:auto}
  .card:hover{transform:none}
  .card:hover .card-action span{transform:none}
}

/* Tablet */
@media(max-width:960px){
  .hero{gap:var(--space-6)}
  .cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  .library-heading{align-items:start;flex-direction:column;gap:var(--space-3)}
  .library-heading p{max-width:30em}
  .card{padding-inline:var(--space-5)}
  .card-top:after{width:104px;height:85px;right:var(--space-4)}
  .motif{width:88px;height:72px;right:calc(var(--space-4) + 8px);top:calc(var(--space-5) + 6px)}
  .journal-inner{gap:var(--space-6)}
}

/* Phone */
@media(max-width:720px){
  .hero{grid-template-columns:1fr;gap:var(--space-5);padding-top:var(--space-7)}
  .hero h1{margin:var(--space-4) 0}
  .hero-actions{gap:var(--space-3) var(--space-5)}
  .specimen{width:min(100%,450px);justify-self:center;aspect-ratio:1.64}
  .brain{width:71%;left:15%;top:2%;height:88%}
  .specimen-caption,.callout{font-size:.625rem}
  .library-heading{display:block;margin-bottom:var(--space-6)}
  .library-heading p{max-width:none}
  .cards{grid-template-columns:1fr;gap:var(--space-4)}
  .card-top{height:92px}
  .card-top:after{width:100px;height:82px}
  .motif{width:86px;height:70px}
  .journal-inner{grid-template-columns:1fr;gap:var(--space-4)}
  .reading-page{padding-top:var(--space-7)}
  #panel-body{padding:var(--space-5)}
  .dialog-head{padding-inline:var(--space-4)}
}
