/* ==========================================================================
   Clean, rounded, minimal. The hero receipt is the one "paper" moment.
   ========================================================================== */
:root {
  --bg: #0b0b0c;
  --surface: #161618;
  --surface-2: #1d1d20;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #6e6e73;

  --accent: #ffb000;
  --accent-soft: rgba(255, 176, 0, 0.12);
  --green: #30d158;

  --paper: #f4f0e6;
  --ink: #26231d;
  --ink-dim: #736c5c;
  --stamp: #c0392b;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 22px;
  --radius-sm: 14px;
  --gutter: 16px;
  --topbar-h: 56px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  overflow-x: hidden;
}

a { color: inherit; }
img, video { max-width: 100%; display: block; }

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: 8px; top: -60px;
  background: var(--text);
  color: #000;
  padding: 8px 14px;
  border-radius: 999px;
  z-index: 100;
}
.skip:focus { top: 8px; }

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

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top);
  background: rgba(11, 11, 12, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--topbar-h);
}
.brand {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.nav { display: flex; gap: 4px; }
.nav a {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="true"] { color: var(--text); background: rgba(255, 255, 255, 0.08); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  font: 500 15px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.28); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #111; }
.btn.primary:hover { background: #ffc03a; }
.btn.small { min-height: 36px; padding: 8px 14px; font-size: 14px; }
.btn[disabled] { opacity: 0.5; cursor: progress; }

/* ---------- Section headings ---------- */
.section {
  padding: 112px 0;
  scroll-margin-top: var(--topbar-h);
}
.section + .section { padding-top: 40px; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}
.section-h {
  margin: 0 0 44px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.sub-h {
  margin: 56px 0 16px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Scroll reveal (only when motion is allowed) */
.motion .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.motion .reveal.in { opacity: 1; transform: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 88px 0 72px;
  scroll-margin-top: var(--topbar-h);
  overflow-x: hidden;
  overflow-x: clip;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: 70%;
  height: 120%;
  background: radial-gradient(closest-side, var(--accent-soft), transparent);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 56px;
  align-items: center;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 24px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  color: var(--text-2);
}
.status::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(48, 209, 88, 0.7);
}
.hero h1 {
  margin: 0;
  font-size: clamp(48px, 8vw, 92px);
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: -0.045em;
}
.pitch {
  margin: 22px 0 0;
  max-width: 24ch;
  font-size: clamp(20px, 2.6vw, 26px);
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text-2);
}
.pitch strong { color: var(--text); font-weight: 500; }
.hero-meta { margin: 16px 0 0; color: var(--text-3); font-size: 15px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* ---------- Receipt (hero only) ---------- */
.slip {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  filter: drop-shadow(0 28px 40px rgba(0, 0, 0, 0.6)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4));
}
.paper { position: relative; }
.js .paper.pending { clip-path: inset(0 0 100% 0); }
.paper.printing { transition: clip-path 70ms linear; }

.edge {
  height: 9px;
  background: var(--paper);
  -webkit-mask-size: 14px 9px;
  mask-size: 14px 9px;
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
}
.edge.top {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M0 9L7 0l7 9z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M0 9L7 0l7 9z'/%3E%3C/svg%3E");
}
.edge.bot {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M0 0h14L7 9z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M0 0h14L7 9z'/%3E%3C/svg%3E");
}

.receipt {
  position: relative;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.035), transparent 6%, transparent 94%, rgba(0, 0, 0, 0.035)),
    var(--paper);
  color: var(--ink);
  padding: 16px 22px 18px;
  font: 400 13px/1.55 var(--mono);
  text-shadow: 0 0 0.35px rgba(38, 35, 29, 0.6);
}
.ln + .ln { margin-top: 1px; }
.c { text-align: center; }
.sm { font-size: 11.5px; color: var(--ink-dim); }
.up { text-transform: uppercase; }
.big { font-size: 20px; font-weight: 700; letter-spacing: 0.1em; line-height: 1.25; }
.hr { height: 0; margin: 10px 0; border-top: 1.5px dashed var(--ink); opacity: 0.55; }
.hr.double { border-top: 4px double var(--ink); opacity: 0.7; }
.split { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row { display: flex; align-items: baseline; gap: 8px; }
.row .q { flex: 0 0 2.2em; }
.row .l { min-width: 0; }
.row .dots { flex: 1 1 12px; min-width: 12px; border-bottom: 1.5px dotted var(--ink-dim); transform: translateY(-4px); }
.row .v { white-space: nowrap; font-weight: 600; }
.row.head { font-size: 11px; color: var(--ink-dim); }
.row.head .dots { visibility: hidden; }
.row.total { font-size: 16px; font-weight: 700; }
.barcode { display: block; width: 78%; height: 42px; margin: 6px auto 2px; fill: var(--ink); }

.stamp {
  position: absolute;
  right: 10px;
  bottom: 34px;
  padding: 4px 10px;
  border: 3px solid var(--stamp);
  border-radius: 4px;
  color: var(--stamp);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.12em;
  transform: rotate(-12deg);
  opacity: 0;
  text-shadow: none;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.paper.done .stamp { opacity: 0.85; animation: stamp 0.28s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes stamp {
  from { opacity: 0; transform: rotate(-12deg) scale(1.9); }
  to { opacity: 0.85; transform: rotate(-12deg) scale(1); }
}
.slip.torn { animation: tear 0.35s ease-out; }
@keyframes tear {
  30% { transform: translateY(3px) rotate(-0.5deg); }
  70% { transform: translateY(-1px) rotate(0.2deg); }
}

/* ---------- Cards (shared) ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ---------- Experience ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.stat { padding: 24px 24px 22px; }
.stat-v {
  display: block;
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.stat-l { display: block; margin-top: 6px; font-size: 14px; color: var(--text-2); }

.roles { list-style: none; margin: 0; padding: 0 28px; }
.role {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 24px;
  padding: 28px 0;
}
.role + .role { border-top: 1px solid var(--border); }
.role-dates { font-size: 14px; color: var(--text-3); padding-top: 3px; }
.role-co { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.015em; }
.role-title { margin: 2px 0 0; color: var(--text-2); font-size: 15px; }
.role-title span { color: var(--text-3); }
.points { margin: 12px 0 0; padding: 0; list-style: none; }
.points li {
  position: relative;
  padding-left: 18px;
  color: var(--text-2);
  font-size: 15px;
}
.points li + li { margin-top: 6px; }
.points li::before {
  content: "";
  position: absolute;
  left: 2px; top: 0.68em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-3);
}

.earlier { list-style: none; margin: 0; padding: 4px 24px; }
.earlier li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 20px;
  padding: 16px 0;
}
.earlier li + li { border-top: 1px solid var(--border); }
.earlier .e-name { font-weight: 600; font-size: 16px; }
.earlier .e-name span { font-weight: 400; color: var(--text-2); }
.earlier .e-dates { font-size: 14px; color: var(--text-3); text-align: right; white-space: nowrap; }
.earlier .e-note { grid-column: 1 / -1; font-size: 14px; color: var(--text-2); }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pills li {
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-2);
}
.langs { margin: 14px 0 0; font-size: 14px; color: var(--text-3); }

/* ---------- Projects ---------- */
.projects {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.project {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  scroll-margin-top: calc(var(--topbar-h) + 20px);
  transition: transform 0.35s var(--ease), border-color 0.35s;
}
@media (hover: hover) {
  .project:hover { transform: translateY(-4px); border-color: var(--border-strong); }
}
.media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.media img, .media video { width: 100%; height: 100%; object-fit: cover; }
.media-ph {
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  background:
    radial-gradient(120% 90% at 20% 0%, hsla(var(--h, 40), 90%, 55%, 0.22), transparent 60%),
    radial-gradient(100% 80% at 100% 100%, hsla(calc(var(--h, 40) + 40), 80%, 50%, 0.12), transparent 60%),
    var(--surface-2);
}
.media-ph b {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-strong);
  font-size: 28px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}
.media-ph span { font-size: 13px; color: var(--text-3); }

.project-body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 24px; }
.project h3 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
.project p { margin: 8px 0 0; color: var(--text-2); font-size: 15px; }
.tags { margin-top: 10px !important; font-size: 13px !important; color: var(--text-3) !important; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 20px; }

/* ---------- Contact ---------- */
.contact-card {
  max-width: 680px;
  margin: 0 auto;
  padding: 36px;
}
.contact-card .section-h { margin-bottom: 10px; }
.contact-note { margin: 0; color: var(--text-2); font-size: 17px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 8px; }
.divider { height: 1px; margin: 30px 0 24px; background: var(--border); }
.form-h { margin: 0 0 4px; font-size: 17px; font-weight: 600; }

.field { display: grid; gap: 6px; margin-top: 16px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field input,
.field textarea {
  width: 100%;
  font: 400 16px/1.5 var(--sans); /* 16px stops iOS zoom-on-focus */
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.hp { position: absolute; left: -9999px; }
.send { width: 100%; margin-top: 20px; min-height: 50px; }
.form-status { min-height: 1.5em; margin: 12px 0 0; font-size: 14px; color: var(--text-2); text-align: center; }

/* ---------- Footer ---------- */
.footer {
  padding: 40px 0 calc(48px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 13px;
}
.footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer a { color: var(--text-2); text-decoration: none; }
.footer a:hover { color: var(--text); }

.noscript { padding: 40px var(--gutter); text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
  .projects { grid-template-columns: 1fr; }
  .role { grid-template-columns: 1fr; gap: 4px; }
  .role-dates { padding-top: 0; order: -1; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .brand { display: none; }
  .topbar-inner { justify-content: center; }
  .nav { width: 100%; justify-content: space-between; }
  .nav a { padding: 7px 10px; font-size: 14px; }
  .hero { padding: 48px 0 56px; }
  .section { padding: 72px 0; }
  .section + .section { padding-top: 24px; }
  .section-h { margin-bottom: 28px; }
  .stats { grid-template-columns: 1fr; gap: 10px; }
  .stat { padding: 18px 20px; display: flex; align-items: baseline; gap: 12px; }
  .stat-l { margin: 0; }
  .roles { padding: 0 20px; }
  .role { padding: 22px 0; }
  .earlier { padding: 4px 20px; }
  .earlier li { grid-template-columns: 1fr; }
  .earlier .e-dates { text-align: left; order: -1; }
  .project-body { padding: 20px; }
  .contact-card { padding: 26px 20px; }
  .contact-links .btn { flex: 1 1 auto; }
  .receipt { padding: 14px 16px 16px; font-size: 12.5px; }
  .big { font-size: 18px; }
  .row.total { font-size: 14.5px; }
  .stamp { bottom: 32px; font-size: 13px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
