/* terrace.zone */

:root {
  --page-bg:  #5a9067;
  --backdrop: url("images/backdrops/backdrop-light.webp");
  --bg:       #f4f6f1;
  --surface:  #eceee9;
  --text:     #111510;
  --muted:    #5a6058;
  --faint:    #686c65;
  --border:   #cdd3c8;
  --accent:   #3d6647;
  --accent-h: #2d5236;
  --shadow:   0 24px 60px -28px rgba(20,35,20,0.35), 0 2px 10px rgba(20,35,20,0.08);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page-bg:  #1a2d1f;
    --backdrop: url("images/backdrops/backdrop-dark.webp");
    --bg:       #111510;
    --surface:  #191d16;
    --text:     #dce3d6;
    --muted:    #9ca199;
    --faint:    #7f8779;
    --border:   #252c22;
    --accent:   #7ab88a;
    --accent-h: #9ed0ae;
    --shadow:   0 24px 60px -28px rgba(0,0,0,0.6), 0 2px 10px rgba(0,0,0,0.3);
  }
}
:root[data-theme="dark"] {
  --page-bg:  #1a2d1f;
  --backdrop: url("images/backdrops/backdrop-dark.webp");
  --bg:       #111510;
  --surface:  #191d16;
  --text:     #dce3d6;
  --muted:    #9ca199;
  --faint:    #7f8779;
  --border:   #252c22;
  --accent:   #7ab88a;
  --accent-h: #9ed0ae;
  --shadow:   0 24px 60px -28px rgba(0,0,0,0.6), 0 2px 10px rgba(0,0,0,0.3);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  background: var(--page-bg);
  color: var(--text);
  font-family: 'DM Sans', system-ui, sans-serif;
  line-height: 1.6;
  padding: 1rem;
  -webkit-font-smoothing: antialiased;
}

/* fixed backdrop, oversized to 115% so cover-fit never gaps at any aspect ratio */
body::before {
  content: "";
  position: fixed;
  top: -7.5%; left: -7.5%;
  width: 115%; height: 115%;
  z-index: -1;
  background-image: var(--backdrop);
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
}

a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--accent-h); }

.wrap {
  max-width: 740px;
  margin: 2.5rem auto;
  padding: 0 2.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ── Nav ── */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 0 1.75rem;
}
.nav-home {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.nav-home:hover { color: var(--text); }
.nav-links { display: flex; gap: 1.75rem; list-style: none; }
.nav-links a {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.nav-links a:hover { color: var(--text); }

/* ── Hero ── */
.hero {
  padding: 3.5rem 0 2.25rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4.5rem;
}
.hero-name {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(3.5rem, 10vw, 5.25rem);
  font-weight: 600;
  font-optical-sizing: auto;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1.5rem;
  text-wrap: balance;
}
.hero-roles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-roles .dot { margin: 0 0.65rem; color: var(--border); }
.hero-loc {
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: var(--faint);
  letter-spacing: 0.04em;
}

/* ── Sections ── */
section { margin-bottom: 4.5rem; }
.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 1.75rem;
}

/* ── About ── */
.about-body {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.75;
}
.about-body p { margin-bottom: 1rem; }
.about-body p:last-child { margin-bottom: 0; }

/* ── Work ── */
.work-entry {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 1rem;
}
.work-entry:first-child { border-top: 1px solid var(--border); }
.work-role { font-size: 0.88rem; font-weight: 500; }
.work-org {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.1rem;
}
.work-date {
  font-size: 0.75rem;
  color: var(--faint);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-top: 0.15rem;
}
.work-desc {
  grid-column: 1 / -1;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.5rem;
  line-height: 1.6;
}

/* ── Projects ── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.project-card {
  background: var(--bg);
  padding: 1.2rem 1.3rem;
  transition: background 0.1s;
}
.project-card:hover { background: var(--surface); }
.project-name { font-size: 0.88rem; font-weight: 500; margin-bottom: 0.4rem; }
.project-name a { color: var(--text); text-decoration: none; }
.project-name a:hover { color: var(--accent); }
.project-desc {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 0.75rem;
}
.project-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.1rem 0.45rem;
  border-radius: 2px;
  opacity: 0.75;
}

/* ── Writing index ── */
.post-list { list-style: none; }
.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.post-list li:first-child { border-top: 1px solid var(--border); }
.post-title a { color: var(--text); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.post-title a:hover { color: var(--accent); }
.post-date { font-size: 0.75rem; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ── Post body ── */
.post-header { margin-bottom: 2.5rem; }
.post-header h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  font-optical-sizing: auto;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin-bottom: 0.6rem;
}
.post-meta { font-size: 0.78rem; color: var(--faint); letter-spacing: 0.04em; }
.post-meta a { color: var(--faint); }
.post-meta a:hover { color: var(--accent); }
.post-summary { font-family: 'Source Serif 4', Georgia, serif; font-style: italic; font-size: 0.9rem; color: var(--muted); margin-top: 0.75rem; line-height: 1.6; }
.post-body {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.78;
}
.post-body p { margin-bottom: 1.25rem; }
.post-body p:last-child { margin-bottom: 0; }
.post-body h2 {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 2.5rem 0 1rem;
}
.post-body h3 {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}
.post-body a { color: var(--accent); }
.post-body blockquote {
  border-left: 2px solid var(--border);
  padding-left: 1.25rem;
  color: var(--muted);
  margin: 1.5rem 0;
  font-style: italic;
}
.post-body ul, .post-body ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.post-body li { margin-bottom: 0.3rem; }
.post-body code {
  font-family: "SF Mono", "Fira Mono", monospace;
  font-size: 0.85em;
  background: var(--surface);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}
.post-body pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}
.post-body pre code { background: none; padding: 0; font-size: 0.88rem; }

/* ── Back link ── */
.back-link {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  margin-bottom: 2rem;
}
.back-link:hover { color: var(--text); }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--faint);
}
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 0.75rem; }
.footer-links a:hover { color: var(--text); }

/* ── Responsive ── */
@media (max-width: 520px) {
  .wrap { margin: 1rem auto; padding: 0 1.25rem; border-radius: 14px; }
  nav { flex-direction: column; gap: 1rem; align-items: flex-start; }
  .project-grid { grid-template-columns: 1fr; }
  .work-entry { grid-template-columns: 1fr; }
  .work-date { text-align: left; }
  footer { flex-direction: column; gap: 0.75rem; }
}
