:root {
  color-scheme: light;
  --bg: #f3ede1;
  --bg-panel: #fbf8f1;
  --bg-panel-raised: #ffffff;
  --ink: #2a2620;
  --ink-soft: #5c5347;
  --muted: #8d8272;
  --line: rgba(42, 38, 32, 0.12);
  --line-strong: rgba(42, 38, 32, 0.2);
  --accent-blue: #7c93b8;
  --accent-terracotta: #c17a52;
  --accent-sage: #7f9377;
  --shadow-sm: 0 4px 14px rgba(42, 38, 32, 0.08);
  --shadow-md: 0 18px 40px rgba(42, 38, 32, 0.12);
  --radius: 16px;
  --font-serif: "Newsreader", serif;
  --font-sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --content-width: 880px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  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");
  mix-blend-mode: multiply;
}

a {
  color: inherit;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  margin: 0;
  color: var(--ink);
}

p {
  margin: 0;
}

.section {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 88px 24px;
}

.section-head {
  margin-bottom: 40px;
}

.section-kicker {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  color: var(--accent-terracotta);
  margin-bottom: 8px;
}

.section-head h2 {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.3;
  max-width: 640px;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: rgba(243, 237, 225, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-mark {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 18px;
  text-decoration: none;
}

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

.nav-links a {
  text-decoration: none;
  font-size: 14px;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

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

.nav-resume {
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-panel-raised);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nav-resume:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Hero */
.hero {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 96px 24px 64px;
}

.hero-kicker {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-blue);
  margin-bottom: 14px;
}

.hero-title {
  font-size: 52px;
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 10px;
  letter-spacing: -0.015em;
}

.hero-role {
  font-size: 17px;
  color: var(--muted);
  margin-bottom: 22px;
}

.hero-body {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 560px;
  margin-bottom: 32px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 15.5px;
  font-weight: 600;
  text-decoration: none;
  font-family: var(--font-sans);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg-panel);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

.btn-quiet:hover {
  background: var(--bg-panel);
}

/* Timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

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

.timeline-row:last-child {
  border-bottom: 1px solid var(--line);
}

.timeline-when {
  font-size: 13px;
  color: var(--muted);
  padding-top: 4px;
}

.timeline-what h3 {
  font-size: 20px;
  margin-bottom: 2px;
}

.timeline-role {
  font-size: 14px;
  color: var(--accent-terracotta);
  margin-bottom: 10px;
}

.timeline-what p:not(.timeline-role) {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.6;
  max-width: 560px;
}

.resume-link {
  display: inline-block;
  margin-top: 32px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-terracotta);
  text-decoration: none;
}

.resume-link:hover {
  text-decoration: underline;
}

/* Folder grid */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.folder-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  padding: 24px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-sans);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.folder-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.folder-icon {
  width: 40px;
  height: 30px;
  border-radius: 5px 8px 8px 8px;
  background: var(--folder-color, var(--accent-blue));
  position: relative;
  box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.12);
}

.folder-icon::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 0;
  width: 18px;
  height: 8px;
  background: var(--folder-color, var(--accent-blue));
  border-radius: 5px 5px 0 0;
}

.folder-name {
  font-family: var(--font-serif);
  font-size: 19px;
  color: var(--ink);
}

.folder-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tag {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-panel-raised);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

/* Stack */
.stack-groups {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 40px;
}

.stack-group h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
  font-family: var(--font-sans);
  font-weight: 600;
}

.stack-group p {
  font-size: 15px;
  color: var(--ink-soft);
}

/* Contact */
.contact-band {
  max-width: var(--content-width);
  margin: 0 auto 96px;
  padding: 48px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: var(--shadow-sm);
}

.contact-band h2 {
  font-size: 26px;
  max-width: 420px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.contact-actions a,
.copy-button {
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  background: var(--bg-panel-raised);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.contact-actions a:hover,
.copy-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.site-footer {
  text-align: center;
  padding: 32px;
  font-size: 13px;
  color: var(--muted);
}

/* Project dialog */
.project-dialog {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.project-dialog.is-open {
  display: flex;
}

.project-dialog-scrim {
  position: absolute;
  inset: 0;
  background: rgba(42, 38, 32, 0.35);
  backdrop-filter: blur(2px);
}

.project-dialog-panel {
  position: relative;
  background: var(--bg-panel-raised);
  border-radius: 20px;
  padding: 40px;
  max-width: 620px;
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

.project-dialog-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg-panel);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-soft);
}

.project-dialog-kicker {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--accent-blue);
  margin-bottom: 6px;
}

.project-dialog-panel h3 {
  font-size: 26px;
  margin-bottom: 14px;
}

.project-dialog-summary {
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 24px;
}

.project-dialog-section {
  margin-bottom: 22px;
}

.project-dialog-section h4 {
  font-family: var(--font-sans);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 10px;
}

.project-dialog-section ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.6;
}

.project-dialog-section li {
  margin-bottom: 6px;
}

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

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Responsive */
@media (max-width: 720px) {
  .nav-links {
    display: none;
  }

  .hero-title {
    font-size: 34px;
  }

  .timeline-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .folder-grid,
  .stack-groups {
    grid-template-columns: 1fr;
  }

  .contact-band {
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 24px;
  }
}
