/* ============================================
   Tokens
   ============================================ */
:root {
  --bg: #121110;
  --bg-panel: #181613;
  --line: #322d24;
  --line-soft: #221f19;
  --text: #f3efe6;
  --text-muted: #a39c8c;
  --text-dim: #736c5d;
  --accent: #e3a542;
  --accent-soft: #6b5228;

  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'IBM Plex Mono', 'SF Mono', monospace;

  --wrap: 1120px;
  --gutter: 32px;
  --radius: 3px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

::selection { background: var(--accent); color: #17140d; }

a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

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

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

/* subtle grain so the near-black background doesn't feel flat/generated */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================
   Header
   ============================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(18, 17, 16, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.mark {
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.02em;
}
.mark-dot { color: var(--accent); }

.nav {
  display: flex;
  gap: 32px;
}
.nav a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.nav a:hover { color: var(--text); }

.nav-cta {
  font-family: var(--mono);
  font-size: 13px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.nav-cta:hover { border-color: var(--accent); color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 20px;
  height: 1.5px;
  background: var(--text);
  display: block;
}

/* ============================================
   Hero
   ============================================ */
.hero {
  position: relative;
  padding: 168px 0 0;
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
}

.hero-grid { position: relative; padding-bottom: 96px; }

.hero-rulers {
  position: absolute;
  top: -40px;
  left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 var(--gutter);
  pointer-events: none;
}
.ruler-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.eyebrow-code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin: 0 0 20px;
}

.hero-title {
  display: block;
  font-size: clamp(44px, 8vw, 92px);
  line-height: 1.02;
  margin: 0 0 48px;
  max-width: 15ch;
}
.hero-title span { display: block; }
.hero-title .reveal--accent { color: var(--accent); font-style: italic; }

.hero-foot {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 64px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 40px;
}

.hero-lede {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: flex-start;
}

@media (min-width: 641px) {
  .hero-actions { justify-content: flex-end; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  padding: 13px 22px;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn--primary {
  background: var(--accent);
  color: #17140d;
}
.btn--primary:hover { background: #f0b45f; }
.btn--ghost {
  border: 1px solid var(--line);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--full { width: 100%; }

.spec-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  border-top: 1px solid var(--line-soft);
  padding-top: 18px;
  padding-bottom: 22px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--text-dim);
}

/* hero load-in: one orchestrated sequence, not scroll-triggered per-section */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.hero-title .reveal:nth-child(1) { animation-delay: 0.05s; }
.hero-title .reveal:nth-child(2) { animation-delay: 0.15s; }
.hero-title .reveal:nth-child(3) { animation-delay: 0.25s; }
.hero-lede.reveal { animation-delay: 0.35s; }
.hero-actions.reveal { animation-delay: 0.45s; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Sections (shared)
   ============================================ */
.section {
  padding: 108px 0;
  border-bottom: 1px solid var(--line-soft);
}
.section--alt { background: var(--bg-panel); }

.section-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: end;
  margin-bottom: 56px;
}
.section-head--left { display: block; }
.section-head--left h2 { margin-bottom: 16px; }

.section-head h2 {
  font-size: clamp(30px, 4vw, 42px);
}
.section-intro {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 42ch;
}

/* ============================================
   Services
   ============================================ */
.service-list { border-top: 1px solid var(--line); }
.service-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}
.service-tag {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  padding-top: 4px;
}
.service-body h3 {
  font-size: 22px;
  margin-bottom: 10px;
}
.service-body p {
  color: var(--text-muted);
  max-width: 58ch;
}

/* ============================================
   Timeline
   ============================================ */
.timeline {
  border-left: 1px solid var(--line);
  margin-bottom: 80px;
}
.timeline-item {
  position: relative;
  padding: 0 0 44px 32px;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -4.5px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-year {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.timeline-body h3 {
  font-size: 19px;
  margin-bottom: 4px;
}
.timeline-freelance {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-dim);
  font-style: normal;
}
.timeline-place {
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 10px;
}
.timeline-body p:last-child {
  color: var(--text-muted);
  max-width: 60ch;
}

.studies-title {
  font-size: 15px;
  font-family: var(--mono);
  color: var(--text-dim);
  letter-spacing: 0.04em;
  margin-bottom: 24px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.studies-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.study-degree {
  font-size: 16px;
  margin-bottom: 6px;
}
.study-place {
  font-size: 13.5px;
  color: var(--text-muted);
}

/* ============================================
   Projects
   ============================================ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.project-card { display: block; }
.project-thumb {
  aspect-ratio: 4 / 3;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  background: var(--bg-panel);
}
.project-thumb span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}
.project-info h3 {
  font-size: 18px;
  margin-bottom: 6px;
}
.project-tags {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}

/* ============================================
   Contact
   ============================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
}

.contact-list { margin-top: 40px; }
.contact-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  font-size: 17px;
}
.contact-list li:last-child { border-bottom: 1px solid var(--line); }
.contact-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}
.contact-list a:hover { color: var(--accent); }

.contact-form { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}
.field input, .field textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  padding: 10px 0;
  resize: vertical;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-note {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: -8px;
}

/* ============================================
   Footer
   ============================================ */
.site-footer { padding: 40px 0; }
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  color: var(--text-dim);
}
.footer-row a:hover { color: var(--accent); }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
  .hero-foot { grid-template-columns: 1fr; gap: 28px; }
  .hero-actions { justify-content: flex-start; }
  .section-head { grid-template-columns: 1fr; }
  .studies-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 48px; }
}

@media (max-width: 640px) {
  .nav, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .hero { padding-top: 128px; }
  .hero-rulers { display: none; }
  .service-row { grid-template-columns: 1fr; gap: 8px; }
  .project-grid { grid-template-columns: 1fr; }
  .studies-grid { grid-template-columns: 1fr; }
  .spec-strip { flex-direction: column; gap: 6px; }

  .nav.nav--open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 68px;
    left: 0; right: 0;
    background: var(--bg);
    padding: 20px var(--gutter) 28px;
    border-bottom: 1px solid var(--line-soft);
    gap: 18px;
  }
}
