/* Hallmark · genre: modern-minimal · macrostructure: Portfolio Grid (adapted: hero + composed sections)
 * theme: Cobalt · enrichment: Tier A/B hand-built (terminal hero card + SVG case-study glyphs)
 * nav: N1b SaaS three-section · footer: Ft5 Statement
 * audience: technical hiring managers / CTOs evaluating contract or FTE backend-edge work
 * use case: open the résumé PDF or reach out via LinkedIn
 * tone: technical — precise, dense with real specifics, no hype
 */

@import url("tokens.css");

/* ===== Reset ===== */

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink-2);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-ink);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0;
}

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ===== Layout ===== */

.wrap {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

section { padding-block: var(--space-3xl); }
section + section { border-top: var(--rule-hair) solid var(--color-rule); }

.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  max-width: 46ch;
  margin-bottom: var(--space-2xl);
}
.section-head__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-neutral);
}
.section-head h2 {
  font-size: var(--text-2xl);
}
.section-head p {
  color: var(--color-muted);
  font-size: var(--text-md);
  line-height: 1.5;
}

/* ===== Motion / reveal ===== */

.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== Buttons / links ===== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background-color var(--dur-short) var(--ease-out),
              border-color var(--dur-short) var(--ease-out),
              transform var(--dur-micro) var(--ease-out);
}
.btn:active { transform: translateY(1px); }

.btn--accent {
  background: var(--color-accent);
  color: var(--color-accent-ink);
}
.btn--accent:hover { background: oklch(50% 0.20 256); }

.btn--outline {
  background: transparent;
  border-color: var(--color-rule-2);
  color: var(--color-ink-2);
}
.btn--outline:hover { border-color: var(--color-accent); color: var(--color-ink); }

.link-arrow {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  font-weight: 600;
  color: var(--color-ink);
  border-bottom: 1px solid var(--color-rule-2);
  padding-bottom: 1px;
  transition: border-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out);
}
.link-arrow:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* ===== Disclosure bar ===== */

.disclosure-bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: calc(var(--z-sticky) + 1);
  padding-block: 0.45rem;
  background: var(--color-graphite);
  border-bottom: 1px solid oklch(30% 0.016 260);
}
.disclosure-bar__inner {
  width: 100%;
}
.disclosure-bar span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--color-graphite-muted);
  text-align: center;
}
.disclosure-bar strong {
  color: var(--color-accent-code);
  font-weight: 600;
}

@media (max-width: 40rem) {
  .disclosure-bar span { text-align: left; }
}

/* ===== Nav — N1b bordered, frost on scroll ===== */

.nav {
  position: fixed;
  top: var(--banner-h);
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color var(--dur-long) var(--ease-out),
              border-color var(--dur-long) var(--ease-out),
              box-shadow var(--dur-long) var(--ease-out);
}
.nav.is-scrolled {
  background: color-mix(in oklch, var(--color-paper) 82%, transparent);
  backdrop-filter: blur(14px) saturate(160%);
  border-bottom-color: var(--color-rule);
}
.nav__inner {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
  height: var(--nav-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-md);
}
.nav__brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-md);
  color: var(--color-ink);
  letter-spacing: -0.01em;
}
.nav__brand span { color: var(--color-accent); }
.nav__center {
  justify-self: center;
  display: flex;
  gap: var(--space-lg);
}
.nav__link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-ink-2);
  white-space: nowrap;
  transition: color var(--dur-short) var(--ease-out);
}
.nav__link:hover { color: var(--color-accent); }
.nav__right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

@media (max-width: 60rem) {
  .nav__center { display: none; }
}

/* ===== Hero ===== */

.hero {
  padding-top: calc(var(--banner-h) + var(--nav-h) + var(--space-3xl));
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-2xl);
  align-items: center;
}
.hero__grid > div {
  max-width: 54ch;
}
.hero__portrait {
  margin: 0;
  justify-self: center;
  width: min(100%, 22rem);
}
.hero__portrait img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--color-rule-2);
}
.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-md);
}
.hero__eyebrow::before { content: "● "; }
.hero h1 {
  font-size: clamp(1.5rem, 1.6vw + 1.15rem, 2.25rem);
  line-height: 1.3;
  overflow-wrap: anywhere;
  min-width: 0;
}
.hero h1 em {
  font-style: normal;
  color: var(--color-accent);
}
.hero__lede {
  margin-top: var(--space-lg);
  font-size: var(--text-md);
  color: var(--color-muted);
  max-width: 46ch;
  line-height: 1.6;
}
.hero__actions {
  margin-top: var(--space-xl);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
}
.hero__meta {
  margin-top: var(--space-2xl);
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-neutral);
}
.hero__meta strong { color: var(--color-ink-2); font-weight: 600; }

/* ===== Expertise — F3 tabular spec sheet ===== */

.spec-sheet {
  width: 100%;
  border-collapse: collapse;
}
.spec-sheet tr { border-top: 1px solid var(--color-rule); }
.spec-sheet tr:first-child { border-top: 1px solid var(--color-rule-2); }
.spec-sheet tr:last-child { border-bottom: 1px solid var(--color-rule-2); }
.spec-sheet td, .spec-sheet th {
  padding: var(--space-lg) var(--space-sm);
  text-align: left;
  vertical-align: top;
}
.spec-sheet th {
  width: 15rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-ink);
  font-weight: 600;
}
.spec-sheet td {
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 1.7;
}
.spec-sheet td b { color: var(--color-ink-2); font-weight: 500; }

@media (max-width: 40rem) {
  .spec-sheet, .spec-sheet tbody, .spec-sheet tr, .spec-sheet td, .spec-sheet th {
    display: block;
    width: auto;
  }
  .spec-sheet tr { padding-block: var(--space-md); }
  .spec-sheet th { padding-bottom: var(--space-2xs); }
  .spec-sheet td { padding-top: 0; }
}

/* ===== Work — Portfolio Grid ===== */

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--color-rule);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.work-card {
  background: var(--color-paper);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  transition: background-color var(--dur-short) var(--ease-out);
}
.work-card:hover { background: var(--color-paper-2); }
.work-card__glyph {
  width: 2.75rem;
  height: 2.75rem;
  color: var(--color-accent);
}
.work-card h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-ink);
}
.work-card p {
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 1.65;
}
.work-card__meta {
  margin-top: auto;
  padding-top: var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-neutral);
  border-top: 1px solid var(--color-rule);
}

.work-card--wide {
  grid-column: 1 / -1;
}
.work-card--wide p {
  max-width: 78ch;
}

@media (max-width: 48rem) {
  .work-grid { grid-template-columns: 1fr; }
}

/* ===== Stack — tag chips ===== */

.tag-wall {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}
.tag-chip {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--color-rule-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-ink-2);
  letter-spacing: 0.01em;
  transition: border-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out);
}
.tag-chip:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* ===== Timeline — F4 step sequence ===== */

.steps {
  display: flex;
  flex-direction: column;
}
.steps li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: var(--space-lg);
  padding-block: var(--space-lg);
  border-top: 1px solid var(--color-rule);
}
.steps li:last-child { border-bottom: 1px solid var(--color-rule); }
.steps .stage {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-accent);
  padding-top: 0.2em;
}
.steps h3 {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--color-ink);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5em;
}
.steps h3 .role { color: var(--color-ink); }
.steps h3 .period {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-neutral);
  letter-spacing: 0.01em;
}
.steps p {
  margin-top: var(--space-xs);
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 1.65;
  max-width: 62ch;
}

@media (max-width: 40rem) {
  .steps li { grid-template-columns: 1fr; gap: var(--space-2xs); }
}

/* ===== Footer — Ft5 Statement ===== */

.foot-stmt {
  padding-block: var(--space-xl) var(--space-2xl);
}
.foot-stmt__line {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4.2vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--color-ink);
  max-width: 22ch;
  margin: 0;
}
.foot-stmt__line em {
  font-style: normal;
  color: var(--color-accent);
}
.foot-stmt__actions {
  margin-top: var(--space-xl);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}
.foot-stmt__meta {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-rule);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
  font-size: var(--text-sm);
}
.foot-stmt__meta .wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-ink);
}
.foot-stmt__meta .foot-links {
  display: flex;
  gap: var(--space-lg);
}
.foot-stmt__meta .foot-links a { color: var(--color-ink-2); transition: color var(--dur-short) var(--ease-out); }
.foot-stmt__meta .foot-links a:hover { color: var(--color-accent); }
.foot-stmt__meta .muted { color: var(--color-neutral); font-family: var(--font-mono); font-size: var(--text-xs); }

.foot-stmt__disclosure {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-rule);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.6;
  color: var(--color-neutral);
  max-width: 62ch;
}
.foot-stmt__disclosure strong { color: var(--color-ink-2); font-weight: 600; }

/* ===== Responsive — hero / general collapse ===== */

@media (max-width: 60rem) {
  .hero { padding-top: calc(var(--banner-h) + var(--nav-h) + var(--space-2xl)); }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__portrait { order: -1; width: 9rem; justify-self: start; }
}

@media (max-width: 40rem) {
  section { padding-block: var(--space-2xl); }
  .hero h1 { font-size: var(--text-display-s); }
  .foot-stmt__meta { flex-direction: column; align-items: flex-start; }
}
