/* ==========================================================================
   Mouli — personal site
   Design system: warm paper background, editorial serif display type,
   restrained rust accent, generous whitespace, quiet motion.
   ========================================================================== */

:root {
  --paper: #f6f2ea;
  --paper-dim: #efe9dd;
  --ink: #1c1a17;
  --ink-soft: #55504a;
  --ink-faint: #8a847a;
  --rust: #b1502f;
  --rust-dim: #c98a6f;
  --line: rgba(28, 26, 23, 0.12);
  --line-strong: rgba(28, 26, 23, 0.22);

  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --maxw: 1100px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* subtle paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  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");
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

p {
  margin: 0 0 1em;
  color: var(--ink-soft);
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}

/* ---------- top nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 242, 234, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

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

.brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand span {
  color: var(--rust);
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  padding: 4px 0;
  transition: color 0.25s var(--ease);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--rust);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  position: relative;
  transition: all 0.25s var(--ease);
}

.nav-toggle span::before { position: absolute; top: -7px; }
.nav-toggle span::after { position: absolute; top: 7px; }

/* ---------- hero (home) ---------- */
.hero {
  padding: 120px 0 90px;
  position: relative;
}

.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rust);
  font-weight: 600;
  margin-bottom: 24px;
}

.hero .eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--rust);
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 1.02;
  max-width: 14ch;
}

.hero h1 em {
  font-style: italic;
  color: var(--rust);
}

.hero .lede {
  margin-top: 28px;
  font-size: 1.15rem;
  max-width: 46ch;
  color: var(--ink-soft);
}

.hero .lede strong {
  color: var(--ink);
  font-weight: 600;
}

.scroll-cue {
  margin-top: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.scroll-cue .line {
  width: 1px;
  height: 36px;
  background: linear-gradient(var(--ink-faint), transparent);
  animation: pulse-down 2s var(--ease) infinite;
}

@keyframes pulse-down {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* ---------- nav grid (the "hub" of sections) ---------- */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin: 0 0 100px;
}

.nav-card {
  background: var(--paper);
  padding: 48px 40px;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: background 0.4s var(--ease);
}

.nav-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: translateY(101%);
  transition: transform 0.5s var(--ease);
  z-index: 0;
}

.nav-card:hover::before {
  transform: translateY(0);
}

.nav-card > * {
  position: relative;
  z-index: 1;
  transition: color 0.4s var(--ease);
}

.nav-card:hover .card-title,
.nav-card:hover .card-desc,
.nav-card:hover .card-index,
.nav-card:hover .card-arrow {
  color: var(--paper);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card-index {
  font-size: 0.8rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.card-arrow {
  font-size: 1.1rem;
  color: var(--ink-faint);
  transition: transform 0.4s var(--ease), color 0.4s var(--ease);
}

.nav-card:hover .card-arrow {
  transform: translate(4px, -4px);
}

.card-title {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-top: 24px;
  color: var(--ink);
}

.card-desc {
  margin-top: 10px;
  font-size: 0.92rem;
  color: var(--ink-faint);
  max-width: 32ch;
}

/* ---------- section page layout ---------- */
.page-hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--line);
}

.page-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rust);
  font-weight: 600;
  margin-bottom: 18px;
}

.page-hero .eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--rust);
}

.page-hero h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
}

.page-hero .lede {
  margin-top: 18px;
  font-size: 1.05rem;
  max-width: 56ch;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-bottom: 28px;
  transition: color 0.25s var(--ease), gap 0.25s var(--ease);
}

.back-link:hover {
  color: var(--rust);
  gap: 12px;
}

section.block {
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
}

section.block:last-of-type {
  border-bottom: none;
}

.block-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 40px;
  gap: 24px;
  flex-wrap: wrap;
}

.block-head h2 {
  font-size: 1.7rem;
}

.block-head .tag {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- timeline (work experience) ---------- */
.timeline {
  display: flex;
  flex-direction: column;
}

.timeline-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 32px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}

.timeline-item:first-child {
  border-top: none;
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--ink-faint);
  padding-top: 4px;
  font-variant-numeric: tabular-nums;
}

.timeline-role {
  font-size: 1.25rem;
  font-family: var(--font-display);
  font-weight: 600;
}

.timeline-org {
  color: var(--rust);
  font-weight: 500;
  font-size: 0.95rem;
  margin-top: 2px;
}

.timeline-desc {
  margin-top: 12px;
  max-width: 68ch;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag-pill {
  font-size: 0.75rem;
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  color: var(--ink-soft);
}

/* ---------- cards grid (projects / travel / recipes) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}

.tile {
  border: 1px solid var(--line);
  padding: 28px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  background: var(--paper);
}

.tile:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 16px 32px -20px rgba(28, 26, 23, 0.25);
}

.tile .thumb {
  position: relative !important;
  width: 100% !important;
  height: 220px !important;
  max-height: 220px !important;
  background: var(--paper-dim);
  border: 1px solid var(--line);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  overflow: hidden !important;
  isolation: isolate;
}

.tile .thumb img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center;
  display: block;
  margin: 0;
  max-width: none;
  transition: transform 0.5s var(--ease);
}

.tile:hover .thumb img {
  transform: scale(1.04);
}

.tile h3 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.tile .meta {
  font-size: 0.78rem;
  color: var(--rust);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.tile p {
  font-size: 0.92rem;
  margin-bottom: 0;
}

.tile .stars {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--rust-dim);
  letter-spacing: 2px;
}

/* ---------- stat cards (fitness PRs) ---------- */
.stat-kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 20px;
}

.stat-kicker span {
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  white-space: nowrap;
}

.stat-kicker::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.stat-tile {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--rust);
  padding: 36px 30px 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}

.stat-tile:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 44px -28px rgba(28, 26, 23, 0.35);
  border-color: var(--line-strong);
  border-top-color: var(--rust);
}

.stat-tile::before {
  content: attr(data-num);
  position: absolute;
  right: -0.1em;
  bottom: -0.22em;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 6.5rem;
  line-height: 1;
  color: var(--rust);
  opacity: 0.06;
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.stat-tile:hover::before {
  opacity: 0.12;
  transform: scale(1.06);
}

.stat-tile > * {
  position: relative;
  z-index: 1;
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rust);
  font-weight: 600;
}

.stat-label::before {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--rust);
}

.stat-value {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 3.1rem;
  line-height: 1;
  color: var(--ink);
  margin-top: 10px;
}

.stat-value .unit {
  font-size: 1.05rem;
  font-style: normal;
  color: var(--ink-faint);
  font-family: var(--font-body);
  font-weight: 500;
  margin-left: 4px;
}

.stat-note {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-top: 2px;
}

/* Featured / larger stat (e.g. the run, standing apart from the lift trio) */
.stat-tile.featured {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 3px solid var(--ink);
  padding: 32px 36px;
}

.stat-tile.featured .stat-value {
  margin-top: 0;
  font-size: 3.6rem;
}

.stat-tile.featured::before {
  font-size: 8rem;
  color: var(--ink);
  opacity: 0.05;
}

.stat-tile.featured:hover::before {
  opacity: 0.09;
}

.stat-tile.featured .stat-label::before {
  background: var(--ink);
}

.stat-tile.featured .stat-label {
  color: var(--ink-soft);
}

@media (max-width: 640px) {
  .stat-tile.featured {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- goals ---------- */
.goal-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.goal-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.goal-item:first-child {
  border-top: none;
}

.goal-check {
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.goal-item.done .goal-check {
  background: var(--rust);
  border-color: var(--rust);
}

.goal-item.done .goal-check::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--paper);
  font-size: 0.7rem;
}

.goal-text h4 {
  font-size: 1.05rem;
  font-weight: 500;
}

.goal-text p {
  font-size: 0.88rem;
  margin: 4px 0 0;
}

.goal-status {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

.goal-item.done .goal-status {
  color: var(--rust);
}

.progress-track {
  width: 100%;
  height: 4px;
  background: var(--paper-dim);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--rust);
  border-radius: 4px;
}

/* ---------- footer ---------- */
.site-footer {
  padding: 56px 0;
  border-top: 1px solid var(--line);
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 22px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--ink-faint);
  transition: color 0.25s var(--ease);
}

.footer-links a:hover {
  color: var(--rust);
}

.footer-note {
  font-size: 0.8rem;
  color: var(--ink-faint);
}

/* ---------- reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .nav-links {
    position: fixed;
    inset: 68px 0 0 0;
    background: var(--paper);
    flex-direction: column;
    padding: 32px;
    gap: 22px;
    transform: translateX(100%);
    transition: transform 0.35s var(--ease);
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-toggle {
    display: block;
  }

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

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .goal-item {
    grid-template-columns: 24px 1fr;
  }

  .goal-status {
    grid-column: 2;
  }

  .hero {
    padding: 80px 0 60px;
  }
}
