/* ==========================================================================
   gedankenn.github.io · layout + components
   Colors, fonts and a few shape tokens come from themes/*.css.
   ========================================================================== */
@font-face { font-family: "Plex Sans"; src: url("../assets/fonts/plex-sans.woff2") format("woff2");
             font-weight: 100 700; font-style: normal; font-display: swap; }
@font-face { font-family: "JB Mono"; src: url("../assets/fonts/jetbrains-mono.woff2") format("woff2");
             font-weight: 100 800; font-style: normal; font-display: swap; }

:root {
  --sans: "Plex Sans", "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JB Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display: var(--sans);
  --wrap: 1120px;
  --radius: 10px;
  --radius-sm: 6px;
  --gap: clamp(16px, 2.4vw, 28px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.6 var(--sans);
       -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3 { margin: 0; color: var(--text); font-family: var(--display); }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
strong { color: var(--text); font-weight: 600; }
.mono { font-family: var(--mono); }
.dim { color: var(--muted); }
.wrap { width: min(100% - 2 * clamp(20px, 5vw, 48px), var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 8px 14px; z-index: 100; border-radius: var(--radius-sm); }
.skip:focus { left: 12px; }
.label { font: 500 12px/1.4 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }

/* --- Top bar ------------------------------------------------------------- */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--bar-bg); border-bottom: 1px solid var(--line);
          backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px); }
.topbar-in { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 600; letter-spacing: -.01em; }
.brand-mark { font: 600 12px/1 var(--mono); letter-spacing: .06em; color: var(--accent); border: 1px solid var(--accent-line); background: var(--accent-dim);
              padding: 6px 7px; border-radius: 5px; }
nav { margin-left: auto; display: flex; gap: 22px; }
nav a { color: var(--text-2); text-decoration: none; font-size: 14.5px; }
nav a:hover { color: var(--text); }
.mode-toggle { display: inline-flex; align-items: center; gap: 8px; font: 500 12.5px/1 var(--mono); color: var(--text-2);
               background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; cursor: pointer; }
.mode-toggle:hover { color: var(--text); border-color: var(--accent-line); }
.mode-toggle[hidden] { display: none; }
.mode-ico { width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(90deg, var(--text) 50%, transparent 50%); border: 1.5px solid var(--text); }

/* --- Hero ---------------------------------------------------------------- */
.hero { position: relative; padding: clamp(56px, 9vw, 112px) 0 clamp(72px, 10vw, 128px); overflow: hidden; background: var(--hero-bg); }
.hero::before { content: ""; position: absolute; inset: 0; background-image: var(--hero-grid); background-size: 24px 24px; pointer-events: none;
                -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 95%); mask-image: linear-gradient(180deg, #000 30%, transparent 95%); }
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.eyebrow { font: 500 13px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.eyebrow::before { content: ""; display: inline-block; width: 28px; height: 2px; background: var(--accent); vertical-align: middle; margin-right: 12px; }
h1 { font-size: clamp(2.5rem, 6vw, 4.25rem); line-height: 1.02; letter-spacing: var(--h1-track, -.03em); font-weight: var(--h1-weight, 600); }
.headline { font-size: clamp(1.15rem, 2.2vw, 1.5rem); color: var(--text); margin: 14px 0 18px; font-weight: 500; letter-spacing: -.01em; }
.lede { color: var(--text-2); font-size: clamp(1rem, 1.4vw, 1.12rem); max-width: 60ch; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 18px; }
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm);
       font: 500 15px/1 var(--sans); text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line);
       transition: border-color .15s, background .15s, color .15s; }
.btn:hover { color: var(--text); border-color: var(--accent-line); background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); color: var(--on-accent); background: var(--accent); }
.btn.ghost { background: transparent; }
.btn-sub { font: 600 11px/1 var(--mono); padding: 3px 5px; border-radius: 4px; background: rgba(0,0,0,.16); }
.hero-meta { font-size: 14px; color: var(--muted); }
.hero-meta a { color: var(--text-2); }

.hero-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.panel-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line);
             font: 500 12px/1 var(--mono); color: var(--muted); }
.panel-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.panel-bar span { margin-left: 8px; }
.panel-body { margin: 0; padding: 18px 20px 20px; font: 400 13.5px/1.8 var(--mono); color: var(--text); white-space: pre; overflow-x: auto; }
.panel-body .p { color: var(--accent); }
.panel-body .k { color: var(--muted); }
.panel-body .o { color: var(--text-2); }
.cursor { display: inline-block; width: .6em; height: 1.1em; background: var(--accent); vertical-align: -.2em; margin-left: 4px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-trace { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 90px; opacity: var(--trace-opacity, .9); }
.hero-trace .wave { fill: none; stroke: var(--accent); stroke-width: 1.6; opacity: .55; }
.hero-trace .wave-dim { fill: none; stroke: var(--line); stroke-width: 1.4; }

/* --- Sections ------------------------------------------------------------ */
.section { padding: clamp(56px, 8vw, 104px) 0; border-top: 1px solid var(--line); }
.section:nth-of-type(odd) { background: var(--section-alt); }
.sec-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: clamp(24px, 4vw, 40px); }
.sec-idx { font: 500 13px/1 var(--mono); color: var(--accent); }
.sec-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); letter-spacing: -.02em; font-weight: var(--h2-weight, 600); }
.sec-lede { color: var(--text-2); max-width: 70ch; margin-top: -12px; margin-bottom: 32px; }

.about-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); }
.prose p { color: var(--text-2); max-width: 68ch; }
.principles { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; align-self: start; }
.principles ul { list-style: none; display: grid; gap: 10px; }
.principles li { display: flex; gap: 10px; font: 400 14.5px/1.45 var(--mono); color: var(--text); }
.tick { color: var(--accent); }

/* --- Timeline ------------------------------------------------------------ */
.timeline { list-style: none; position: relative; }
.timeline::before { content: ""; position: absolute; left: 150px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.tl-item { position: relative; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 0 36px; padding-bottom: 34px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: 145px; top: 7px; width: 11px; height: 11px; border-radius: 50%;
                   background: var(--bg); border: 2px solid var(--muted); }
.tl-item.current::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); }
.tl-when { font: 500 13.5px/1.6 var(--mono); color: var(--muted); padding-right: 20px; text-align: right; }
.tl-item.current .tl-when { color: var(--accent); }
.tl-body { padding-left: 4px; }
.tl-body h3 { font-size: 1.12rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.4; }
.tl-body .at { color: var(--text-2); font-weight: 500; }
.tl-where { font-size: 14px; color: var(--muted); margin: 2px 0 10px; }
.tl-body ul { padding-left: 1.1em; color: var(--text-2); display: grid; gap: 6px; margin-bottom: 12px; }
.tl-body li::marker { color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; }
.chip { font: 500 12.5px/1 var(--mono); color: var(--text-2); background: var(--chip-bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
        padding: 6px 9px; white-space: nowrap; }
.chip.on { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-dim); }

.edu { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-top: 48px; }
.edu-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.edu-card h3 { font-size: 1.05rem; font-weight: 600; line-height: 1.4; }
.edu-card p:last-child { margin: 0; color: var(--text-2); font-size: 15.5px; }

/* --- Projects ------------------------------------------------------------ */
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.proj { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
        transition: border-color .15s, transform .15s; }
.proj:hover { border-color: var(--accent-line); }
.proj-wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.proj-media { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--media-bg); border-bottom: 1px solid var(--line); overflow: hidden; }
.proj-wide .proj-media { aspect-ratio: auto; min-height: 100%; border-bottom: 0; border-right: 1px solid var(--line); }
.proj-media img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.proj-media.render { background: #FFFFFF; }
.proj-media.render img { object-fit: contain; padding: 10px 18px; }
.proj-media.art svg { width: 100%; height: 100%; padding: 22px 28px; }
.art-grid path, .art-grid circle { fill: none; stroke: var(--line); stroke-width: 1; }
.art-a, .art-b, .art-c { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.art-a { stroke: var(--accent); }
.art-b { stroke: var(--text-2); opacity: .7; }
.art-c { stroke: var(--muted); opacity: .8; }
.art-dot { fill: var(--accent); }
.art-t { font: 500 14px var(--mono); fill: var(--muted); }
.art-cap { position: absolute; right: 12px; bottom: 10px; font: 500 11px/1 var(--mono); color: var(--muted); letter-spacing: .05em; }
.proj-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.proj-kicker { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font: 500 12px/1.4 var(--mono);
               letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.status { text-transform: none; letter-spacing: 0; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); }
.status::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--muted); }
.status.ok::before { background: var(--ok); }
.status.wip::before { background: var(--accent); }
.proj h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -.01em; margin-bottom: 10px; line-height: 1.3; }
.proj h3 a { color: var(--text); text-decoration: none; }
.proj h3 a:hover { color: var(--accent); }
.proj h3 a::after { content: " ↗"; color: var(--muted); font-size: .85em; }
.proj-body > p:not(.chips):not(.proj-kicker) { color: var(--text-2); font-size: 15.5px; }
.proj-body .chips { margin-top: auto; padding-top: 6px; }

.more { margin-top: 40px; }
.more-list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--gap); }
.more-list li { display: flex; gap: 14px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.more-list a { font: 500 14px var(--mono); white-space: nowrap; }
.more-list span { color: var(--muted); }

/* --- Skills -------------------------------------------------------------- */
.skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.skill-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.skill-group h3 { font-size: 1rem; font-weight: 600; margin-bottom: 14px; }

/* --- Contact ------------------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.contact-lede { font-size: 1.15rem; color: var(--text-2); max-width: 44ch; }
.mail { font: 500 clamp(1.05rem, 2.4vw, 1.5rem)/1.3 var(--mono); color: var(--accent-text); word-break: break-all; }
.links { list-style: none; border-top: 1px solid var(--line); }
.links li { display: grid; grid-template-columns: 110px 1fr; align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--line); }
.links .label { margin: 0; }

.footer { border-top: 1px solid var(--line); padding: 26px 0; font-size: 14px; color: var(--muted); }
.footer-in { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer a { color: var(--text-2); }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 960px) {
  .hero-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .proj-wide { grid-template-columns: 1fr; }
  .proj-wide .proj-media { aspect-ratio: 16 / 9; border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .eyebrow { font-size: 11px; letter-spacing: .05em; }
  .eyebrow::before { width: 16px; margin-right: 8px; }
  nav { display: none; }
  .mode-toggle { margin-left: auto; }
  .projects, .skills, .edu, .more-list { grid-template-columns: 1fr; }
  .timeline::before { left: 5px; }
  .tl-item { grid-template-columns: 1fr; padding-left: 28px; }
  .tl-item::before { left: 0; }
  .tl-when { text-align: left; padding: 0; margin-bottom: 4px; }
  .more-list li { flex-direction: column; gap: 2px; }
  .links li { grid-template-columns: 90px 1fr; }
  .panel-body { font-size: 11.5px; padding: 14px; }
}
@media print {
  .topbar, .hero-trace,   body { background: #fff; color: #000; }
}

/* --- HUD layer (A and B; C switches it off) -------------------------------
   Static only: no flicker, no moving scanlines. Glow uses --glow and is limited to accent marks. */
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
               background: repeating-linear-gradient(180deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px); }
.hero-panel { position: relative; overflow: visible; }
.hero-panel .panel-bar { border-radius: var(--radius) var(--radius) 0 0; }
.hero-panel::after { content: ""; position: absolute; inset: -7px; border: 1.5px solid var(--accent-line); border-radius: 3px; pointer-events: none;
  -webkit-mask: conic-gradient(at 16px 16px, transparent 75%, #000 0) 0 0 / calc(100% - 16px) calc(100% - 16px);
          mask: conic-gradient(at 16px 16px, transparent 75%, #000 0) 0 0 / calc(100% - 16px) calc(100% - 16px); }
.hud-tag { position: absolute; top: -26px; right: 0; font: 500 11px/1 var(--mono); letter-spacing: .08em; color: var(--muted); }
.hud-tag b { color: var(--ok); font-weight: 500; }
.eyebrow, .sec-idx, .cursor { text-shadow: var(--glow, none); }
.cursor { box-shadow: var(--glow, none); }
.btn.primary { box-shadow: var(--glow, none); }
.sec-idx::before { content: "[ "; color: var(--muted); }
.sec-idx::after  { content: " ]"; color: var(--muted); }
.proj { position: relative; }
.proj::before { content: ""; position: absolute; top: 0; left: 0; width: 28px; height: 2px; background: var(--accent); z-index: 2; opacity: .9; }
