/* thewhitemage. - document-style portfolio
   Type: Poppins (headings), Acumin Pro (body) - self-hosted brand fonts
   Theme: monochrome, black-and-white brand palette (white mage) */

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/poppins-normal-500-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Acumin Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/acumin-pro-normal-400-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Acumin Pro';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/acumin-pro-normal-500-latin.woff2') format('woff2');
}

:root {
  --bg: #FBFBFA;
  --ink: #161513;
  --muted: #787774;
  --line: #EAE7E2;
  --accent: #000000;
  --font-display: 'Poppins', 'Helvetica Neue', sans-serif;
  --font-body: 'Acumin Pro', 'Helvetica Neue', sans-serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;
  --wrap: 620px;
}

html[data-theme="dark"] {
  --bg: #141311;
  --ink: #ECEAE7;
  --muted: #9B9893;
  --line: #2A2825;
  --accent: #FFFFFF;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --bg: #141311;
    --ink: #ECEAE7;
    --muted: #9B9893;
    --line: #2A2825;
    --accent: #FFFFFF;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--ink); color: var(--bg); }

img { display: block; max-width: 100%; }
a { color: inherit; }
ul { list-style: none; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 72px 24px 128px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 14px;
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

.text-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}
.text-link:hover { text-decoration-color: var(--ink); }

/* ---------- Bottom dock nav ---------- */

.dock {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
}
.dock a,
.dock button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.dock a:hover,
.dock button:hover { color: var(--ink); }
.dock a[aria-current="page"] { color: var(--ink); }
.dock a[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}
.dock-sep {
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: var(--line);
}
.dock button { padding: 0 10px; }
.dock button svg { width: 15px; height: 15px; }
.dock button:active { transform: scale(0.94); }
.icon-sun { display: none; }
html[data-theme="dark"] .icon-sun { display: block; }
html[data-theme="dark"] .icon-moon { display: none; }

/* ---------- Header ---------- */

.head {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 36px;
}
.portrait {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 10px;
  flex-shrink: 0;
}

.head h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 30px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.role {
  color: var(--muted);
  font-size: 15px;
  margin-top: 4px;
}
/* ---------- Bio ---------- */

.bio p {
  color: var(--ink);
  margin-bottom: 16px;
  max-width: 60ch;
}
.bio p:last-child { margin-bottom: 0; }

/* ---------- Sections ---------- */

.section {
  margin-top: 56px;
}
.section h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}
.section > p {
  color: var(--muted);
  max-width: 60ch;
}

.group-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 28px 0 10px;
}
.section h2 + .group-label { margin-top: 0; }

/* ---------- One-liner rows ---------- */

.rows {
  display: flex;
  flex-direction: column;
}
.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
}
.row-name {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}
a.row-name {
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}
a.row-name:hover { text-decoration-color: var(--ink); }
.row-meta {
  font-size: 13.5px;
  color: var(--muted);
  text-align: right;
}

/* Work rows: whole row is a link, year column + name + tag */
a.row-link {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 9px 0;
  color: inherit;
  text-decoration: none;
}
.row-year {
  flex-shrink: 0;
  width: 44px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
a.row-link .row-name {
  flex: 1;
  min-width: 0;
  white-space: normal;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}
a.row-link:hover .row-name { text-decoration-color: var(--ink); }
.row-arrow {
  display: inline-block;
  margin-left: 7px;
  font-weight: 400;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
a.row-link:hover .row-arrow { opacity: 1; transform: translateX(0); }
a.row-link .row-meta { flex-shrink: 0; }

.note {
  margin-top: 22px;
  font-size: 14px;
  color: var(--muted);
  max-width: 60ch;
}

/* ---------- Show more (progressive disclosure) ---------- */

.more { overflow: hidden; }
.more-btn {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 7px 0;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 0.15s ease;
}
.more-btn[hidden] { display: none; }
.more-btn:hover { color: var(--ink); }
.more-btn:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- Key-value lines (Experience / meta) ---------- */

.kv {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 16px;
  padding: 8px 0;
}
.kv-key {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding-top: 3px;
}
.kv-val {
  font-size: 14.5px;
  color: var(--muted);
}

/* ---------- Feature page (work detail) ---------- */

.back {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 28px;
  transition: color 0.15s ease;
}
.back:hover { color: var(--ink); }
.back .b-arrow { color: var(--accent); margin-right: 4px; }

.page-head { margin-bottom: 40px; }
.page-head h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 30px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.lede {
  margin-top: 12px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 56ch;
}

.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 20px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.meta dt {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 4px;
}
.meta dd { font-size: 14.5px; }

.article h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.01em;
  margin: 40px 0 12px;
}
.article h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  margin: 28px 0 10px;
}
.article p {
  margin-bottom: 14px;
  max-width: 60ch;
}
.article ul {
  margin: 0 0 14px;
  max-width: 60ch;
}
.article li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 6px;
}
.article li::before {
  content: '\2192';
  position: absolute;
  left: 0;
  color: var(--accent);
}
.article .tldr {
  margin: 18px 0 20px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.article .tldr .tldr-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}
.article code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: color-mix(in srgb, var(--line) 50%, transparent);
  padding: 1px 5px;
  border-radius: 4px;
}
.article .tldr ul { margin-bottom: 0; }
.article .tldr li:last-child { margin-bottom: 0; }

.pr {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 26px;
}
.pr h3 { margin-bottom: 8px; }
.pr-line {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}
.pr-status {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}
.pr-status.is-merged {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

/* ---------- Footer ---------- */

.footer {
  margin-top: 72px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--muted);
}
.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links a { font-size: 13.5px; }

/* ---------- Reveal ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--d, 0ms);
  }
  .reveal.in {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */

@media (max-width: 560px) {
  .wrap { padding-top: 48px; }
  .head { gap: 16px; }
  .portrait { width: 72px; height: 72px; }
  .head h1 { font-size: 26px; }
  .row { flex-direction: column; gap: 1px; padding: 9px 0; }
  .row-name { white-space: normal; }
  .row-meta { text-align: left; }
  a.row-link { flex-wrap: wrap; gap: 2px 14px; padding: 11px 0; }
  a.row-link .row-name { flex-basis: calc(100% - 58px); }
  a.row-link .row-meta { flex-basis: 100%; padding-left: 58px; text-align: left; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .meta { grid-template-columns: repeat(2, 1fr); }
  .dock a, .dock button { padding: 0 11px; }
}
