/* sletten.site — The Private Ledger | visual layer only */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
::selection { background: var(--accent); color: var(--on-accent); }
h1,h2,h3,h4,p,ul,ol,dl,dd,figure { margin: 0; }
ul,ol { padding: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; }
a,button,input,textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
button,input,textarea { font-family: inherit; }
#scene { position: fixed; inset: 0; width: 100%; height: 100vh; height: 100dvh; pointer-events: none; z-index: 0; opacity: .7; }
.nav,main,.footer { position: relative; z-index: 1; }
.wrap {
  width: 100%; max-width: var(--page-max); margin-inline: auto;
  padding-inline: max(1.5rem, env(safe-area-inset-left, 0px));
}
.icon, .icon svg { display: inline-flex; vertical-align: middle; }
.icon { line-height: 0; }
.skip-link {
  position: fixed; top: -6rem; left: 1rem; z-index: 100;
  padding: .75rem 1rem; background: var(--ink); color: var(--bg);
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* Navigation: an understated firm letterhead */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--rule);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.nav::before { content:""; display:block; height:3px; background:linear-gradient(90deg,var(--ink) 0 16%,var(--accent) 16% 28%,var(--rule) 28%); }
.nav-inner { min-height: 5rem; display: flex; align-items: center; gap: clamp(1rem, 2vw, 2rem); }
.brand { display:inline-flex; align-items:center; gap:.85rem; text-decoration:none; flex:none; }
.brand-symbol {
  display: grid; place-items: center; width: 2.65rem; height: 2.65rem;
  border: 1px solid var(--ink); color: var(--ink); font-family: var(--font-display);
  font-style: italic; font-size: 1.45rem; letter-spacing: -.09em; padding-right: .12rem;
  line-height: 1;
}
.brand-wordmark { display: flex; align-items:baseline; font-family:var(--font-display); font-size:1.35rem; font-weight:400; line-height:1; letter-spacing:-.01em; }
.brand-wordmark .brand-dot { color:var(--accent); }
.nav-links { margin-left:auto; display:flex; align-items:center; gap:clamp(1rem, 2.1vw, 2rem); }
.nav-links a {
  position:relative; padding: .5rem 0; color: var(--ink-soft);
  text-decoration: none; font-size:.8rem; font-weight: 600;
  letter-spacing:.025em; white-space:nowrap; transition:color .2s ease;
}
.nav-links a::after { content:""; position:absolute; left:0; right:100%; bottom:.12rem; height:1px; background:var(--accent); transition:right .2s ease; }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--ink); }
.nav-links a:hover::after { right:0; }
.theme-toggle {
  width:2.55rem; height:2.55rem; flex:none; border:1px solid var(--rule-strong);
  color:var(--ink); background:transparent; display:grid; place-items:center;
  cursor:pointer; transition:background .2s ease, border-color .2s ease;
}
.theme-toggle:hover { background:var(--bg-sunken); border-color:var(--ink-faint); }

/* Buttons and restrained micro-interactions */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:.65rem;
  min-height:3rem; padding:.84rem 1.2rem;
  border:1px solid transparent; border-radius:var(--radius-sm);
  text-decoration:none; font-size:.82rem; font-weight:600; letter-spacing:.015em;
  line-height:1.15; white-space:nowrap; cursor:pointer;
  transition:background .22s ease, color .22s ease, border-color .22s ease, transform .22s ease;
}
.btn svg { width:17px; height:17px; }
.btn:hover { transform:translateY(-2px); }
.btn-primary { background:var(--ink); color:var(--bg); border-color:var(--ink); }
.btn-primary:hover { background:var(--accent); border-color:var(--accent); color:var(--on-accent); }
.btn-primary:disabled { cursor:default; opacity:.6; transform:none; }
.btn-quiet { background:transparent; border-color:var(--rule-strong); color:var(--ink); }
.btn-quiet:hover { background:var(--bg-sunken); border-color:var(--ink-soft); }
.btn-small { padding:.62rem .85rem; min-height:2.5rem; }
.text-link { text-decoration:none; border-bottom:1px solid var(--accent); padding-bottom:2px; font-weight:600; }
.text-link:hover { color:var(--accent); }

/* Hero: editorial scale balanced by a framed, untouched headshot */
.hero { position:relative; overflow:hidden; padding-block:clamp(3.5rem, 6.5vw, 6rem) clamp(2.75rem, 4.5vw, 4rem); scroll-margin-top:5.5rem; }
.hero::before {
  content:""; position:absolute; width:min(60vw,860px); aspect-ratio:1; right:-25vw; top:-24rem;
  background:radial-gradient(circle,transparent 0 41%,color-mix(in srgb,var(--accent) 16%,transparent) 41.05% 41.16%,transparent 41.24% 56%,color-mix(in srgb,var(--accent) 12%,transparent) 56.05% 56.13%,transparent 56.2%);
  pointer-events:none;
}
.hero::after {
  content:""; position:absolute; width:1px; left:calc(50% - 1px); height:100%; top:0;
  background:linear-gradient(transparent,var(--rule) 30%,var(--rule) 70%,transparent);
  opacity:.25; pointer-events:none;
}
.hero-grid { position:relative; display:grid; grid-template-columns:minmax(0, 1.35fr) minmax(0, .84fr); gap:clamp(2.5rem, 6vw, 7rem); align-items:center; }
.hero-copy { min-width:0; display:flex; flex-direction:column; align-items:flex-start; gap:0; }
.hero-name {
  margin-top:0; max-width:8.1em; font:400 var(--text-hero)/.91 var(--font-display);
  letter-spacing:-.047em; text-wrap:balance; overflow-wrap:normal;
}
.hero-name::after { content:"."; color:var(--accent); }
.hero-headline {
  margin-top:2.05rem; max-width:35rem; font-size:clamp(1.03rem,1.35vw,1.24rem);
  font-weight:400; line-height:1.58; color:var(--ink-soft); text-wrap:pretty;
}
.hero-location {
  margin-top:1.45rem; display:flex; align-items:center; gap:.65rem;
  color:var(--ink-faint); font:500 .72rem var(--font-mono); letter-spacing:.025em;
}
.hero-location::before { content:""; display:block; width:8px; height:8px; border:1px solid var(--accent); border-radius:50%; box-shadow:inset 0 0 0 2px var(--bg); background:var(--accent); }
.hero-actions { display:flex; flex-wrap:wrap; gap:.7rem; margin-top:2.2rem; }
.hero-facts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); width:100%; margin-top:3rem; border-top:1px solid var(--rule-strong); }
.fact { display:flex; flex-direction:column; gap:.55rem; padding:1rem .95rem 0 0; min-width:0; }
.fact + .fact { border-left:1px solid var(--rule); padding-left:1.1rem; }
.fact dt { color:var(--ink-faint); font-size:.78rem; font-weight:500; line-height:1.45; }
.fact dd { font-size:.835rem; font-weight:600; line-height:1.45; color:var(--ink); }
.portrait {
  position:relative; width:100%; max-width:27rem; justify-self:end; min-height:0;
  aspect-ratio: .78; isolation:isolate; background:linear-gradient(140deg,var(--portrait-a),var(--portrait-b)); background:linear-gradient(140deg in oklch,var(--portrait-a),var(--portrait-b));
  border:1px solid color-mix(in srgb,var(--accent) 36%,var(--rule));
  box-shadow:var(--shadow-portrait);
}
.portrait::before { content:""; position:absolute; inset:-13px 13px 13px -13px; z-index:-1; border:1px solid var(--accent); opacity:.78; pointer-events:none; }
.portrait::after { content:""; position:absolute; inset:0; background:linear-gradient(180deg,transparent 72%,oklch(24.8% 0.033 250 / 0.46)); background:linear-gradient(180deg in oklch,oklch(24.8% 0.033 250 / 0) 72%,oklch(24.8% 0.033 250 / 0.46)); pointer-events:none; }
.portrait img { position:absolute; width:100%; height:100%; inset:0; object-fit:contain; object-position:center bottom; z-index:1; }

/* Letterpress-style section rails */
.section { padding-block:clamp(2.5rem,4.2vw,3.75rem) clamp(1.75rem,3vw,2.5rem); scroll-margin-top:5.5rem; }
.section-grid { display:grid; grid-template-columns:var(--label-col) minmax(0,1fr); gap:clamp(2rem,4vw,5.5rem); border-top:1px solid var(--rule-strong); padding-top:1.65rem; }
.section-title { align-self:start; position:sticky; top:7rem; font:400 clamp(1.85rem,2.65vw,2.5rem)/1.06 var(--font-display); letter-spacing:-.015em; }
.section-body { min-width:0; }
.prose { display:flex; flex-direction:column; gap:1.55rem; }
.prose p { max-width:53rem; color:var(--ink-soft); font-size:1.06rem; line-height:1.8; text-wrap:pretty; }
.prose p:first-child { color:var(--ink); font:400 clamp(1.5rem,2.3vw,2.2rem)/1.36 var(--font-display); letter-spacing:-.01em; }
.minor-heading { margin-bottom:.8rem; font-size:.86rem; font-weight:600; line-height:1.5; color:var(--accent); }
.note { color:var(--ink-faint); font-size:.76rem; line-height:1.65; }

/* Experience and education */
#experience-body,#education-body { display:flex; flex-direction:column; gap:0; }
.entry { position:relative; padding:1.5rem 0 1.8rem 1.4rem; display:flex; flex-direction:column; gap:1rem; border-left:1px solid var(--rule-strong); }
.entry:first-child { padding-top:.1rem; }
.entry::before { content:""; position:absolute; top:1.8rem; left:-4px; width:7px; height:7px; background:var(--accent); transform:rotate(45deg); }
.entry:first-child::before { top:.38rem; }
.entry + .entry { margin-top:1rem; }
.entry-head { display:flex; align-items:start; justify-content:space-between; flex-wrap:wrap; gap:.45rem 1.6rem; }
.entry-head > div { min-width:0; }
.entry-title { font-size:1.22rem; font-weight:600; letter-spacing:-.025em; line-height:1.3; }
.entry-org { margin-top:.2rem; font-size:.88rem; color:var(--ink-soft); }
.entry-dates { margin-top:.28rem; font:500 .69rem/1.55 var(--font-mono); color:var(--ink-faint); white-space:normal; }
.entry-list { display:flex; flex-direction:column; gap:.55rem; max-width:54rem; padding-left:1.05rem; }
.entry-list li { padding-left:.1rem; color:var(--ink-soft); font-size:.9rem; line-height:1.7; }
.entry-list li::marker { color:var(--accent); font-size:.7rem; }
.entry-line { color:var(--ink-soft); font-size:.93rem; }
.entry-line + .entry-line { margin-top:-.72rem; }
#education-body .entry { padding-bottom:1.75rem; }
.ledger { list-style:none; border-top:1px solid var(--rule); }
.ledger li { display:flex; justify-content:space-between; flex-wrap:wrap; gap:.2rem 1rem; border-bottom:1px solid var(--rule); padding:.9rem 0; }
.ledger-main { font-size:.88rem; font-weight:600; }
.ledger-side { font:500 .72rem/1.55 var(--font-mono); color:var(--ink-faint); }

/* Projects: an index of selected mandates */
#projects-body { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:stretch; gap:1rem; counter-reset:project; }
.project {
  position:relative; display:flex; flex-direction:column; align-items:stretch; gap:1.4rem;
  padding:clamp(1.45rem,2.8vw,2.4rem); min-width:0;
  background:var(--bg-raised); border:1px solid var(--rule);
  transition:transform .22s ease,border-color .22s ease,box-shadow .22s ease;
  counter-increment:project;
}
.project:hover { transform:translateY(-3px); border-color:var(--rule-strong); box-shadow:var(--shadow-card-hover); }
.project:first-child { grid-column:1 / -1; background:var(--bg-sunken); border-color:var(--rule-strong); }
.project::after { content:""; position:absolute; top:-1px; right:2.3rem; width:3rem; height:3px; background:var(--accent); }
.project-title { margin-bottom:.52rem; font:400 clamp(1.65rem,2.2vw,2.1rem)/1.12 var(--font-display); letter-spacing:-.016em; }
.project-summary { max-width:46rem; color:var(--ink-soft); font-size:.94rem; line-height:1.75; }
.project .entry-head { gap:.7rem 1.5rem; }
.project .entry-dates { align-self:start; }
.project .entry-list { gap:.62rem; }
.project .entry-list li { font-size:.86rem; }
.project:first-child .entry-list { columns:1; }
.solutions { border-top:1px solid var(--rule); padding-top:1.4rem; }
.solution-list { list-style:none; counter-reset:sol; display:flex; flex-direction:column; gap:1.05rem; margin-bottom:1rem; }
.solution-list li { counter-increment:sol; display:grid; grid-template-columns:1.45rem minmax(0,1fr); gap:.15rem .7rem; }
.solution-list li::before { content:"0" counter(sol); grid-row:1 / span 2; color:var(--accent); font:500 .68rem var(--font-mono); padding-top:.25rem; }
.solution-list strong { font-size:.86rem; line-height:1.5; }
.solution-list span { color:var(--ink-soft); font-size:.85rem; line-height:1.65; }
.tags { display:flex; flex-wrap:wrap; gap:.45rem; margin-top:auto; padding-top:.3rem; }
.tags span { padding:.26rem .6rem; border:1px solid var(--rule-strong); color:var(--ink-soft); font:500 .66rem/1.4 var(--font-mono); }

/* Skills: compact three-column register */
.skills { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1.5rem; }
.skill-group { min-width:0; }
.skill-group .minor-heading { padding-bottom:.9rem; margin-bottom:0; border-bottom:2px solid var(--accent); }
.skill-group ul { list-style:none; }
.skill-group li { display:flex; align-items:start; gap:.55rem; padding:.76rem 0; border-bottom:1px solid var(--rule); font-size:.83rem; color:var(--ink-soft); line-height:1.5; }
.skill-group li::before { content:""; flex:none; width:4px; height:4px; margin-top:.55rem; background:var(--accent); }

/* Certifications: issuer under the name, date on the right */
.cert-list .ledger-main { display:flex; flex-direction:column; gap:.15rem; }
.cert-name { font-size:.95rem; font-weight:600; color:var(--ink); }
.cert-issuer { font-size:.82rem; font-weight:400; color:var(--ink-soft); }
.cert-list li { align-items:baseline; padding:1.05rem 0; }

/* Coverage: a dedicated research slate, editorial not dashboard-heavy */
.section-coverage { background:var(--cov-bg); color:var(--cov-ink); padding-block:clamp(3rem,5vw,4.5rem); overflow:hidden; }
.section-coverage .wrap { position:relative; }
.section-coverage .wrap::before { content:""; position:absolute; width:29rem; height:29rem; top:-18rem; right:-10rem; border:1px solid var(--cov-rule); border-radius:50%; pointer-events:none; }
.coverage-head { display:grid; grid-template-columns:var(--label-col) minmax(0,1fr); gap:clamp(2rem,4vw,5.5rem); padding-top:1.65rem; margin-bottom:2.5rem; border-top:1px solid var(--cov-rule); }
.coverage-head .section-title { position:static; }
.coverage-intro { max-width:45rem; color:var(--cov-soft); font-size:1.06rem; line-height:1.75; }
.coverage-panel { --cov-cols:minmax(9.8rem,1.35fr) minmax(4.8rem,.58fr) minmax(4.8rem,.58fr) minmax(5rem,.62fr) minmax(6.25rem,.78fr) minmax(9.5rem,1.15fr) 1.2rem;
  border:1px solid var(--cov-rule); background:var(--cov-surface); }
.cov-header { display:grid; grid-template-columns:var(--cov-cols); column-gap:1.1rem; align-items:center; padding:1.15rem 1.25rem; color:var(--cov-muted); background:var(--cov-bg); font-size:.82rem; font-weight:500; line-height:1.4; }
.right { text-align:right; }
.cov-legend { display:flex; align-items:center; gap:.35rem .9rem; flex-wrap:wrap; }
.cov-legend > span { display:inline-flex; gap:.32rem; align-items:center; white-space:nowrap; }
.cov-legend-mobile { display:none; margin-top:1rem; font:500 .7rem var(--font-mono); color:var(--cov-muted); }
.key { display:inline-block; flex:none; }
.key-band { width:14px; height:5px; background:oklch(65.2% 0.050 250); }
.key-target { width:2px; height:11px; background:oklch(78.5% 0.075 238); }
.key-price { width:8px; height:8px; background:var(--cov-ink); border-radius:50%; }
.cov + .cov { border-top:1px solid var(--cov-rule); }
.cov-row {
  list-style:none; display:grid; grid-template-columns:var(--cov-cols); column-gap:1.1rem; align-items:center;
  padding:1.35rem 1.25rem; cursor:pointer; transition:background .17s ease;
}
.cov-row::-webkit-details-marker { display:none; }
.cov-row::marker { content:""; }
.cov-row:hover { background:var(--cov-raised); }
.cov-row:focus-visible { outline:2px solid oklch(79.3% 0.075 238); outline-offset:-4px; }
.cov[open] > .cov-row { background:var(--cov-raised); }
.cov-cell { min-width:0; }
.cov-name { display:flex; flex-direction:column; gap:.28rem; padding-left:.7rem; border-left:2px solid oklch(78.5% 0.075 238); }
.ticker { font:600 1.3rem/1.12 var(--font-body); color:var(--cov-ink); }
.company { color:var(--cov-soft); font-size:.84rem; line-height:1.4; }
.cell-label { display:none; color:var(--cov-muted); font-size:.72rem; }
.cov-price,.cov-target,.cov-delta { text-align:right; }
.num { white-space:nowrap; font:500 .95rem/1.4 var(--font-mono); font-variant-numeric:tabular-nums; color:var(--cov-ink); }
.cov-price .num { font-weight:600; }
.cov-target .num { color:var(--accent-on-dark, oklch(82% 0.07 238)); font-weight:600; }
.delta { font-weight:600; }
.delta.is-up { color:var(--cov-up); }
.delta.is-down { color:var(--cov-down); }
.delta.is-flat { color:var(--cov-flat); }
.tag { display:inline-flex; align-items:center; gap:.38rem; min-height:1.65rem; padding:.24rem .51rem; border:1px solid transparent; font:600 .8rem/1.25 var(--font-body); white-space:nowrap; }
.tag.is-up { color:var(--cov-up); background:oklch(35.9% 0.064 160); border-color:oklch(46.5% 0.073 160); }
.tag.is-down { color:var(--cov-down); background:oklch(36.2% 0.052 30); border-color:oklch(45.5% 0.071 31); }
.tag.is-flat { color:var(--cov-flat); background:oklch(36.1% 0.027 250); border-color:oklch(49.9% 0.036 250); }
.range { padding-top:.2rem; }
.range-track { position:relative; height:15px; border-bottom:1px solid var(--cov-rule); }
.range-band { position:absolute; top:5px; height:5px; background:oklch(64.7% 0.045 245); border-radius:0; }
.range-target { position:absolute; top:1px; width:3px; height:14px; background:oklch(78.5% 0.075 238); transform:translateX(-50%); }
.range-price { position:absolute; top:2px; width:12px; height:12px; border:2px solid var(--cov-surface); border-radius:50%; background:var(--cov-ink); transform:translateX(-50%); }
.range-labels { position:relative; height:1.15rem; margin-top:4px; }
.range-label { position:absolute; top:0; white-space:nowrap; font:500 .72rem var(--font-mono); color:var(--cov-muted); }
.range-label-high { transform:translateX(-100%); }
.cov-chevron { justify-self:end; line-height:0; color:var(--cov-muted); }
.cov-chevron .icon { transition:transform .22s ease; }
.cov[open] .cov-chevron .icon { transform:rotate(180deg); }
.cov-note { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:clamp(1.5rem,4vw,4rem); border-top:1px solid var(--cov-rule); padding:1.8rem 2rem 2.4rem; background:var(--cov-bg); }
.note-col { display:flex; flex-direction:column; gap:1.75rem; min-width:0; }
.cov-note .minor-heading { color:oklch(79.4% 0.075 238); margin-bottom:.5rem; }
.note-block p,.note-block li { color:var(--cov-soft); font-size:.92rem; line-height:1.75; }
.note-block ul { padding-left:1.1rem; display:flex; flex-direction:column; gap:.45rem; }
.note-block li::marker { color:oklch(79.4% 0.075 238); }
.cov-note .note { color:var(--cov-muted); }
.quote-status { display:flex; align-items:center; gap:.7rem; margin-top:1.25rem; color:var(--cov-soft); font:500 .72rem/1.6 var(--font-mono); }
.quote-status::before { content:""; flex:none; width:7px; height:7px; border-radius:50%; background:oklch(66.4% 0.025 250); }
.quote-status.is-live::before { background:var(--cov-up); box-shadow:0 0 0 3px oklch(84.7% 0.119 155 / 0.15); }
.disclaimer { max-width:65rem; margin-top:.9rem; color:var(--cov-muted); font-size:.75rem; line-height:1.65; }

/* Interests: designed icon stamps */
.interests { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:.9rem; list-style:none; }
.interest { display:flex; flex-direction:column; align-items:flex-start; justify-content:space-between; gap:1.45rem; min-width:0; min-height:9.5rem; padding:1.35rem;
  border:1px solid var(--rule); background:color-mix(in srgb,var(--bg-raised) 72%,transparent);
  transition:background .2s ease,border-color .2s ease,transform .2s ease;
}
.interest:hover { background:var(--bg-sunken); border-color:var(--rule-strong); transform:translateY(-2px); }
.interest-icon { color:var(--ink); }
.interest-icon svg { width:2.05rem; height:2.05rem; }
.interest-label { color:var(--ink-soft); font-size:.8rem; font-weight:600; line-height:1.4; }

/* Contact: two-column correspondence desk */
#contact { padding-bottom:clamp(3.5rem,6vw,5rem); }
.contact { display:grid; grid-template-columns:minmax(0,.88fr) minmax(0,1.12fr); gap:clamp(2rem,5vw,5rem); }
.contact-direct { display:flex; flex-direction:column; align-items:start; gap:1.25rem; min-width:0; }
.contact-direct > p:first-child { color:var(--ink-soft); font-size:1.03rem; line-height:1.8; max-width:20rem; }
.contact-email { max-width:100%; }
.contact-email a { display:inline-block; max-width:100%; border-bottom:1px solid var(--accent); font:400 clamp(1.6rem,2.7vw,2.6rem)/1.24 var(--font-display); text-decoration:none; overflow-wrap:anywhere; }
.contact-email a:hover { color:var(--accent); }
.contact-tools { display:flex; align-items:center; gap:.9rem; flex-wrap:wrap; }
.copy-note { color:var(--ink-soft); font-size:.75rem; }
.contact-form { display:flex; flex-direction:column; gap:1.15rem; min-width:0; padding:clamp(1.35rem,2.7vw,2.45rem); border:1px solid var(--rule); background:var(--bg-raised); box-shadow:var(--shadow-card); }
.field { display:flex; flex-direction:column; gap:.45rem; }
.field label { color:var(--ink-soft); font:600 .72rem var(--font-mono); letter-spacing:.015em; }
.field input,.field textarea { width:100%; background:var(--bg); color:var(--ink); border:1px solid var(--rule-strong); border-radius:0; padding:.82rem .9rem; font-size:.9rem; line-height:1.45; outline:none; transition:border-color .2s ease,box-shadow .2s ease; }
.field input:focus,.field textarea:focus { border-color:var(--accent); box-shadow:inset 0 -1px var(--accent); }
.field input:focus-visible,.field textarea:focus-visible { outline:2px solid var(--focus); outline-offset:1px; }
.field textarea { resize:vertical; min-height:9rem; }
.field-trap { position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden; }
.form-foot { display:flex; align-items:center; gap:1rem; flex-wrap:wrap; }
.form-status { font-size:.78rem; color:var(--ink-soft); }
.form-status.is-ok { color:var(--up); }
.form-status.is-error { color:var(--down); }

/* Footer */
.footer { border-top:1px solid var(--rule-strong); background:color-mix(in srgb,var(--bg-sunken) 50%,var(--bg)); }
.footer-inner { padding-block:2rem; display:flex; align-items:center; justify-content:space-between; gap:1rem 2rem; flex-wrap:wrap; color:var(--ink-faint); font-size:.77rem; }
.footer-inner a { font-size:.79rem; }

@media (min-width:64rem) {
  .wrap { padding-inline:max(3.3rem, env(safe-area-inset-left, 0px)); }
}
@media (max-width:80rem) {
  .hero-name { font-size:clamp(4.35rem,8vw,7rem); }
  .hero-grid { gap:3rem; }
  .hero-facts { margin-top:2.4rem; }
}
@media (max-width:70rem) {
  .section-grid,.coverage-head { grid-template-columns:9rem minmax(0,1fr); gap:2rem; }
  .section-title { position:static; }
  .cov-header { display:none; }
  .cov-legend-mobile { display:flex; }
  .cov-row { grid-template-columns:minmax(0,1.5fr) repeat(3,minmax(0,.75fr)) auto; column-gap:1rem; row-gap:1.2rem; grid-template-areas:"name price target delta chev" "tag range range range range"; }
  .cov-name { grid-area:name; }
  .cov-price { grid-area:price; }
  .cov-target { grid-area:target; }
  .cov-delta { grid-area:delta; }
  .cov-tag { grid-area:tag; }
  .cov-range { grid-area:range; }
  .cov-chevron { grid-area:chev; }
  .cov-price,.cov-target,.cov-delta { display:flex; flex-direction:column; align-items:start; gap:.15rem; text-align:left; }
  .cell-label { display:block; }
  .hero-facts { grid-template-columns:1fr; border-bottom:1px solid var(--rule); }
  .fact { padding:.6rem 0; flex-direction:row; justify-content:space-between; align-items:baseline; gap:1.2rem; }
  .fact + .fact { padding-left:0; border-left:0; border-top:1px solid var(--rule); }
  .fact dt { width:6.7rem; flex:none; }
  .fact dd { flex:1; }
}
@media (max-width:54rem) {
  .nav-links { gap:1rem; }
  .nav-wide { display:none; }
  .hero { padding-block:3.25rem 3rem; }
  .hero-grid { grid-template-columns:minmax(0,1fr) minmax(0,.65fr); gap:2.15rem; }
  .hero-name { font-size:clamp(3.65rem,8vw,5.1rem); }
  .hero-headline { margin-top:1.55rem; font-size:1rem; }
  .hero-actions { margin-top:1.55rem; }
  .hero-actions .btn { min-height:2.75rem; padding:.7rem .84rem; font-size:.76rem; }
      .section { padding-block:2.5rem 1.75rem; }
  .section-grid,.coverage-head { grid-template-columns:1fr; gap:1.75rem; }
  .section-title { font-size:2.2rem; }
  .skills { gap:1.3rem; }
  .interests { grid-template-columns:repeat(5,minmax(0,1fr)); }
  .interest { padding:1rem; min-height:8rem; }
  .interest-label { font-size:.71rem; }
  .contact { gap:2rem; }
}
@media (max-width:44rem) {
  .wrap { padding-inline:max(1.35rem, env(safe-area-inset-left, 0px)); }
  .nav-inner { min-height:4.25rem; gap:.75rem; }
  .brand { gap:.5rem; }
  .brand-symbol { width:2.25rem; height:2.25rem; font-size:1.2rem; }
  .brand-wordmark { font-size:1.15rem; }
  .nav-links { gap:.85rem; }
  .nav-links a { font-size:.73rem; }
  .theme-toggle { width:2.3rem; height:2.3rem; }
  .hero { padding-block:2.5rem 2.75rem; }
  .hero::after { display:none; }
  .hero-grid { display:flex; flex-direction:column; align-items:stretch; gap:0; }
  .hero-copy { display:contents; }
    .hero-name { order:2; }
  .hero-headline { order:3; }
  .hero-location { order:4; }
  .hero-actions { order:5; }
  .portrait { order:6; margin-top:2.9rem; }
  .hero-facts { order:7; margin-top:2.75rem; }
    .hero-name { font-size:clamp(4rem,12.7vw,5.8rem); margin-top:1.15rem; max-width:8em; }
  .hero-headline { max-width:34rem; margin-top:1.35rem; font-size:1rem; }
  .hero-location { margin-top:1.2rem; }
  .hero-actions { display:grid; width:100%; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.55rem; margin-top:1.65rem; }
  .hero-actions .btn:first-child { grid-column:1/-1; }
  .hero-actions .btn { padding:.7rem .78rem; }
  .hero-facts { margin-top:2.5rem; }
  .portrait { max-width:24rem; width:calc(100% - 12px); justify-self:center; aspect-ratio:.92; }
  .portrait::before { inset:-8px 8px 8px -8px; }
  .portrait img { object-fit:contain; }
      .section { padding-block:2.25rem 1.5rem; }
  .section-grid { padding-top:1.35rem; gap:1.4rem; }
  .prose p:first-child { font-size:1.6rem; }
  .prose p { font-size:.94rem; }
  .entry-head { gap:.3rem .7rem; }
  .entry-dates { font-size:.65rem; }
  #projects-body { grid-template-columns:1fr; }
  .project:first-child { grid-column:auto; }
  .project { padding:1.45rem; gap:1.25rem; }
  .skills { grid-template-columns:1fr; gap:2rem; }
  .interests { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .interest { min-height:8.65rem; gap:1rem; padding:1.2rem; }
  .interest-icon svg { width:2.15rem; height:2.15rem; }
  .interest-label { font-size:.85rem; }
  .coverage-head { padding-top:1.35rem; margin-bottom:1.6rem; }
  .coverage-intro { font-size:.96rem; }
  .cov-row { grid-template-columns:repeat(3,minmax(0,1fr)) 1.15rem; grid-template-areas:"name name tag chev" "price target delta delta" "range range range range"; column-gap:.55rem; row-gap:1.05rem; padding:1.35rem 1rem; }
  .cov-name { grid-area:name; }
  .cov-tag { grid-area:tag; align-self:start; justify-self:end; }
  .cov-chevron { grid-area:chev; }
  .cov-price { grid-area:price; }
  .cov-target { grid-area:target; }
  .cov-delta { grid-area:delta; }
  .cov-range { grid-area:range; }
  .cov-name { padding-left:.55rem; }
  .company { font-size:.8rem; }
  .ticker { font-size:1.22rem; }
  .tag { padding:.24rem .45rem; gap:.28rem; font-size:.74rem; }
  .tag svg { width:8px; height:8px; }
  .num { font-size:.92rem; }
  .cov-note { grid-template-columns:1fr; gap:1.4rem; padding:1.5rem 1rem; }
  .contact { grid-template-columns:1fr; }
  .contact-form { padding:1.35rem; }
  .footer-inner { gap:.9rem; }
  }
@media (max-width:385px) {
  .nav-links { gap:.7rem; }
  .hero-name { font-size:3.9rem; }
  .hero-actions .btn { font-size:.72rem; padding:.72rem .72rem; }
  .hero-actions .btn svg { width:14px; height:14px; }
  .cov-row { padding-inline:.75rem; column-gap:.35rem; }
  .num { font-size:.86rem; }
  .tag { font-size:.7rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior:auto; }
  *, *::before, *::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
}

/* ---------- Refinements ---------- */

/* Nested corners: cards use --radius-card. Anything inside a card uses the card radius
   minus the card padding. Card padding is never under 1.2rem, so inner corners settle
   on the small floor instead of matching the outer curve. */
.project, .contact-form, .interest, .coverage-panel { border-radius:var(--radius-card); }
.coverage-panel { overflow:hidden; }
.project, .contact-form, .interest, .cov-row { --radius-inner:max(var(--radius-floor), calc(var(--radius-card) - 1.2rem)); }
.project .tags span, .contact-form .btn, .field input, .field textarea, .cov-row .tag { border-radius:var(--radius-inner); }

/* Dark mode depth: lighter surfaces plus a faint top edge instead of shadows */
.project, .contact-form, .interest { box-shadow:var(--shadow-card), inset 0 1px 0 var(--surface-edge); }
.project:hover { box-shadow:var(--shadow-card-hover), inset 0 1px 0 var(--surface-edge); }
:root[data-theme="dark"] .project:hover, :root[data-theme="dark"] .interest:hover { background:color-mix(in oklch, var(--bg-raised), white 4%); }

/* Icon strokes match the weight of the text beside them */
.btn svg, .theme-toggle svg, .contact-tools svg { stroke-width:2.2; }
.cov-chevron svg { stroke-width:2.2; }

/* Theme icon swap: a short blur-in instead of a hard cut */
.theme-toggle svg { animation:icon-swap .32s cubic-bezier(.2,.7,.2,1); }
@keyframes icon-swap {
  from { opacity:0; filter:blur(4px); transform:scale(.7) rotate(-35deg); }
  to { opacity:1; filter:blur(0); transform:none; }
}
@media (prefers-reduced-motion: reduce) { .theme-toggle svg { animation:none; } }

/* An odd project left over at the end spans the full row instead of sitting alone in half of it */
#projects-body .project:nth-child(even):last-child { grid-column:1 / -1; }
