/*
 * Dark theme, with the type, icons, corners and spacing of my apps (Shop Weh):
 * Inter for everything you read and tap, Source Serif 4 for titles, Phosphor icons.
 *
 * Radius scale, outer to inner: cards 20px > tiles inside cards 10px.
 * Every standalone control (button, chip, nav link) is a pill.
 * Spacing runs on 4px steps: 4, 8, 12, 16, 24, 32, 48, 64.
 */
:root {
  --bg: #0c0c0c;
  --surface: #141414;
  --surface-alt: #1b1b1b;
  --line: #222222;
  --ink: #e8e6e3;
  --sub: #b0aba2;
  --muted: #8f8a82;
  --faint: #5f5b55;
  --accent: #d2b48c;
  --accent-hover: #e0c7a4;
  --hover: rgb(255 255 255 / 0.06);
  --font-ui: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-title: 'Source Serif 4', Georgia, serif;
  --gutter: 20px;
  --r-card: 20px;
  --r-inner: 10px;
  --r-pill: 999px;
  --bar-bg: rgb(12 12 12 / 0.72);
  --ease: cubic-bezier(0.215, 0.61, 0.355, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 24px;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, p, ul { margin: 0; }
.icon { width: 1em; height: 1em; fill: currentColor; flex-shrink: 0; }
.sprite { position: absolute; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-pill); }

/* Motion: one curve, colour and transform only */
.btn, .nav-links a, .socials a, .link, a.cert { transition: color .16s var(--ease), background-color .16s var(--ease), border-color .16s var(--ease), transform 90ms var(--ease); }

/* NAV */
.nav {
  position: fixed; top: 0; width: 100%; z-index: 50;
  backdrop-filter: saturate(1.8) blur(16px); -webkit-backdrop-filter: saturate(1.8) blur(16px);
  background: var(--bar-bg);
  border-bottom: 1px solid var(--line);
}
.nav-inner { max-width: 1040px; margin: auto; padding: 12px var(--gutter); display: flex; justify-content: space-between; align-items: center; }
.brand { font-family: var(--font-title); font-size: 20px; line-height: 28px; font-weight: 600; }
.nav-links { display: flex; gap: 4px; font-size: 14px; font-weight: 500; color: var(--muted); align-items: center; }
.nav-links a { padding: 6px 12px; border-radius: var(--r-pill); }
.nav-links a:hover { color: var(--accent); background: var(--hover); }
.menu-btn { display: none; place-items: center; width: 40px; height: 40px; background: var(--surface); border: 1px solid var(--line); border-radius: 50%; color: var(--ink); font-size: 20px; cursor: pointer; }
@media (max-width: 767px) {
  .menu-btn { display: inline-grid; }
  .nav-links {
    display: none; position: absolute; top: calc(100% + 8px); left: var(--gutter); right: var(--gutter);
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
    padding: 8px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 16px; font-size: 16px; color: var(--ink); border-radius: var(--r-inner); }
}

/* LAYOUT */
.section { padding: 48px var(--gutter); max-width: 1040px; margin: auto; }
@media (min-width: 768px) { .section { padding: 64px var(--gutter); } }
.section-title { font-family: var(--font-title); font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 24px; }
.section-lead { color: var(--muted); max-width: 40rem; margin: -12px 0 24px; }
.grid-2 { display: grid; gap: 16px; }
.grid-3 { display: grid; gap: 16px; }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-2 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 24px;
  display: flex; flex-direction: column;
}
@media (max-width: 420px) { .card { padding: 20px; } }
.card h3 { font-size: 17px; line-height: 24px; font-weight: 600; letter-spacing: -0.01em; }
.meta { font-size: 14px; line-height: 20px; color: var(--accent); margin: 4px 0 16px; }
.card p, .card li { color: var(--sub); font-size: 15px; line-height: 22px; }
.card p { margin-bottom: 16px; }
.card ul { padding-left: 18px; margin-bottom: 20px; }
.card li + li { margin-top: 6px; }
.card li::marker { color: var(--faint); }
.card .badges { margin-top: auto; }
.card strong { color: var(--ink); font-weight: 600; }
.card > :last-child { margin-bottom: 0; }
.card h3 + p { margin-top: 8px; }

.links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; font-size: 15px; }
.link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--accent); text-underline-offset: 4px; }
.link .icon { font-size: 14px; }
.link:hover { text-decoration: underline; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--surface-alt);
  border: 1px solid var(--line);
  font-size: 13px; font-weight: 500; color: var(--ink);
}
.badge img { width: 14px; height: 14px; }
.invert { filter: invert(1); }

/* Round icon tile, as on Shop Weh's list rows */
.tile-icon { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-alt); border: 1px solid var(--line); color: var(--accent); font-size: 18px; }

/* HERO */
.hero { padding-top: 120px; animation: rise .4s var(--ease) both; }
@media (min-width: 768px) { .hero { padding-top: 168px; padding-bottom: 80px; } }
.hero-row { display: flex; flex-direction: column; justify-content: space-between; align-items: center; gap: 48px; }
@media (min-width: 1024px) { .hero-row { flex-direction: row; } }
.hero-copy { max-width: 36rem; }
.hero h1 span { color: var(--accent); }
.hero h1 { font-family: var(--font-title); font-size: 44px; font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; margin-bottom: 16px; }
@media (min-width: 768px) { .hero h1 { font-size: 60px; } }
.hero .role { font-size: 19px; line-height: 28px; font-weight: 500; margin-bottom: 12px; text-wrap: balance; }
.hero .bio { color: var(--muted); line-height: 26px; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: var(--r-pill);
  font-size: 15px; font-weight: 600;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
}
.btn .icon { font-size: 18px; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #0c0c0c; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #0c0c0c; }
.socials { display: flex; gap: 4px; }
.socials a { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; font-size: 22px; color: var(--muted); }
.socials a:hover { color: var(--accent); background: var(--hover); }

.focus-panel {
  display: none; flex-direction: column; gap: 16px;
  padding: 24px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); width: 380px;
}
@media (min-width: 1024px) { .focus-panel { display: flex; } }
.focus-panel h2 { font-size: 13px; line-height: 20px; font-weight: 600; color: var(--accent); }
.focus-item { display: flex; align-items: center; gap: 12px; font-size: 15px; line-height: 22px; font-weight: 500; }
.focus-foot { margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; line-height: 20px; color: var(--muted); }

/* EXPERIENCE */
.timeline { display: grid; gap: 16px; }
.job-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; align-items: baseline; }
.job-head .when { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* FEATURED PROJECTS */
.featured { display: grid; gap: 16px; }
.feature { display: grid; gap: 32px; align-items: center; padding: 32px; }
@media (max-width: 420px) { .feature { padding: 20px; gap: 24px; } }
@media (min-width: 860px) { .feature { grid-template-columns: 1fr auto; } }
.feature h3 { font-family: var(--font-title); font-size: 24px; line-height: 32px; letter-spacing: -0.01em; }
.shots { display: flex; gap: 12px; justify-content: center; padding: 16px; background: var(--surface-alt); border-radius: var(--r-inner); }
.shots img {
  width: 160px; height: auto; aspect-ratio: 420 / 909;
  border-radius: var(--r-inner); background: var(--surface); border: 1px solid var(--line);
}
@media (max-width: 420px) { .shots { padding: 12px; gap: 8px; } .shots img { width: calc(50% - 4px); } }

/* OTHER PROJECTS: one list, a row per project, open a row for details */
.project-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.project + .project, .project-row + .project-row { border-top: 1px solid var(--line); }
.project summary, .project-row {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 24px; cursor: pointer; list-style: none;
  transition: background-color .16s var(--ease);
}
.project summary::-webkit-details-marker { display: none; }
.project summary:hover, .project-row:hover { background: var(--hover); }
.project summary:focus-visible, .project-row:focus-visible { outline-offset: -2px; border-radius: 0; }
.project-head { flex: 1; min-width: 0; }
.project-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.project-title h4 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
.project-meta { margin-top: 2px; font-size: 14px; line-height: 20px; color: var(--muted); }
.project-stack { font-size: 13px; line-height: 20px; color: var(--muted); white-space: nowrap; }
summary > .project-stack { flex: none; }
@media (max-width: 767px) { summary > .project-stack { display: none; } }
.chip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
  border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface-alt);
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.chip-live { color: var(--accent); border-color: rgb(210 180 140 / 0.3); }
.caret { flex: none; font-size: 18px; color: var(--muted); transition: transform .2s var(--ease); }
.project[open] .caret { transform: rotate(180deg); }
.project-body { padding: 0 24px 24px; max-width: 46rem; }
.project-body p, .project-body li { color: var(--sub); font-size: 15px; line-height: 22px; }
.project-body p { margin-bottom: 12px; }
.project-body strong { color: var(--ink); font-weight: 600; }
.project-body ul { padding-left: 18px; margin-bottom: 16px; }
.project-body li + li { margin-top: 6px; }
.project-body li::marker { color: var(--faint); }
.row-link { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: var(--accent); }
.row-link .icon { font-size: 13px; }
@media (max-width: 420px) {
  .project summary, .project-row { padding: 16px 20px; }
  .project-body { padding: 0 20px 20px; }
}

.subhead { font-family: var(--font-title); font-size: 20px; line-height: 28px; font-weight: 600; margin: 48px 0 16px; }

/* SKILLS */
.skill-groups { display: grid; gap: 16px; }
@media (min-width: 768px) { .skill-groups { grid-template-columns: repeat(2, 1fr); } }
.skill-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 24px; }
.skill-group h3 { font-size: 13px; line-height: 20px; font-weight: 600; color: var(--accent); margin-bottom: 12px; }

/* EDUCATION */
.cert {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 20px; border-radius: var(--r-card);
}
a.cert:hover { border-color: var(--accent); }
.cert-text { display: flex; flex-direction: column; gap: 2px; }
.cert-text strong { font-weight: 600; font-size: 15px; line-height: 22px; }
.cert-text span { color: var(--muted); font-size: 13px; line-height: 18px; }

/* CONTACT */
.contact-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
footer { border-top: 1px solid var(--line); margin-top: 32px; padding: 32px var(--gutter); text-align: center; color: var(--muted); font-size: 13px; }

@keyframes rise { from { transform: translateY(8px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero { animation: none; }
}
