:root {
  color-scheme: dark;
  --bg: #17263e;
  --panel: #21344f;
  --ink: #f0f4fa;
  --muted: #bdcbe0;
  --accent: #b6d2f6;
  --line: #354964;
  --hero-glow: #294260;
  font-family: "Segoe UI", "Malgun Gothic", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f7fc;
  --panel: #e7eff9;
  --ink: #142238;
  --muted: #425571;
  --accent: #24518a;
  --line: #bbcde4;
  --hero-glow: #e0ecfc;
}

* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse 740px 470px at 65% 205px, var(--hero-glow), transparent); }
h1, h2, h3, p, figure { margin: 0; }
p, h3 { overflow-wrap: anywhere; }
a { color: inherit; text-underline-offset: .25em; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.shell { width: min(1200px, calc(100% - 96px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 2; top: 1rem; left: 1rem; padding: .6rem 1rem; background: var(--ink); color: var(--bg); transform: translateY(-180%); }
.skip-link:focus { transform: none; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; flex-wrap: wrap; min-height: 72px; align-items: center; justify-content: space-between; gap: 8px 24px; }
.wordmark { font-size: 1.05rem; font-weight: 700; text-decoration: none; }
.wordmark span, h1 span { color: var(--accent); }
nav { display: flex; flex-wrap: wrap; gap: 8px clamp(12px, 2.8vw, 36px); color: var(--muted); font-size: .9rem; }
nav a { padding: .45em 0; text-decoration: none; }
nav a:hover, .text-link:hover { text-decoration: underline; }
.header-controls:not([hidden]) { display: flex; gap: 10px; align-items: center; }
.header-controls button {
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 650;
  line-height: 1.3;
  cursor: pointer;
}
.header-controls button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.language-toggle { display: inline-flex; padding: 2px; border-radius: 999px; background: #ededee; }
.language-toggle button { min-width: 42px; min-height: 24px; padding: 0 .55em; background: transparent; color: #62656d; }
.language-toggle button:hover { color: #15171b; }
.language-toggle button[aria-pressed="true"] { background: #fff; color: #15171b; box-shadow: 0 1px 2px #0002; }
.theme-toggle {
  display: flex;
  align-items: center;
  flex: none;
  width: 46px;
  height: 28px;
  padding: 3px;
  background: #101114;
  box-shadow: inset 0 0 0 1px #626875;
}
.theme-toggle::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
}
.theme-toggle[aria-pressed="true"] { justify-content: flex-end; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 520px) minmax(0, 330px);
  justify-content: center;
  align-items: center;
  gap: clamp(28px, 4vw, 56px);
  padding-block: clamp(46px, 6vw, 84px);
}
.hero-copy { container-type: inline-size; }
.eyebrow {
  color: var(--accent);
  font: 600 .75rem/1.5 Consolas, ui-monospace, monospace;
  letter-spacing: .13em;
}
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
h1 { margin: .22em 0 .25em; font-size: min(5.75rem, 19cqi); font-weight: 750; line-height: 1.02; letter-spacing: -.065em; white-space: nowrap; }
.hero-intro { max-width: 33rem; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.18rem); line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 28px; }
.button { display: inline-flex; align-items: center; gap: 1rem; padding: .62em 1em; border-radius: 6px; background: var(--accent); color: var(--bg); font-weight: 700; text-decoration: none; }
.button:hover { background: var(--ink); }
.text-link { display: inline-flex; align-items: center; gap: .65rem; padding-block: .4em; color: var(--accent); text-decoration: none; }
.hero-stack { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; padding: 0; list-style: none; }
.hero-stack li, .badge { border: 1px solid var(--line); border-radius: 999px; padding: .2em .75em; color: var(--muted); font-size: .8rem; }
.portrait { width: 100%; padding: 6px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 16px 36px #0a142533; }
.portrait img { display: block; width: 100%; height: auto; border-radius: 12px; }

.content-section { padding-block: 50px; border-top: 1px solid var(--line); scroll-margin-top: 1rem; }
h2 { margin: 6px 0 22px; font-size: clamp(1.8rem, 3.5vw, 2.7rem); letter-spacing: -.055em; line-height: 1.3; }
h3 { font-size: 1.25rem; line-height: 1.4; letter-spacing: -.025em; }
.feature { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: center; gap: 32px; padding: clamp(22px, 3.5vw, 44px); border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(115deg, var(--panel), var(--bg)); }
.feature h3 { margin: 7px 0 13px; font-size: clamp(1.5rem, 3vw, 2.25rem); }
.feature h3 + p, .project-row p, .section-intro, .secondary { color: var(--muted); }
.project-focus { border-left: 1px solid var(--line); padding-left: 32px; }
.project-focus p + p { margin-top: 9px; }
.focus-divider { margin-inline: .25em; color: var(--accent); }
.secondary { font-size: .875rem; }
.project-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 20px; padding: 23px 0 0; }
.project-row p { margin-top: 5px; }
.note-list { list-style: none; padding: 0; margin: 20px 0 0; }
.note-list li { display: grid; grid-template-columns: minmax(0, 130px) minmax(0, 1fr); gap: 4px 20px; align-items: baseline; border-bottom: 1px solid var(--line); padding: 14px 0; overflow-wrap: anywhere; }
.note-category { color: var(--accent); font-size: .85rem; }
.about { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 26px 44px; align-items: center; }
.credential { padding: 20px; border: 1px solid var(--line); border-radius: 8px; }
.credential p + p { margin-top: 8px; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }

@keyframes hero-enter {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > *,
  .portrait { animation: hero-enter 460ms ease-out both; }
  .hero h1 { animation-delay: 60ms; }
  .hero-intro { animation-delay: 120ms; }
  .hero-actions, .portrait { animation-delay: 180ms; }
  .hero-stack { animation-delay: 240ms; }
  .hero-actions:focus-within { animation: none; }
}

@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .hero .button { transition: background-color 160ms ease-out, translate 160ms ease-out; }
  .portrait { transition: translate 200ms ease-out; }
  .hero .button:hover { translate: 0 -2px; }
  .portrait:hover { translate: 0 -4px; }
}

@media (max-width: 760px) {
  .shell { width: calc(100% - 40px); }
  .header-inner { padding-block: 10px; }
  .hero { grid-template-columns: minmax(0, 1fr); padding-block: 40px 36px; gap: 26px; }
  .hero h1 { font-size: min(4.5rem, 17cqi); }
  .portrait { width: min(100%, 300px); justify-self: start; }
  .desktop-break { display: none; }
  .content-section { padding-block: 34px; }
  .feature, .about { grid-template-columns: 1fr; }
  .project-focus { border-left: 0; border-top: 1px solid var(--line); padding: 18px 0 0; }
  .note-list li { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .header-inner nav { order: 1; flex-basis: 100%; }
}

/* Shared multi-page navigation and content layouts. */
nav a[aria-current="page"] { color: var(--ink); box-shadow: 0 2px var(--accent); }
.page-intro { padding-block: 70px 42px; }
.page-intro h1 { font-size: clamp(2rem, 5vw, 4rem); white-space: normal; overflow-wrap: anywhere; line-height: 1.2; letter-spacing: -.045em; margin-block: 16px 20px; }
.page-intro .section-intro { max-width: 44rem; }
.section-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 24px; margin-bottom: 22px; }
.section-heading h2 { margin-bottom: 0; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.project-card { display: flex; flex-direction: column; gap: 18px; padding: clamp(22px, 3vw, 36px); border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(130deg, var(--panel), var(--bg)); text-decoration: none; }
.project-card h3 { font-size: clamp(1.35rem, 2.2vw, 1.8rem); }
.project-card > p:not(.eyebrow) { color: var(--muted); }
.card-bottom { display: flex; justify-content: space-between; gap: 16px; margin-top: auto; padding-top: 20px; font-size: .85rem; color: var(--accent); }
.project-card:hover { border-color: var(--accent); }
.planned-notes li { grid-template-columns: 110px minmax(0, 1fr) auto; }
.breadcrumb { padding-top: 30px; }
.breadcrumb + .page-intro { padding-top: 24px; }
.detail-notice { margin-top: 28px; color: var(--muted); }
main { min-height: calc(100vh - 145px); }
@media (prefers-reduced-motion: no-preference) and (hover: hover) { .project-card { transition: translate 180ms ease, border-color 180ms ease; } .project-card:hover { translate: 0 -4px; } }
@media (max-width: 760px) { .project-grid { grid-template-columns: 1fr; } .page-intro { padding-block: 40px 30px; } .planned-notes li { grid-template-columns: 1fr; gap: 8px; } .planned-notes .badge { justify-self: start; } }

.blog-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.blog-filters button { font: inherit; padding: 7px 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: transparent; cursor: pointer; }
.blog-filters button[aria-pressed="true"] { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.blog-filters button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.note-list li[hidden], .filter-empty[hidden] { display: none; }
.filter-empty { padding-block: 32px; }
