/* =========================================================
   Tokens
   ========================================================= */
:root {
  --paper: #f5f1ea;
  --paper-2: #ebe4d7;
  --surface: #fffdf9;
  --ink: #221f1a;
  --ink-2: #5b564d;
  --ink-3: #8a8378;
  --line: #e2dac9;
  --line-soft: rgba(34, 31, 26, 0.08);
  --accent: #d9480f;
  --accent-ink: #a83205;
  --green: #127a4b;
  --amber: #f2ae2e;
  --grad: linear-gradient(100deg, #d9480f 0%, #e56b1f 40%, #f2ae2e 100%);
  --grad-text: linear-gradient(100deg, #d9480f, #3355ff 90%);
  --ring: #d9480f;
  --shadow-sm: 0 1px 2px rgba(34, 31, 26, 0.05), 0 8px 24px -14px rgba(34, 31, 26, 0.18);
  --shadow-md: 0 2px 6px rgba(34, 31, 26, 0.05), 0 18px 44px -20px rgba(34, 31, 26, 0.28);
  --shadow-lg: 0 4px 12px rgba(34, 31, 26, 0.06), 0 34px 70px -30px rgba(34, 31, 26, 0.42);
  --radius: 18px;
  --radius-lg: 26px;
  --maxw: 1140px;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
  --header-h: 68px;
}

[data-theme="dark"] {
  --paper: #131110;
  --paper-2: #1b1816;
  --surface: #1f1b18;
  --ink: #efe9e0;
  --ink-2: #a89f92;
  --ink-3: #71695e;
  --line: #2e2a24;
  --line-soft: rgba(239, 233, 224, 0.08);
  --accent: #ff7a3d;
  --accent-ink: #ffb28f;
  --green: #5dc98f;
  --amber: #ffd37a;
  --grad: linear-gradient(100deg, #ff7a3d 0%, #ffab5e 45%, #ffd37a 100%);
  --grad-text: linear-gradient(100deg, #ff7a3d, #8fa2ff 90%);
  --ring: #ff7a3d;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -14px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.3), 0 18px 44px -20px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.35), 0 34px 70px -30px rgba(0, 0, 0, 0.65);
}

/* =========================================================
   Reset & base
   ========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 18px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.06rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  transition: background 0.35s ease, color 0.35s ease;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: var(--accent-ink);
}

img {
  max-width: 100%;
  display: block;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--line-soft);
  padding: 0.12em 0.4em;
  border-radius: 6px;
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 2px 7px;
  white-space: nowrap;
}

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 200;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  left: 8px;
}

.container {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 32px);
}

.wrap {
  display: block;
}

.anchor {
  display: block;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.icon--small {
  width: 15px;
  height: 15px;
}

/* Role / aria helpers */
[hidden] {
  display: none !important;
}

/* =========================================================
   Grain + scroll progress
   ========================================================= */
.grain {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

[data-theme="dark"] .grain {
  opacity: 0.07;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 120;
  background: transparent;
}

.scroll-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--grad);
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 110;
  height: var(--header-h);
  background: transparent;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 0 4px var(--line-soft);
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.logo:hover .logo-mark {
  transform: rotate(360deg) scale(1.15);
}

.logo-accent {
  color: var(--ink-3);
}

.site-nav {
  display: flex;
  gap: 2px;
}

.site-nav a {
  position: relative;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink-2);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 10px;
  transition: color 0.2s ease, background 0.2s ease;
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--line-soft);
}

.site-nav a.is-active {
  color: var(--ink);
}

.site-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 3px;
  border-radius: 3px;
  background: var(--grad);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-trigger,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  height: 40px;
  padding: 0 12px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-trigger:hover,
.theme-toggle:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.search-trigger kbd {
  margin-left: 2px;
}

.search-trigger__label {
  padding-right: 2px;
}

.theme-toggle {
  width: 40px;
  justify-content: center;
  padding: 0;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.menu-toggle svg {
  width: 18px;
  height: 18px;
}

.menu-toggle:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.theme-toggle .theme-toggle__moon,
[data-theme="dark"] .theme-toggle__sun {
  display: none;
}

[data-theme="dark"] .theme-toggle__moon {
  display: block;
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  padding: calc(var(--header-h) + 64px) 0 0;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(840px 420px at 85% 8%, rgba(255, 178, 63, 0.16), transparent 62%),
    radial-gradient(700px 380px at 5% 30%, rgba(51, 85, 255, 0.08), transparent 60%);
}

.hero-inner {
  position: relative;
  max-width: 900px;
  padding-block: clamp(40px, 7vw, 96px);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(18, 122, 75, 0.45);
  animation: pulse 2.2s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(18, 122, 75, 0.45); }
  70% { box-shadow: 0 0 0 9px rgba(18, 122, 75, 0); }
  100% { box-shadow: 0 0 0 0 rgba(18, 122, 75, 0); }
}

.hero-eyebrow__text {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: -0.01em;
}

.hero-title {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  max-width: 18ch;
  margin-bottom: 28px;
}

.hero-title__highlight {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
  position: relative;
}

.hero-title__highlight::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.06em;
  height: 0.32em;
  z-index: -1;
  background: var(--amber);
  opacity: 0.55;
  border-radius: 4px;
  transform: rotate(-0.8deg);
}

.hero-intro {
  font-size: 1.18rem;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: 58ch;
  margin-bottom: 38px;
}

.hero-intro strong {
  color: var(--ink);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 56px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 14px 48px;
  margin: 0;
  padding-top: 34px;
  border-top: 1px solid var(--line);
  width: fit-content;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat dt {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.stat dd {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.stat dd sup {
  font-size: 0.6em;
  color: var(--accent);
}

.hero-scroll-hint {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.hero-scroll-hint__line {
  width: 1px;
  height: 46px;
  background: linear-gradient(var(--ink-3), transparent);
  animation: drip 2s ease-in-out infinite;
}

@keyframes drip {
  0% { transform: scaleY(0); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: top; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.22s ease, border-color 0.2s ease;
}

.btn--primary {
  background: var(--ink);
  color: var(--paper);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.btn--ghost:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn--block {
  width: 100%;
}

/* =========================================================
   Sections
   ========================================================= */
.section {
  padding-block: clamp(64px, 9vw, 104px);
  position: relative;
}

.section--tinted {
  background: var(--paper-2);
  border-block: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(36px, 5vw, 52px);
}

.section-head__meta {
  max-width: 620px;
}

.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
}

.section-sub {
  color: var(--ink-2);
  max-width: 34ch;
  font-size: 1rem;
}

/* =========================================================
   Expertise
   ========================================================= */
.expertise-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.expertise-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow-sm);
}

.expertise-card__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.expertise-card__icon {
  font-size: 1.5rem;
  color: var(--accent);
}

.expertise-card h3 {
  font-size: 1.35rem;
}

.expertise-card__level {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green);
  border: 1px solid color-mix(in srgb, var(--green) 40%, transparent);
  padding: 4px 9px;
  border-radius: 999px;
}

.skill-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.skill-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-2);
}

.bar {
  width: 92px;
  height: 6px;
  border-radius: 6px;
  background: var(--line-soft);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 6px;
  background: var(--grad);
  transition: width 1.1s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.bar--95 { --w: 95%; }
.bar--92 { --w: 92%; }
.bar--94 { --w: 94%; }
.bar--93 { --w: 93%; }
.bar--91 { --w: 91%; }
.bar--88 { --w: 88%; }
.bar--90 { --w: 90%; }
.bar--86 { --w: 86%; }
.bar--89 { --w: 89%; }
.bar--78 { --w: 78%; }
.bar--80 { --w: 80%; }
.bar--74 { --w: 74%; }
.bar--82 { --w: 82%; }
.bar--70 { --w: 70%; }
.bar--76 { --w: 76%; }
.bar--84 { --w: 84%; }

.is-inview .bar i {
  width: var(--w);
}

.expertise-card__note {
  margin-top: auto;
  font-size: 0.92rem;
  color: var(--ink-3);
  border-top: 1px dashed var(--line);
  padding-top: 16px;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  align-items: stretch;
}

.profile-text {
  color: var(--ink-2);
  font-size: 1.02rem;
  line-height: 1.7;
}

.split-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 10px 0 4px;
}

/* =========================================================
   Timeline
   ========================================================= */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 820px;
}

.timeline-card {
  position: relative;
  display: flex;
  gap: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s ease, box-shadow 0.3s ease;
}

.timeline-card:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-md);
}

.timeline-dot {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--grad);
  margin-top: 7px;
  box-shadow: 0 0 0 5px var(--line-soft);
}

.timeline-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.timeline-co {
  color: var(--ink-3);
  font-size: 0.9em;
}

.timeline-desc {
  color: var(--ink-2);
  max-width: 64ch;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.timeline-tags span {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-2);
  border: 1px solid var(--line);
  padding: 4px 11px;
  border-radius: 999px;
}

.timeline-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-list li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-2);
  font-size: 0.96rem;
}

.timeline-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.58em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad);
}

/* =========================================================
   Ticker
   ========================================================= */
.ticker {
  position: relative;
  z-index: 1;
  border-block: 1px solid var(--line);
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

.ticker__track {
  display: flex;
  width: max-content;
  animation: ticker 34s linear infinite;
}

.ticker:hover .ticker__track {
  animation-play-state: paused;
}

.ticker__track span {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 15px 8px;
  white-space: nowrap;
}

.ticker__track span::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin: 0 42px 2px;
}

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* =========================================================
   Contact extras
   ========================================================= */
.copy-btn {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 4px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
  transform: translateY(-1px);
}

.copy-btn.is-copied {
  border-color: var(--green);
  color: var(--green);
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.status-line .status-dot {
  width: 9px;
  height: 9px;
}

/* =========================================================
   Contact
   ========================================================= */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(40px, 6vw, 72px);
  align-items: start;
}

.contact-intro {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-body {
  color: var(--ink-2);
  max-width: 48ch;
}

.contact-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-list__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.contact-list a {
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.contact-list a:hover {
  border-bottom-color: var(--accent);
  color: var(--accent-ink);
}

.contact-list__row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.contact-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3vw, 36px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow-md);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field label {
  font-size: 0.92rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  font-family: inherit;
  font-size: 0.98rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-3);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.field textarea {
  resize: vertical;
  min-height: 120px;
}

.form-status {
  font-size: 0.92rem;
  font-weight: 700;
  min-height: 1.4em;
}

.form-status.is-error {
  color: var(--accent);
}

.form-status.is-ok {
  color: var(--green);
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  padding-block: 56px 44px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  text-align: center;
}

.footer-wordmark {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(3.4rem, 9vw, 6.5rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.9;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0.9;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  justify-content: center;
}

.footer-nav a {
  font-weight: 700;
  color: var(--ink-2);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--accent-ink);
}

.footer-line {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.88rem;
  color: var(--ink-3);
}

/* =========================================================
   Toast
   ========================================================= */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translate(-50%, 140%);
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px 22px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.toast.is-visible {
  transform: translate(-50%, 0);
}

.toast__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 25%, transparent);
}

/* =========================================================
   Back to top
   ========================================================= */
.back-to-top {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 120;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

/* =========================================================
   Command palette
   ========================================================= */
.palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: color-mix(in srgb, var(--ink) 42%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 20px 40px;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.palette-backdrop.is-open {
  opacity: 1;
}

.palette {
  width: min(620px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(-10px) scale(0.98);
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

.palette-backdrop.is-open .palette {
  transform: translateY(0) scale(1);
}

.palette__field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.palette__field .icon {
  color: var(--ink-3);
}

.palette__field input {
  flex: 1;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 1.06rem;
  color: var(--ink);
}

.palette__field input:focus,
.palette__field input:focus-visible {
  outline: none;
}

.palette__hint {
  padding: 10px 18px;
  font-size: 0.82rem;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line-soft);
}

.palette__results {
  list-style: none;
  margin: 0;
  padding: 8px;
  max-height: 300px;
  overflow: auto;
}

.palette__results li a,
.palette__jumps li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
}

.palette__results li a:hover,
.palette__results li a.is-active {
  background: var(--line-soft);
}

.palette__results .pm-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.palette__results .pm-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-3);
}

.palette__jumps {
  list-style: none;
  margin: 0;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  border-top: 1px solid var(--line);
}

.palette__jumps li a {
  font-weight: 600;
  font-size: 0.92rem;
}

.palette__jumps span {
  color: var(--ink-3);
}

/* =========================================================
   Extra UX polish
   ========================================================= */

/* Page mount fade */
.wrap {
  animation: page-in 0.55s ease both;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Anchor offset (belt & suspenders with html scroll-padding) */
section[id] {
  scroll-margin-top: calc(var(--header-h) + 18px);
}

/* Target section flash when arriving via nav / palette */
section[id]:target {
  animation: target-flash 0.9s ease;
}

@keyframes target-flash {
  0% { background-color: color-mix(in srgb, var(--amber) 26%, transparent); }
  100% { background-color: transparent; }
}

/* Expertise cards — lift + glow + icon micro-interactions */
.expertise-card {
  transition: transform 0.22s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.expertise-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: var(--shadow-md), 0 14px 46px -20px color-mix(in srgb, var(--accent) 45%, transparent);
}

.expertise-card__icon {
  display: inline-block;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
}

.expertise-card:hover .expertise-card__icon {
  transform: rotate(-8deg) scale(1.18);
}

/* Skill rows — hover accent */
.skill-list li {
  transition: color 0.2s ease;
}

.skill-list li:hover {
  color: var(--ink);
}

.skill-list .bar i {
  transition: width 1.1s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.2s ease;
}

.skill-list li:hover .bar i {
  filter: brightness(1.12);
}

/* Timeline micro */
.timeline-dot {
  transition: transform 0.25s ease;
}

.timeline-card:hover .timeline-dot {
  transform: scale(1.3);
}

.timeline-tags span {
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.timeline-tags span:hover {
  color: var(--accent-ink);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* Button arrow nudge */
.btn .icon--small {
  transition: transform 0.22s ease;
}

.btn:hover .icon--small {
  transform: translateX(4px);
}

/* Form error shake */
.field input.is-error,
.field select.is-error,
.field textarea.is-error {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Print-only resume header (hidden on screen) */
.print-only {
  display: none;
}

/* =========================================================
   Reveal animations
   ========================================================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}

[data-reveal].is-inview {
  opacity: 1;
  transform: none;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1120px) {
  .search-trigger__label,
  .search-trigger kbd {
    display: none;
  }

  .search-trigger {
    width: 40px;
    justify-content: center;
    padding: 0;
  }
}

@media (max-width: 960px) {
  .menu-toggle {
    display: inline-flex;
  }

  .logo {
    font-size: 0.96rem;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px clamp(20px, 4vw, 32px) 16px;
    background: color-mix(in srgb, var(--paper) 96%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  }

  .site-nav a {
    padding: 13px 14px;
  }

  .site-nav a.is-active::after {
    left: 14px;
    right: auto;
    width: 34px;
    bottom: 6px;
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .search-trigger__label {
    display: none;
  }

  .search-trigger {
    width: 40px;
    justify-content: center;
    padding: 0;
  }

  .search-trigger kbd {
    display: none;
  }

  .expertise-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .split-grid {
    grid-template-columns: 1fr;
  }

  .hero-title__highlight {
    white-space: normal;
  }

  .footer-wordmark {
    font-size: clamp(2rem, 9vw, 6.5rem);
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
  }

  .field-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .palette__jumps {
    grid-template-columns: 1fr;
  }

  .hero-scroll-hint {
    display: none;
  }
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* =========================================================
   Print
   ========================================================= */
@media print {
  html[data-theme] {
    --paper: #fff;
    --paper-2: #fff;
    --surface: #fff;
    --ink: #000;
    --ink-2: #222;
    --ink-3: #555;
    --line: #bbb;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
  }

  .grain,
  .scroll-progress,
  .site-header,
  .back-to-top,
  .palette-backdrop,
  .toast,
  .ticker,
  .theme-toggle,
  .search-trigger,
  .hero-scroll-hint,
  .status-dot,
  .contact-form,
  .copy-btn,
  .hero-actions {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-only {
    display: block;
    border-bottom: 2px solid #000;
    padding-bottom: 14px;
    margin-bottom: 24px;
  }

  .print-only h2 {
    font-family: var(--font-serif);
    font-size: 1.7rem;
    margin-bottom: 4px;
  }

  .print-only p {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #222;
    margin: 0 0 6px;
  }

  .print-only ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    font-size: 0.76rem;
    color: #222;
  }

  .print-only li::after {
    content: " ·";
  }

  .print-only li:last-child::after {
    content: "";
  }

  .hero {
    padding-top: 24px;
  }

  .hero-inner {
    padding-block: 8px 20px;
  }

  .section {
    padding-block: 28px;
  }

  .section--tinted,
  .site-footer {
    background: #fff;
    border-color: #ccc;
  }

  .expertise-card,
  .timeline-card {
    break-inside: avoid;
  }

  .skill-list .bar i {
    width: var(--w) !important;
  }

  .hero-title__highlight {
    -webkit-text-fill-color: #000;
    color: #000;
    background: none;
  }

  .footer-wordmark {
    background: none;
    -webkit-text-fill-color: #000;
    color: #000;
    opacity: 1;
  }

  .footer-nav {
    display: none;
  }

  .btn,
  a {
    text-decoration: underline;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}