/* ============================================================
   dennisvivas.com — design system
   Ported from the approved Claude Design export (terminal /
   JetBrains Mono aesthetic). Dark + light themes, governed by
   html[data-theme]. Default theme is light.
   ============================================================ */

/* — JetBrains Mono (variable, self-hosted; latin + latin-ext) — */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* — Theme tokens — */
:root {
  --bg: #F6F3EB; --text: #0E0E0E;
  --muted: rgba(14,14,14,0.6); --muted-2: rgba(14,14,14,0.58); --faint: rgba(14,14,14,0.28);
  --accent: #2447E0; --sel-bg: #2447E0; --sel-text: #F6F3EB;
}
html[data-theme="dark"] {
  --bg: #0E0E0E; --text: #F6F3EB;
  --muted: rgba(246,243,235,0.64); --muted-2: rgba(246,243,235,0.5); --faint: rgba(246,243,235,0.3);
  --accent: #8AA0FF; --sel-bg: #8AA0FF; --sel-text: #0E0E0E;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { background: var(--bg); }
::selection { background: var(--sel-bg); color: var(--sel-text); }
html, body, main { transition: background-color 0.25s ease, color 0.25s ease; }

main {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  -webkit-font-smoothing: antialiased;
  padding: 96px 28px 120px;
  display: flex;
  justify-content: flex-start;
}
.wrap { width: 100%; max-width: 660px; margin: 0 auto; }

/* — Top bar — */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 72px; }
.term-label { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2); }
.topbar-right { display: flex; align-items: center; gap: 18px; }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  background: none; border: 1px solid var(--faint); border-radius: 8px;
  color: var(--muted); cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.theme-toggle:hover, .theme-toggle:focus-visible { color: var(--accent); border-color: var(--accent); }
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: inline-flex; }

.lang-group { display: flex; align-items: center; gap: 2px; font-size: 12px; letter-spacing: 0.08em; }
.lang {
  font-family: inherit; font-size: 12px; letter-spacing: 0.08em;
  padding: 4px 6px; border-radius: 6px; text-decoration: none;
  color: var(--muted-2); font-weight: 400;
}
.lang:hover, .lang:focus-visible { color: var(--accent); }
.lang-active { color: var(--accent); font-weight: 700; }
.lang-sep { color: var(--faint); }

/* — Masthead — */
.masthead { font-size: 42px; line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 14px; }
.dvz-cursor {
  display: inline-block; width: 0.5em; margin-left: 0.08em; color: var(--accent);
  animation: dvz-blink 1.1s steps(1) infinite;
}
@keyframes dvz-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.role { font-size: 15px; line-height: 1.5; color: var(--muted); margin: 0 0 40px; max-width: 52ch; }

/* — Bio (expand/collapse is progressive enhancement) — */
.bio { font-size: 16px; line-height: 1.75; color: var(--text); margin: 0; max-width: 62ch; text-wrap: pretty; }
.bio-gap { display: block; height: 18px; }
.bio-toggle {
  color: var(--accent); text-decoration: none; cursor: pointer; white-space: nowrap;
  border-bottom: 1px solid transparent;
}
.bio-toggle:hover, .bio-toggle:focus-visible { border-bottom: 1px solid var(--accent); }
/* No-JS: full bio visible, toggle hidden. With JS: collapsible. */
.bio-toggle { display: none; }
html.js .bio-toggle { display: inline; }
html.js .bio-rest { display: none; }
html.js .bio-rest.show { display: inline; }

/* — Sections — */
.section { margin-top: 64px; }
.sec-label {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted-2); margin: 0 0 8px;
}
.rule { height: 1px; background: var(--faint); max-width: 62ch; margin: 0 0 28px; }
.sub { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); margin: 22px 0 14px; font-weight: 400; }

.item { margin-bottom: 20px; max-width: 62ch; }
.item-line { font-size: 16px; line-height: 1.55; }
.link { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; }
.link:hover, .link:focus-visible { border-bottom: 1px solid var(--accent); }
.accent { color: var(--accent); }
.meta { color: var(--muted-2); margin-left: 8px; font-size: 13px; }
.desc { margin: 6px 0 0; font-size: 14px; line-height: 1.6; color: var(--muted); text-wrap: pretty; }

/* — Footer — */
.site-footer { margin-top: 84px; padding-top: 26px; border-top: 1px solid var(--faint); max-width: 62ch; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; font-size: 13px; line-height: 1.7; }
.faint { color: var(--faint); }

/* — Accessibility — */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--sel-text);
  padding: 8px 14px; border-radius: 0 0 8px 0; font-size: 13px; z-index: 100;
}
.skip-link:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  .dvz-cursor { animation: none !important; }
  html, body, main { transition: none !important; }
}
