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

:root {
  --paper:         #FBF6EE;
  --card:          #FFFFFF;
  --ink:           #241F1A;
  --body:          #5C5247;
  --muted:         #6E6356;
  --line:          #EADFCF;
  --accent:        #B0471E;
  --footer-bg:     #241F1A;
  --footer-fg:     #FBF6EE;
  --footer-accent: #C99A6A;
  --wrap:          760px;
  --pad:           clamp(1.5rem, 5vw, 3.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:         #1A1714;
    --card:          #221E1A;
    --ink:           #F2ECE3;
    --body:          #B8AFA2;
    --muted:         #8A7F72;
    --line:          #342E27;
    --accent:        #D2693C;
    --footer-bg:     #120F0D;
    --footer-fg:     #F2ECE3;
    --footer-accent: #C99A6A;
  }
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Figtree', system-ui, sans-serif;
  background-color: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

/* ─── Top bar ─── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.75rem;
  padding-bottom: 1.75rem;
}

.logo {
  display: inline-flex;
  width: 32px;
  height: 32px;
  color: var(--ink);
  transition: color 0.2s;
}
.logo:hover { color: var(--accent); }

.lang {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 2rem;
  padding: 0 0.85rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s, border-color 0.2s;
}
.lang:hover { color: var(--accent); border-color: var(--accent); }

/* ─── Masthead ─── */
.masthead {
  padding-top: 1.5rem;
  padding-bottom: 3.5rem;
}

.kicker {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

.name {
  font-family: 'Spectral', Georgia, serif;
  font-weight: 600;
  font-size: clamp(2.75rem, 8vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
  animation: fadeUp 0.6s 0.05s cubic-bezier(0.25, 1, 0.5, 1) both;
}

.rule {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 1.75rem 0 1.5rem;
  transform-origin: left;
  animation: ruleExpand 0.5s 0.38s cubic-bezier(0.25, 1, 0.5, 1) both;
}

.tagline {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--body);
  max-width: 42ch;
  text-align: justify;

  animation: fadeUp 0.55s 0.20s cubic-bezier(0.25, 1, 0.5, 1) both;
}

.skills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.75rem;
}
.skills li {
  animation: fadeUp 0.4s calc(0.50s + var(--i, 0) * 0.06s) cubic-bezier(0.25, 1, 0.5, 1) both;
}
.pill {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--body);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 2rem;
  padding: 0.35rem 0.8rem;
}
.pill-accent {
  color: var(--accent);
  border-color: var(--accent);
  background: transparent;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.75rem;
}
.links a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1.5px solid var(--line);
  padding-bottom: 2px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: border-color 0.2s, color 0.2s;
}
.links a:hover { color: var(--accent); border-color: var(--accent); }

/* ─── Animations ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); filter: blur(1px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes ruleExpand {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

/* ─── Sections ─── */
.sections { padding-bottom: 1rem; }

.entry { padding: 3.25rem 0; }
.entry + .entry { border-top: 1px solid var(--line); }

.entry-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.entry-title {
  font-family: 'Spectral', Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.5rem, 4vw, 1.95rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 1rem;
  text-wrap: balance;
}

.entry p:not(.entry-label) {
  font-size: 1rem;
  line-height: 1.78;
  color: var(--body);
  text-align: justify;

}
.entry p:not(.entry-label) + p { margin-top: 1rem; }

.entry a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  transition: color 0.2s;
}
.entry a:hover { color: var(--accent); }

/* ─── Footer ─── */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-fg);
  margin-top: 2rem;
}
.footer-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 3.5rem var(--pad);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.footer-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--footer-accent);
  margin-bottom: 0.6rem;
}
.footer-mail {
  font-family: 'Spectral', Georgia, serif;
  font-size: clamp(1.25rem, 4vw, 1.6rem);
  font-weight: 600;
  color: var(--footer-fg);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-mail:hover { color: var(--footer-accent); }
.footer-links {
  display: flex;
  gap: 1.25rem;
}
.footer-links a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--footer-fg);
  opacity: 0.8;
  text-decoration: none;
  transition: opacity 0.2s;
}
.footer-links a:hover { opacity: 1; }

/* ─── Reveal (gated on .js so content never ships hidden without JS) ─── */
.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1), transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
.js .reveal.reveal-now  { transform: translateX(-8px) translateY(4px); }
.js .reveal.reveal-quiet { transform: none; }
.js .reveal.visible { opacity: 1; transform: none; }

/* ─── Skip link ─── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 1rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 100;
  text-decoration: none;
}
.skip-link:focus { left: 1rem; }

/* ─── Focus ─── */
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ─── Responsive ─── */
@media (max-width: 640px) {
  .entry { padding: 2.5rem 0; }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .name, .tagline { animation: none; opacity: 1; transform: none; filter: none; }
  .rule { animation: none; transform: scaleX(1); opacity: 1; }
  .skills li { animation: none; opacity: 1; filter: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
