/* ============================================================
   {{NAME}} — portfolio
   Studio aesthetic. Light + dark via [data-theme].
   ============================================================ */

:root {
  /* dark only */
  --bg: #0A0A0B;
  --surface: #111113;
  --surface-2: #18181B;
  --ink: #F4F4F5;
  --muted: #71717A;
  --dim: #3F3F46;
  --rule: #1F1F23;
  --accent: #10B981;
  --accent-dim: rgba(16, 185, 129, 0.10);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* anchor scroll offset under sticky nav */
[id] { scroll-margin-top: 4.5rem; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.6;
  font-feature-settings: "kern", "ss01", "cv11";
  min-height: 100vh;
  transition: background 0.2s ease, color 0.2s ease;
}

/* ---------- theme toggle ---------- */
/* removed — dark only */

/* ---------- top nav (sticky, fades in past hero) ---------- */

.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 90;
  background: rgba(10, 10, 11, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
          backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--rule);
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 0.3s ease,
              transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
  pointer-events: none;
}
.topnav.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.topnav-inner {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0.75rem clamp(1.25rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topnav-brand {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.topnav-brand:hover { color: var(--accent); }
.topnav-brand .brand-mark {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.55rem;
  vertical-align: middle;
  transform: translateY(-1px);
}

.topnav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.topnav-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.topnav-links a:hover { color: var(--ink); }

.topnav-contact {
  color: var(--accent) !important;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.topnav-contact:hover { opacity: 0.82; }
.topnav-contact .arrow {
  transition: transform 0.2s ease;
  display: inline-block;
}
.topnav-contact:hover .arrow { transform: translate(2px, -2px); }

@media (max-width: 640px) {
  .topnav-inner { padding: 0.6rem 1.25rem; }
  .topnav-brand { font-size: 0.78rem; }
  .topnav-links { gap: 1rem; font-size: 0.68rem; }
  .topnav-links .nav-anchor { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .topnav {
    transition: opacity 0.2s ease;
    transform: none;
  }
}

/* ---------- layout ---------- */

.frame {
  max-width: 64rem; margin: 0 auto;
  padding: 5.5rem clamp(1.25rem, 4vw, 3rem) 4rem;
}

/* ---------- hero ---------- */

.hero {
  padding-bottom: 3rem; border-bottom: 1px solid var(--rule);
}

.badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.7rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1.5rem;
}
.badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 600; line-height: 1.05;
  letter-spacing: -0.025em; margin-bottom: 1.25rem;
}
.hero h1 .accent { color: var(--accent); font-weight: 500; }

.hero p {
  font-size: 1.0625rem; color: var(--muted);
  max-width: 36rem; line-height: 1.55;
}

/* ---------- rows ---------- */

.row {
  display: grid; grid-template-columns: 1fr;
  gap: 1.25rem; padding: 2.5rem 0;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 800px) {
  .row { grid-template-columns: 9rem 1fr; gap: 3rem; }
}
.meta {
  font-family: var(--mono); font-size: 0.7rem;
  line-height: 1.5; letter-spacing: 0.04em;
  color: var(--muted); text-transform: uppercase;
  padding-top: 0.35rem;
}
.row h2 {
  font-size: 1rem; font-weight: 600;
  margin-bottom: 0.875rem; letter-spacing: -0.01em;
  color: var(--ink);
}
.row p {
  color: var(--muted); margin-bottom: 0.875rem; max-width: 36rem;
}
.row p:last-child { margin-bottom: 0; }
.row p .em { color: var(--ink); font-weight: 500; }

/* ---------- stack chips ---------- */

.stack-groups { display: flex; flex-direction: column; gap: 1rem; }
.stack-group { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.stack-label {
  font-family: var(--mono); font-size: 0.65rem;
  color: var(--muted); letter-spacing: 0.06em;
  text-transform: uppercase; margin-right: 0.5rem;
  min-width: 5rem;
}
.tag {
  font-family: var(--mono); font-size: 0.7rem;
  padding: 0.25rem 0.55rem; border-radius: 4px;
  background: var(--surface-2); color: var(--muted);
  letter-spacing: 0.02em; border: 1px solid var(--rule);
}

/* ---------- work card (featured) ---------- */

.work-card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 10px; padding: 1.5rem;
  transition: border-color 0.15s, transform 0.15s;
  text-decoration: none; color: inherit; display: block;
}
.work-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.work-card-head {
  display: flex; justify-content: space-between;
  align-items: baseline; margin-bottom: 0.5rem;
  gap: 1rem; flex-wrap: wrap;
}
.work-card-name {
  font-size: 1.25rem; font-weight: 600;
  color: var(--ink); letter-spacing: -0.015em;
}
.work-card-year {
  font-family: var(--mono); font-size: 0.75rem;
  color: var(--muted); letter-spacing: 0.05em;
}
.work-card p {
  color: var(--muted); font-size: 0.95rem;
  line-height: 1.55; margin: 0;
}
.work-card-stack { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }

/* ---------- work list (compact) ---------- */

.work-list { display: flex; flex-direction: column; gap: 0; }
.work-item {
  padding: 1.5rem 0; border-top: 1px dashed var(--rule);
}
.work-item:first-child { border-top: none; padding-top: 0; }
.work-item-head {
  display: flex; justify-content: space-between;
  gap: 1rem; margin-bottom: 0.5rem; align-items: baseline;
  flex-wrap: wrap;
}
.work-item-name {
  font-size: 1.0625rem; font-weight: 600;
  color: var(--ink); letter-spacing: -0.01em;
}
.work-item-org {
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--muted); letter-spacing: 0.05em;
}
.work-item p {
  color: var(--muted); font-size: 0.95rem;
  line-height: 1.55; margin: 0; max-width: 36rem;
}

/* ---------- writing & talks ---------- */

.list { display: flex; flex-direction: column; gap: 0.4rem; }
.list-item {
  display: flex; justify-content: space-between;
  gap: 1rem; padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none; color: var(--ink);
  font-size: 0.95rem;
  transition: color 0.15s;
}
.list-item:hover { color: var(--accent); }
.list-item:last-child { border-bottom: none; }
.list-item-date {
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--muted); letter-spacing: 0.04em;
  white-space: nowrap;
}

/* ---------- principles ---------- */

.principles { list-style: none; counter-reset: p; }
.principles li {
  counter-increment: p; padding: 0.75rem 0;
  display: grid; grid-template-columns: 2rem 1fr;
  gap: 0.75rem; align-items: baseline; color: var(--ink);
}
.principles li::before {
  content: counter(p, decimal-leading-zero);
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--accent); letter-spacing: 0.08em;
}

/* ---------- education ---------- */

.edu {
  display: grid; grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 600px) { .edu { grid-template-columns: 1fr 1fr; } }
.edu-item .edu-degree {
  font-size: 1rem; font-weight: 600; color: var(--ink);
  margin-bottom: 0.25rem;
}
.edu-item .edu-school {
  font-family: var(--mono); font-size: 0.75rem;
  color: var(--muted); letter-spacing: 0.04em;
}

/* ---------- links ---------- */

a.link {
  color: var(--accent); text-decoration: none;
  font-family: var(--mono); font-size: 0.85rem;
}
a.link:hover { text-decoration: underline; text-underline-offset: 3px; }

a.inline {
  color: var(--ink); text-decoration: underline;
  text-decoration-color: var(--dim); text-underline-offset: 3px;
}
a.inline:hover { text-decoration-color: var(--accent); }

/* ---------- footer ---------- */

footer {
  padding-top: 2rem; margin-top: 2rem;
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--muted); letter-spacing: 0.04em;
  display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}

/* ---------- case study ---------- */

.case .frame { max-width: 48rem; }
.case .back {
  display: inline-block; font-family: var(--mono);
  font-size: 0.75rem; color: var(--muted);
  text-decoration: none; letter-spacing: 0.04em;
  margin-bottom: 3rem;
}
.case .back:hover { color: var(--ink); }
.case h1 {
  font-size: clamp(2rem, 5vw, 2.75rem); font-weight: 600;
  line-height: 1.1; letter-spacing: -0.025em; margin-bottom: 1rem;
}
.case .deck {
  font-size: 1.1875rem; line-height: 1.55;
  color: var(--muted); margin-bottom: 3rem; max-width: 34rem;
}
.case .stack {
  display: grid; grid-template-columns: max-content 1fr;
  gap: 0.5rem 1.5rem; font-size: 0.9rem;
  padding: 1.5rem; background: var(--surface);
  border: 1px solid var(--rule); border-radius: 10px;
  margin: 2.5rem 0;
}
.case .stack dt {
  font-family: var(--mono); font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); align-self: center;
}
.case .stack dd { color: var(--ink); align-self: center; }
.case h2 {
  font-size: 1.5rem; font-weight: 600;
  letter-spacing: -0.015em; color: var(--ink);
  margin: 3.5rem 0 1rem;
}
.case h3 {
  font-family: var(--mono); font-size: 0.75rem;
  font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--accent);
  margin: 2rem 0 0.75rem;
}
.case p {
  color: var(--muted); margin-bottom: 1.25rem;
  font-size: 1rem; line-height: 1.7;
}
.case p .em { color: var(--ink); font-weight: 500; }
.case code {
  font-family: var(--mono); font-size: 0.85em;
  background: var(--surface-2); padding: 0.1rem 0.4rem;
  border-radius: 4px; border: 1px solid var(--rule);
  color: var(--ink);
}
.case blockquote {
  margin: 2.5rem 0; padding: 1rem 1.5rem;
  border-left: 2px solid var(--accent);
  background: var(--accent-dim); border-radius: 0 6px 6px 0;
  color: var(--ink); font-size: 1.0625rem;
  line-height: 1.55; font-style: italic;
}

/* ---------- selection + focus ---------- */

::selection { background: var(--accent); color: var(--bg); }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px; border-radius: 4px;
}

/* ============================================================
   SECTION VARIANTS — visual rhythm
   ============================================================ */

/* tinted band: full-bleed inside frame, surface-2 background */
.row.band {
  grid-template-columns: 1fr;
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 2.75rem clamp(1.5rem, 4vw, 3rem);
  margin: 2.5rem 0;
}
.row.band + .row { border-top: none; }

/* span: full-width content, no meta column, but no tint */
.row.span { grid-template-columns: 1fr; }

/* big section tag (used inside .band / .span sections) */
.section-tag {
  display: inline-flex; align-items: center; gap: 0.75rem;
  font-family: var(--mono); font-size: 0.7rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1.5rem;
}
.section-tag .section-num { color: var(--accent); }
.section-tag .section-rule {
  flex: 1; height: 1px; background: var(--rule);
  max-width: 4rem;
}

/* display heading inside span/band sections */
.row .display-h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 600; letter-spacing: -0.02em;
  color: var(--ink); margin-bottom: 1.25rem;
  max-width: 38rem; line-height: 1.15;
}
.row .lede {
  font-size: 1.0625rem; color: var(--muted);
  max-width: 38rem; margin-bottom: 2rem;
  line-height: 1.55;
}

/* ============================================================
   01 — CURRENTLY: three-card "now" grid
   ============================================================ */

.now-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 0.875rem; margin-top: 0.5rem;
}
@media (min-width: 640px) { .now-grid { grid-template-columns: 1fr 1fr 1fr; } }

.now-card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 10px; padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  transition: border-color 0.15s;
}
.now-card:hover { border-color: var(--dim); }

.now-kind {
  font-family: var(--mono); font-size: 0.65rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
}
.now-role {
  font-size: 0.95rem; font-weight: 600;
  color: var(--ink); letter-spacing: -0.01em;
  line-height: 1.3;
}
.now-org {
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--muted); letter-spacing: 0.04em;
}
.now-desc {
  font-size: 0.85rem; color: var(--muted);
  line-height: 1.5; margin-top: auto;
}

/* ============================================================
   02 — DISCIPLINE: capability pillars + stack
   ============================================================ */

.pillars {
  display: grid; grid-template-columns: 1fr;
  gap: 1rem; margin: 0.5rem 0 2rem;
}
@media (min-width: 720px) { .pillars { grid-template-columns: repeat(4, 1fr); } }

.pillar {
  padding: 1rem 0 0; border-top: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 0.4rem;
}
.pillar-num {
  font-family: var(--mono); font-size: 0.65rem;
  color: var(--accent); letter-spacing: 0.08em;
}
.pillar-title {
  font-size: 0.95rem; font-weight: 600;
  color: var(--ink); letter-spacing: -0.005em;
}
.pillar-body {
  font-size: 0.85rem; color: var(--muted); line-height: 1.5;
}

/* ============================================================
   03 — WORK: featured hero + grid + list
   ============================================================ */

.work-hero {
  display: grid; grid-template-columns: 1fr;
  gap: 0; background: var(--surface);
  border: 1px solid var(--rule); border-radius: 14px;
  overflow: hidden; text-decoration: none; color: inherit;
  margin-bottom: 2rem;
  transition: border-color 0.15s, transform 0.15s;
}
.work-hero:hover { border-color: var(--accent); transform: translateY(-1px); }
@media (min-width: 800px) { .work-hero { grid-template-columns: 1.4fr 1fr; } }

.work-hero-main {
  padding: 1.75rem; display: flex;
  flex-direction: column; gap: 0.9rem;
}
.work-hero-eyebrow {
  font-family: var(--mono); font-size: 0.65rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent);
}
.work-hero-name {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 600; letter-spacing: -0.02em;
  color: var(--ink); line-height: 1.1;
}
.work-hero-desc {
  font-size: 0.9375rem; color: var(--muted);
  line-height: 1.55;
}
.work-hero-stack { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.25rem; }
.work-hero-cta {
  font-family: var(--mono); font-size: 0.75rem;
  color: var(--accent); letter-spacing: 0.05em;
  margin-top: auto;
}

.work-hero-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--surface-2);
  border-top: 1px solid var(--rule);
}
@media (min-width: 800px) {
  .work-hero-stats {
    grid-template-columns: 1fr;
    border-top: none; border-left: 1px solid var(--rule);
  }
}
.stat-cell {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 0.3rem;
}
.stat-cell:first-child { border-top: none; }
@media (max-width: 799px) {
  .stat-cell { border-top: none; border-left: 1px solid var(--rule); }
  .stat-cell:nth-child(odd) { border-left: none; }
  .stat-cell:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
.stat-value {
  font-size: 1.5rem; font-weight: 600;
  color: var(--ink); letter-spacing: -0.025em;
  font-feature-settings: "tnum", "ss01";
  line-height: 1;
}
.stat-value .unit {
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--muted); margin-left: 0.25rem;
  letter-spacing: 0.05em; font-weight: 400;
}
.stat-label {
  font-family: var(--mono); font-size: 0.65rem;
  color: var(--muted); letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* project grid (open-source side projects) */
.proj-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 0.875rem; margin-top: 0.5rem;
}
@media (min-width: 720px) { .proj-grid { grid-template-columns: 1fr 1fr; } }

.proj {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 10px; padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.6rem;
  text-decoration: none; color: inherit;
  transition: border-color 0.15s, transform 0.15s;
  position: relative;
}
.proj:hover { border-color: var(--accent); transform: translateY(-1px); }
.proj:hover .proj-arrow { color: var(--accent); transform: translate(2px, -2px); }

.proj-head {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 0.75rem;
}
.proj-name {
  font-size: 1rem; font-weight: 600;
  color: var(--ink); letter-spacing: -0.01em;
}
.proj-arrow {
  font-family: var(--mono); color: var(--muted);
  font-size: 1rem; transition: color 0.15s, transform 0.15s;
  flex-shrink: 0;
}
.proj-kind {
  font-family: var(--mono); font-size: 0.65rem;
  color: var(--muted); letter-spacing: 0.06em;
  text-transform: uppercase;
}
.proj-desc {
  font-size: 0.85rem; color: var(--muted);
  line-height: 1.5;
}
.proj-stack {
  display: flex; flex-wrap: wrap; gap: 0.3rem;
  margin-top: 0.25rem;
}
.proj-stack .tag { font-size: 0.65rem; padding: 0.15rem 0.4rem; }

/* small section subheading (within a row) */
.subhead {
  font-family: var(--mono); font-size: 0.7rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin: 2.5rem 0 1rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.subhead::after {
  content: ""; flex: 1; height: 1px;
  background: var(--rule);
}

/* ============================================================
   04 — WRITING: featured + list split
   ============================================================ */

.writing-split {
  display: grid; grid-template-columns: 1fr;
  gap: 1.25rem; margin-top: 0.5rem;
}
@media (min-width: 800px) { .writing-split { grid-template-columns: 1.1fr 1fr; } }

.feat-article {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 10px; padding: 1.5rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  text-decoration: none; color: inherit;
  transition: border-color 0.15s;
}
.feat-article:hover { border-color: var(--accent); }
.feat-article-kind {
  font-family: var(--mono); font-size: 0.65rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent);
}
.feat-article-title {
  font-size: 1.125rem; font-weight: 600;
  color: var(--ink); letter-spacing: -0.01em;
  line-height: 1.3;
}
.feat-article-excerpt {
  font-size: 0.9rem; color: var(--muted);
  line-height: 1.55;
}
.feat-article-cta {
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--accent); letter-spacing: 0.05em;
  margin-top: auto;
}

/* ============================================================
   05 — EDUCATION: pivot flow
   ============================================================ */

.pivot {
  display: grid; grid-template-columns: 1fr;
  gap: 0.875rem; align-items: stretch;
  margin-top: 0.5rem;
}
@media (min-width: 720px) {
  .pivot {
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
  }
}

.pivot-step {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 10px; padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.pivot-step.now {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.pivot-when {
  font-family: var(--mono); font-size: 0.65rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}
.pivot-step.now .pivot-when { color: var(--accent); }
.pivot-degree {
  font-size: 1rem; font-weight: 600;
  color: var(--ink); letter-spacing: -0.005em;
  line-height: 1.3;
}
.pivot-school {
  font-family: var(--mono); font-size: 0.72rem;
  color: var(--muted); letter-spacing: 0.04em;
}
.pivot-arrow {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.4rem; color: var(--accent);
  padding: 0.5rem; font-family: var(--mono);
  font-size: 0.65rem; letter-spacing: 0.1em;
  text-transform: uppercase;
}
.pivot-arrow .glyph {
  font-size: 1.25rem; line-height: 1;
}
@media (max-width: 719px) {
  .pivot-arrow { padding: 0; }
  .pivot-arrow .glyph { transform: rotate(90deg); }
}

/* ============================================================
   06 — PRINCIPLES: oversized display
   ============================================================ */

.principles-display {
  list-style: none; counter-reset: pd;
  display: flex; flex-direction: column;
  gap: 0;
}
.principles-display li {
  counter-increment: pd;
  display: grid; grid-template-columns: 3rem 1fr;
  gap: 1.25rem; align-items: baseline;
  padding: 1.25rem 0;
  border-top: 1px solid var(--rule);
}
.principles-display li:first-child { border-top: none; }
.principles-display li::before {
  content: counter(pd, decimal-leading-zero);
  font-family: var(--mono); font-size: 0.75rem;
  color: var(--accent); letter-spacing: 0.08em;
  align-self: start; padding-top: 0.4rem;
}
.principles-display .principle-text {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  font-weight: 500; color: var(--ink);
  letter-spacing: -0.015em; line-height: 1.3;
}

/* ============================================================
   07 — CONTACT: big CTA + secondary links
   ============================================================ */

.cta-mail {
  display: inline-flex; align-items: baseline; gap: 0.75rem;
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 600; letter-spacing: -0.025em;
  color: var(--ink); text-decoration: none;
  line-height: 1.1; margin: 0.5rem 0 1.5rem;
  transition: color 0.15s;
  word-break: break-word;
}
.cta-mail:hover { color: var(--accent); }
.cta-mail:hover .cta-arrow { transform: translate(3px, -3px); color: var(--accent); }
.cta-arrow {
  display: inline-block; color: var(--muted);
  transition: transform 0.2s, color 0.15s;
  font-weight: 500;
}

.cta-secondary {
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  margin-top: 0.75rem;
  font-family: var(--mono); font-size: 0.8rem;
}
.cta-secondary a {
  color: var(--muted); text-decoration: none;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.15rem;
  transition: color 0.15s, border-color 0.15s;
}
.cta-secondary a:hover { color: var(--accent); border-color: var(--accent); }

/* ============================================================
   MOTION — restrained, professional
   ============================================================ */

/* page-load + scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-stagger="1"] { transition-delay: 0.08s; }
.reveal[data-stagger="2"] { transition-delay: 0.16s; }
.reveal[data-stagger="3"] { transition-delay: 0.24s; }
.reveal[data-stagger="4"] { transition-delay: 0.32s; }

/* ambient hero glow */
.hero { position: relative; }
.hero::before {
  content: "";
  position: absolute;
  top: -4rem; left: -8rem;
  width: 22rem; height: 22rem;
  background: radial-gradient(circle at center,
              var(--accent-dim) 0%,
              transparent 60%);
  filter: blur(40px);
  pointer-events: none;
  z-index: -1;
  opacity: 0;
  animation: hero-glow-in 1.4s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
@keyframes hero-glow-in {
  to { opacity: 1; }
}

/* badge dot pulse */
.badge .dot {
  animation: dot-pulse 2.4s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent); opacity: 1; }
  50% { box-shadow: 0 0 0 6px transparent; opacity: 0.85; }
}

/* inline link underline grow */
a.inline {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  text-decoration: none;
  transition: color 0.2s ease;
}
a.inline:hover {
  color: var(--accent);
}

/* theme toggle icon rotation on swap */
/* removed — dark only */

/* card lift refinements (smoother) */
.work-card,
.work-hero,
.now-card,
.proj,
.feat-article,
.pivot-step {
  transition: border-color 0.2s ease,
              transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1),
              box-shadow 0.25s ease;
}
.work-card:hover,
.work-hero:hover,
.proj:hover,
.feat-article:hover {
  transform: translateY(-2px);
}

/* CTA arrow drift on the work-hero card */
.work-hero .work-hero-cta::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 1px;
  background: currentColor;
  vertical-align: middle;
  margin-left: 0.4rem;
  transition: width 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.work-hero:hover .work-hero-cta::after { width: 1.5rem; }

/* numerical stat — monospace feel for ticking */
.stat-num {
  font-feature-settings: "tnum", "ss01";
  display: inline-block;
  min-width: 1ch;
}

/* reduced motion: respect the user */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .hero::before { animation: none; opacity: 1; }
  .badge .dot { animation: none; }
  .work-card,
  .work-hero,
  .now-card,
  .proj,
  .feat-article,
  .pivot-step {
    transition: none !important;
  }
  .work-card:hover,
  .work-hero:hover,
  .proj:hover,
  .feat-article:hover {
    transform: none !important;
  }
}

/* ============================================================
   MOBILE — tighter spacing, type, density
   ============================================================ */
@media (max-width: 640px) {
  .frame { padding: 4rem 1.25rem 3rem; }
  .hero { padding-bottom: 2rem; }
  .hero h1 { font-size: 2rem; line-height: 1.1; margin-bottom: 1rem; }
  .hero p { font-size: 0.95rem; line-height: 1.5; }
  .badge { margin-bottom: 1.25rem; font-size: 0.65rem; }

  .row { padding: 2rem 0; gap: 1rem; }
  .row.band {
    padding: 1.75rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 12px;
  }
  .row.span { padding-top: 2rem; }
  .row h2 { font-size: 0.95rem; margin-bottom: 0.75rem; }
  .row p { font-size: 0.9rem; line-height: 1.55; }
  .row .display-h2 { font-size: 1.375rem; margin-bottom: 0.875rem; }
  .row .lede { font-size: 0.95rem; margin-bottom: 1.5rem; }

  .meta { font-size: 0.65rem; }
  .section-tag { margin-bottom: 1rem; font-size: 0.65rem; }
  .subhead { margin: 1.75rem 0 0.875rem; font-size: 0.65rem; }

  .now-card { padding: 1rem; gap: 0.4rem; }
  .now-role { font-size: 0.9rem; }
  .now-org { font-size: 0.65rem; }
  .now-desc { font-size: 0.82rem; line-height: 1.5; }
  .now-kind { font-size: 0.6rem; }

  .pillars { gap: 0.875rem; margin-bottom: 1.5rem; }
  .pillar { padding-top: 0.75rem; gap: 0.3rem; }
  .pillar-title { font-size: 0.9rem; }
  .pillar-body { font-size: 0.82rem; line-height: 1.45; }

  .stack-groups { gap: 0.75rem; }
  .stack-group { gap: 0.3rem; }
  .stack-label {
    min-width: 0; width: 100%;
    margin-bottom: 0.2rem; margin-right: 0;
  }
  .tag { font-size: 0.62rem; padding: 0.18rem 0.4rem; }

  .work-hero-main { padding: 1.25rem; gap: 0.7rem; }
  .work-hero-name { font-size: 1.375rem; }
  .work-hero-desc { font-size: 0.875rem; line-height: 1.5; }
  .work-hero-eyebrow { font-size: 0.6rem; }
  .work-hero-cta { font-size: 0.7rem; }
  .stat-cell { padding: 0.875rem 1rem; gap: 0.2rem; }
  .stat-value { font-size: 1.25rem; }
  .stat-value .unit { font-size: 0.6rem; }
  .stat-label { font-size: 0.58rem; }

  .work-item { padding: 1.25rem 0; }
  .work-item-name { font-size: 0.95rem; }
  .work-item-org { font-size: 0.65rem; }
  .work-item p { font-size: 0.85rem; line-height: 1.5; }

  .proj { padding: 1rem; gap: 0.5rem; }
  .proj-name { font-size: 0.95rem; }
  .proj-kind { font-size: 0.6rem; }
  .proj-desc { font-size: 0.8rem; line-height: 1.5; }
  .proj-stack .tag { font-size: 0.58rem; }

  .feat-article { padding: 1.25rem; gap: 0.6rem; }
  .feat-article-title { font-size: 1rem; line-height: 1.3; }
  .feat-article-excerpt { font-size: 0.85rem; line-height: 1.5; }
  .feat-article-kind { font-size: 0.6rem; }
  .list-item { font-size: 0.85rem; padding: 0.65rem 0; }
  .list-item-date { font-size: 0.6rem; }

  .pivot { gap: 0.5rem; }
  .pivot-step { padding: 1rem; gap: 0.3rem; }
  .pivot-degree { font-size: 0.9rem; }
  .pivot-school { font-size: 0.65rem; }
  .pivot-arrow { padding: 0.25rem; font-size: 0.6rem; }
  .pivot-arrow .glyph { font-size: 1.1rem; }

  .principles-display li {
    grid-template-columns: 2rem 1fr;
    gap: 0.75rem;
    padding: 0.875rem 0;
  }
  .principles-display .principle-text { font-size: 1rem; line-height: 1.4; }
  .principles-display li::before { font-size: 0.65rem; padding-top: 0.25rem; }

  .cta-mail { font-size: 1.375rem; gap: 0.5rem; margin: 0.5rem 0 1.25rem; }
  .cta-secondary { gap: 1rem; font-size: 0.75rem; }

  /* hero ambient glow scaled down on mobile */
  .hero::before {
    width: 14rem; height: 14rem;
    top: -2rem; left: -3rem;
    filter: blur(30px);
  }

  footer { font-size: 0.65rem; }
}
