/* Shared identity for the personal folio and Torus. No inherited preview styles. */
@font-face { font-family: Roboto; font-style: normal; font-weight: 400 900; font-display: swap; src: url('../assets/fonts/Roboto-Variable.woff2') format('woff2'); }
@font-face { font-family: 'Ibarra Real Nova'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('../assets/fonts/IbarraRealNova-Variable.woff2') format('woff2'); }
@font-face { font-family: 'Ibarra Real Nova'; font-style: italic; font-weight: 400 700; font-display: swap; src: url('../assets/fonts/IbarraRealNova-Italic-Variable.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible Next'; font-style: normal; font-weight: 200 800; font-display: swap; src: url('../assets/fonts/AtkinsonHyperlegibleNext-Variable.woff2') format('woff2'); }

:root {
  color-scheme: light;
  --paper: #f5f0e5;
  --surface: #fbf8f1;
  --ink: #172b4b;
  --muted: #62676b;
  --line: #d8d4c9;
  --wash: #e9e5da;
  --blue-wash: #e5e9ec;
  --sage-wash: #e6e8dd;
  --accent: #294579;
  --body: Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  --display: 'Ibarra Real Nova', Georgia, serif;
  --width: 1120px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 28px;
  --scale: 1;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #152133;
  --surface: #1c2a3e;
  --ink: #f4efe4;
  --muted: #b6bec8;
  --line: #3c4859;
  --wash: #233147;
  --blue-wash: #26364e;
  --sage-wash: #293b3c;
  --accent: #adc8ff;
}
:root[data-contrast='bw'] { color-scheme: light; --paper: #fff; --surface: #fff; --ink: #000; --muted: #222; --line: #000; --accent: #0000c8; --wash: #fff; --blue-wash: #fff; --sage-wash: #fff; }
:root[data-contrast='wb'] { color-scheme: dark; --paper: #000; --surface: #000; --ink: #fff; --muted: #eee; --line: #fff; --accent: #8fd0ff; --wash: #000; --blue-wash: #000; --sage-wash: #000; }
:root[data-contrast='yb'] { color-scheme: dark; --paper: #001487; --surface: #001487; --ink: #ff0; --muted: #ff0; --line: #ff0; --accent: #fff; --wash: #001487; --blue-wash: #001487; --sage-wash: #001487; }
:root[data-font='readable'] { --body: 'Atkinson Hyperlegible Next', Verdana, sans-serif; --display: 'Atkinson Hyperlegible Next', Verdana, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
:where(main, header, footer) :where(div, section, article, header, footer, figure, h1, h2, h3, p, ul, ol, li, nav, strong) { min-width: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 28px; scrollbar-gutter: stable; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: calc(16px * var(--scale)); line-height: 1.7; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button, summary, select { cursor: pointer; }
button { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, figure, ul, ol { margin: 0; }
p { color: var(--muted); }
h1, h2, h3 { overflow-wrap: anywhere; text-wrap: balance; }
h1 { font-weight: 750; font-size: calc(clamp(44px, 6.6vw, 84px) * var(--scale)); line-height: 1.03; letter-spacing: -0.055em; }
h2 { font-family: var(--display); font-size: calc(clamp(34px, 4.2vw, 52px) * var(--scale)); font-weight: 400; line-height: 1.12; letter-spacing: -0.035em; }
h3 { font-size: calc(20px * var(--scale)); font-weight: 600; line-height: 1.3; letter-spacing: -0.025em; }
h1 em, h2 em, .serif { font-family: var(--display); font-weight: 400; }
h1 em, h2 em { letter-spacing: -0.035em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
::selection { background: var(--ink); color: var(--paper); }
.wrap { width: min(var(--width), calc(100% - 2 * var(--gutter))); margin-inline: auto; }
.section { margin-block: clamp(64px, 8vw, 112px); }
.section-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.section-heading > div { display: grid; gap: 10px; }
.kicker { color: var(--muted); font-size: calc(13px * var(--scale)); line-height: 1.6; font-weight: 500; text-transform: uppercase; letter-spacing: 0.13em; }
.lead { font-size: calc(clamp(20px, 2.1vw, 25px) * var(--scale)); line-height: 1.5; letter-spacing: -0.02em; }
.small { font-size: calc(15px * var(--scale)); line-height: 1.6; }
.stack { display: grid; gap: 20px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.link { display: inline-flex; align-items: baseline; gap: 12px; padding-block: 7px; font-size: calc(14px * var(--scale)); font-weight: 500; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 5px; overflow-wrap: anywhere; }
.link:hover { text-decoration-color: currentColor; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 18px; min-height: 46px; padding: 12px 24px; border: 1px solid var(--ink); border-radius: 999px; background: var(--ink); color: var(--paper); font-size: calc(14px * var(--scale)); font-weight: 500; line-height: 1.45; text-align: center; }
.button:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); }
.button--quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.button--quiet:hover:not(:disabled) { background: var(--wash); border-color: var(--line); }
.button:disabled { cursor: not-allowed; opacity: 0.6; }
.pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; color: var(--muted); font-size: calc(13px * var(--scale)); }

/* A non-sticky header: the page feels like a folio, not an application dashboard. */
.site-header { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 32px; align-items: center; padding-block: 32px; }
.brand-lockup { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark { display: grid; place-items: center; flex: none; width: 54px; height: 54px; border-radius: 18px; background: var(--ink); color: var(--paper); font-size: 28px; font-weight: 750; letter-spacing: -0.08em; }
.brand-name { display: grid; font-size: calc(19px * var(--scale)); font-weight: 600; line-height: 1.5; letter-spacing: -0.01em; }
.brand-name span { font-size: calc(15px * var(--scale)); color: var(--muted); font-weight: 400; }
.main-nav { display: flex; flex-wrap: wrap; justify-content: end; align-items: center; gap: 12px 34px; min-width: 0; }
.main-nav a { padding-block: 8px; color: color-mix(in srgb, var(--ink) 82%, var(--paper)); font-size: calc(20px * var(--scale)); font-weight: 500; line-height: 1.4; }
.main-nav a:hover, .main-nav a[aria-current] { color: var(--ink); }
.main-nav a[aria-current] { text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--line); }
.main-nav .nav-product { color: var(--ink); }
.site-tools { display: flex; align-items: center; gap: 3px; }
.control { min-width: 50px; height: 50px; padding: 6px; border: 1px solid transparent; border-radius: 50%; background: transparent; font-size: calc(21px * var(--scale)); line-height: 1; }
.control:hover { background: var(--wash); }
.menu-toggle { display: none; width: auto; padding-inline: 16px; border-radius: 999px; font-size: calc(18px * var(--scale)); }
.js-only { display: none; }
.is-enhanced .js-only { display: inline-flex; align-items: center; justify-content: center; }
.is-enhanced .menu-toggle { display: none; }

/* Native dialogs provide keyboard focus containment and Escape dismissal. */
dialog { border: 1px solid var(--line); border-radius: 24px; background: var(--surface); color: var(--ink); padding: 28px; max-width: calc(100% - 32px); max-height: calc(100dvh - 32px); overflow: auto; }
dialog::backdrop { background: rgb(13 26 45 / 45%); backdrop-filter: blur(4px); }
.preferences { width: 390px; }
.dialog-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.dialog-title h2 { font-family: var(--body); font-size: calc(21px * var(--scale)); font-weight: 650; }
.dialog-title form { margin: 0; }
.preference-row { display: grid; gap: 8px; padding-block: 16px; border-top: 1px solid var(--line); }
.preference-row select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--paper); }
.preference-row--check { display: flex; align-items: center; gap: 12px; }
.preference-row input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.size-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.size-controls button { min-width: 48px; min-height: 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.size-controls button:disabled { opacity: 0.4; cursor: not-allowed; }
.preferences > .button { width: 100%; margin-top: 16px; }
.image-viewer { width: min(1440px, calc(100% - 32px)); padding: 16px; }
.image-viewer .dialog-title { margin-bottom: 12px; }
.image-viewer img { max-height: calc(100dvh - 160px); margin: auto; object-fit: contain; border-radius: 12px; }
.image-viewer p { font-size: calc(15px * var(--scale)); }

/* Quiet shared footers and readable document pages. */
.site-footer { margin-top: 80px; padding-block: 28px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.site-footer p, .site-footer a { font-size: calc(14px * var(--scale)); }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.footer-links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.page-intro { padding-block: 60px 52px; display: grid; gap: 24px; max-width: 800px; }
.page-intro .lead { max-width: 42ch; }
.prose { max-width: 68ch; overflow-wrap: anywhere; }
.prose h2 { margin-block: 48px 18px; font-size: calc(34px * var(--scale)); }
.prose h3 { margin-block: 32px 12px; }
.prose p + p { margin-top: 20px; }
.prose p, .prose li { line-height: 1.85; }
.prose ul, .prose ol { padding-left: 22px; margin-block: 20px; color: var(--muted); }
.prose li + li { margin-top: 12px; }
.prose a { text-decoration: underline; text-underline-offset: 4px; }
.prose code { font-size: 0.9em; }
.notice { padding: 24px 28px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.notice p { color: var(--ink); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; gap: 24px; padding-block: 22px; font-weight: 500; list-style: none; line-height: 1.5; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; flex: none; font-weight: 400; }
.faq details[open] summary::after { content: '−'; }
.faq details p { padding-bottom: 24px; max-width: 66ch; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 100; transform: translateY(-180%); padding: 12px 20px; border-radius: 999px; background: var(--ink); color: var(--paper); }
.skip-link:focus { transform: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
:root[data-contrast] .button { border-color: var(--ink); }
:root[data-contrast] .notice { border-color: var(--ink); }
:root[data-font='readable'] h1 em, :root[data-font='readable'] h2 em { font-style: normal; }

@media (max-width: 940px) {
  .site-header { gap: 20px; }
  .brand-name { display: none; }
  .main-nav { gap: 12px 20px; }
  .main-nav a { font-size: calc(18px * var(--scale)); }
  .site-tools { gap: 0; }
}
@media (max-width: 640px) {
  .site-header { grid-template-columns: minmax(0, 1fr) auto; padding-block: 24px; gap: 16px; }
  .brand-name { display: grid; font-size: calc(18px * var(--scale)); }
  .brand-name span { display: none; }
  .brand-mark { width: 48px; height: 48px; font-size: 24px; }
  .control { min-width: 44px; height: 44px; }
  .site-tools { grid-column: 2; grid-row: 1; }
  .main-nav { grid-column: 1 / -1; justify-content: start; gap: 12px 24px; }
  .is-enhanced .menu-toggle { display: inline-flex; }
  .is-enhanced .main-nav { display: none; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
  .is-enhanced .main-nav.is-open { display: flex; }
  .page-intro { padding-block: 40px; }
  .section-heading { align-items: start; }
  .site-footer { align-items: start; flex-direction: column; margin-top: 64px; }
}
@media (max-width: 380px) {
  .brand-name { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  :root { --paper: #fff; --surface: #fff; --ink: #000; --muted: #333; --line: #ccc; --scale: 1; }
  body { font-size: 10pt; }
  .site-header, .site-footer, .js-only, dialog, .skip-link { display: none !important; }
  .wrap { width: 100%; }
  h1 { font-size: 32pt; }
  h2 { font-size: 20pt; }
  .section, .page-intro { margin-block: 24px; padding-block: 0; }
  a { text-decoration: none; }
}
