:root {
  --ink: #101418;
  --surface: #171c22;
  --surface-line: #262d35;
  --paper: #ece7dc;
  --paper-dim: #9aa0a6;
  --accent: #e8a33d;
  --accent-dim: #8a6a33;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
  --max: 920px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.inline-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

/* faint grain so the flat dark background isn't inert */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  z-index: 0;
  background-image: radial-gradient(var(--paper) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 6vw, 64px);
  background: rgba(16, 20, 24, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--surface-line);
}

.logo {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  gap: 32px;
}

.nav a {
  text-decoration: none;
  font-size: 0.94rem;
  color: var(--paper-dim);
  transition: color 0.15s ease;
}

.nav a:hover { color: var(--paper); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  height: 1.5px;
  background: var(--paper);
  width: 100%;
}

/* ---------- layout base ---------- */

main { position: relative; z-index: 1; }

section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 96px clamp(20px, 6vw, 0px);
}

.section-heading {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.8rem;
  margin: 0 0 40px;
}

/* ---------- hero ---------- */

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(70px, 14vw, 140px) clamp(20px, 6vw, 0px) 80px;
}

.hero-eyebrow {
  color: var(--accent);
  font-size: 0.94rem;
  margin: 0 0 18px;
}

.hero-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.08;
  margin: 0 0 28px;
  max-width: 14ch;
}

.hero-sub {
  max-width: 54ch;
  color: var(--paper-dim);
  font-size: 1.05rem;
  margin: 0 0 40px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 3px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

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

.btn-primary:hover { transform: translateY(-1px); }

.btn-ghost {
  border: 1px solid var(--surface-line);
  color: var(--paper);
}

.btn-ghost:hover { border-color: var(--accent); }

/* ---------- work / projects ---------- */

.work { border-top: 1px solid var(--surface-line); }

.project {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding: 44px 0;
  border-bottom: 1px solid var(--surface-line);
}

.project:first-of-type { padding-top: 0; }

.project-reverse { direction: rtl; }
.project-reverse > * { direction: ltr; }

.project-index {
  color: var(--accent);
  font-size: 0.88rem;
}

.project h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.5rem;
  margin: 8px 0 14px;
}

.project p {
  color: var(--paper-dim);
  max-width: 46ch;
  margin: 0 0 18px;
}

.project-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.project-tags span {
  font-size: 0.78rem;
  color: var(--paper-dim);
  border: 1px solid var(--surface-line);
  border-radius: 3px;
  padding: 4px 10px;
}

.project-visual {
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--surface-line);
  position: relative;
  overflow: hidden;
}

.project-visual::before {
  content: '';
  position: absolute;
  inset: 0;
}

.project-visual[data-project="buildcon"]::before {
  background:
    linear-gradient(var(--surface-line) 1px, transparent 1px) 0 0/100% 22%,
    linear-gradient(90deg, var(--surface-line) 1px, transparent 1px) 0 0/33% 100%;
}

.project-visual[data-project="weather"]::before {
  background: radial-gradient(circle at 30% 30%, var(--accent-dim), transparent 60%),
              radial-gradient(circle at 70% 65%, var(--accent), transparent 45%);
  opacity: 0.55;
}

.project-visual[data-project="portfolio"]::before {
  background: repeating-linear-gradient(135deg, var(--surface-line) 0 2px, transparent 2px 18px);
}

/* ---------- about ---------- */

.about { border-top: 1px solid var(--surface-line); }

.about p {
  max-width: 62ch;
  color: var(--paper-dim);
  font-size: 1.05rem;
}

/* ---------- skills ---------- */

.skills { border-top: 1px solid var(--surface-line); }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.skill-group h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.05rem;
  margin: 0 0 16px;
  color: var(--accent);
}

.skill-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.skill-group li {
  color: var(--paper-dim);
  padding: 8px 0;
  border-top: 1px solid var(--surface-line);
}

.skill-group li:first-child { border-top: none; }

/* ---------- contact ---------- */

.contact {
  border-top: 1px solid var(--surface-line);
  text-align: left;
}

.contact-lead {
  max-width: 50ch;
  color: var(--paper-dim);
  font-size: 1.05rem;
  margin: 0 0 36px;
}

.contact-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.contact-link {
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.15rem;
  border-bottom: 1px solid var(--surface-line);
  padding-bottom: 4px;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.contact-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- footer ---------- */

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px clamp(20px, 6vw, 0px) 60px;
  display: flex;
  justify-content: space-between;
  color: var(--paper-dim);
  font-size: 0.88rem;
  border-top: 1px solid var(--surface-line);
}

.back-top {
  text-decoration: none;
  color: var(--paper-dim);
}

.back-top:hover { color: var(--accent); }

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .nav { display: none; }

  .nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    padding: 20px clamp(20px, 6vw, 64px);
    gap: 18px;
    border-bottom: 1px solid var(--surface-line);
  }

  .nav-toggle { display: flex; }

  .project,
  .project-reverse {
    grid-template-columns: 1fr;
    direction: ltr;
  }

  .project-visual { order: -1; aspect-ratio: 16 / 9; }

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