/* ============================================
   FLEXX RICHIE - LIGHT EDITORIAL
   Ivory paper, ink, teal + yellow from the logo.
   Two font families: Fraunces (display) + JetBrains Mono (labels).
   ============================================ */

:root {
  --paper: #faf8f3;
  --paper-soft: #f2efe7;
  --ink: #1c1b18;
  --ink-muted: #5c5a52;
  --teal: #0e7c7b;
  --teal-deep: #0a5f5e;
  --yellow: #e8b923;
  --line: #e0dccf;
  --serif: "Fraunces", Georgia, serif;
  --mono: "JetBrains Mono", "Courier New", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --maxw: 1080px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
}

::selection {
  background: var(--teal);
  color: var(--paper);
}

.mono {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ============ HEADER ============ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 243, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.wordmark-dot {
  color: var(--teal);
}

.nav-links {
  display: flex;
  gap: 1.6rem;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* ============ HERO ============ */

.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 7rem 1.5rem 5rem;
}

.hero-kicker {
  margin-bottom: 1.4rem;
  color: var(--teal);
}

.hero-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.6rem, 6.5vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 16ch;
  margin-bottom: 1.4rem;
}

.hero-sub {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--ink-muted);
  max-width: 52ch;
  margin-bottom: 2.4rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ============ BUTTONS ============ */

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

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

.btn-primary:hover {
  background: var(--teal-deep);
  transform: translateY(-1px);
}

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

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

/* ============ SECTIONS ============ */

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4.5rem 1.5rem;
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.6rem;
}

.section-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: -0.01em;
}

.section-note {
  white-space: nowrap;
}

/* ============ PROJECTS ============ */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.4rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.7rem 1.6rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  position: relative;
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.project-card:hover {
  border-color: var(--teal);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(28, 27, 24, 0.08);
}

.project-card:hover::before {
  transform: scaleX(1);
}

.project-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.project-arrow {
  font-family: var(--mono);
  color: var(--teal);
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.project-card:hover .project-arrow {
  transform: translateX(4px);
}

.project-blurb {
  font-size: 0.95rem;
  color: var(--ink-muted);
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--teal-deep);
  background: rgba(14, 124, 123, 0.08);
  border: 1px solid rgba(14, 124, 123, 0.2);
  border-radius: 3px;
  padding: 0.22rem 0.55rem;
}

/* ============ STACK ============ */

.stack-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.stack-list li {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.5rem 0.9rem;
  background: var(--paper);
}

.stack-list li::before {
  content: "// ";
  color: var(--yellow);
}

/* ============ CONTACT ============ */

.section-contact {
  padding-bottom: 5.5rem;
}

.contact-line {
  font-size: 1.1rem;
  color: var(--ink-muted);
  max-width: 46ch;
  margin-bottom: 2rem;
}

.contact-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ============ FOOTER ============ */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 1.5rem;
  text-align: center;
}

.site-footer p {
  font-size: 0.72rem;
  color: var(--ink-muted);
}

/* ============ REVEAL ============ */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ RESPONSIVE ============ */

@media (max-width: 640px) {
  .hero {
    padding: 4.5rem 1.25rem 3.5rem;
  }

  .section {
    padding: 3.5rem 1.25rem;
  }

  .section-head {
    flex-direction: column;
    gap: 0.4rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .nav-links a {
    font-size: 0.72rem;
  }

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

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
