/* =============================================================
   Diem Nguyen — personal site
  Classical design system with self-hosted fonts and a gold accent
   Chỉ sửa file này nếu muốn đổi màu / font / khoảng cách.
   ============================================================= */

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/cormorant-garamond-400.ttf") format("truetype");
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/cormorant-garamond-600.ttf") format("truetype");
}

@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/lora-400.ttf") format("truetype");
}

@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/lora-600.ttf") format("truetype");
}

:root {
  --bg: #f3f2f2;
  --surface: #eae9e9;
  --text: #201f1d;
  --accent: #b68235;
  --accent-deep: #7d5411;
  --accent-dark: #3a270d;
  --divider: rgba(32, 31, 29, 0.16);
  --n300: #d7d3d3;
  --n600: #7d7979;
  --n700: #605d5d;
  --n800: #444141;

  --font-heading: "Cormorant Garamond", Baskerville, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Lora", "Iowan Old Style", Baskerville, "Palatino Linotype", Palatino, Georgia, serif;

  --s1: 4.6px;
  --s2: 9.2px;
  --s3: 13.8px;
  --s4: 18.4px;
  --s6: 27.6px;
  --s8: 36.8px;
  --radius: 4px;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent-deep); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: rgba(182, 130, 53, 0.3); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 var(--s6); }

/* — hairline rule — */
.hr { height: 1px; border: 0; margin: 0; background: var(--divider); }

/* — nav — */
.nav {
  display: flex;
  align-items: center;
  gap: var(--s6);
  padding: var(--s6) 0;
  border-bottom: 1px solid var(--divider);
  flex-wrap: wrap;
}
.nav-brand {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 22px;
  margin-right: auto;
}
.nav a {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--n700);
  text-decoration: none;
}
.nav a:hover { color: var(--accent-deep); text-decoration: underline; }

/* — buttons: outline, never filled — */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
  padding: 10px 20px;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-primary {
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent-deep);
}
.btn-primary:hover { background: rgba(182, 130, 53, 0.09); color: var(--accent-dark); }
.btn-primary:active { border-color: var(--accent-deep); background: rgba(182, 130, 53, 0.16); }
.btn-ghost {
  border: 1px solid var(--divider);
  background: transparent;
  color: var(--n700);
}
.btn-ghost:hover { border-color: var(--accent); background: rgba(182, 130, 53, 0.07); color: var(--accent-deep); }

/* — section scaffolding — */
section { padding: var(--s8) 0; }
.section-split { display: grid; grid-template-columns: 200px 1fr; gap: var(--s8); }
.kicker {
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--n600);
  margin: 0;
}
.section-split h2, .section-head h2 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 29px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: var(--s2) 0 0;
}
.prose { max-width: 66ch; }
.prose p {
  font-size: 17px;
  line-height: 1.78;
  color: var(--n800);
  text-align: justify;
  margin: 0 0 1em;
}
.prose p:last-child { margin-bottom: 0; }

/* — hero — */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--s8);
  align-items: center;
  padding: var(--s8) 0;
}
.hero h1 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 54px;
  line-height: 1.06;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s4);
  text-wrap: pretty;
}
.hero-tagline {
  color: var(--accent);
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-size: 12px;
  margin: calc(var(--s2) * -1) 0 var(--s4);
}
.hero-intro {
  font-size: 17px;
  line-height: 1.7;
  color: var(--n700);
  max-width: 54ch;
  margin: 0 0 var(--s6);
}
.hero-intro p { margin: 0 0 var(--s3); }
.hero-intro p:last-child { margin-bottom: 0; }
.actions { display: flex; gap: var(--s4); align-items: center; flex-wrap: wrap; }

/* — plate: photographs sit matted, like a tipped-in book plate — */
.plate {
  filter: sepia(0.22) saturate(0.82) contrast(1.05);
  border: 6px solid var(--surface);
  outline: 1px solid var(--divider);
}
.portrait {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 4 / 5;
  justify-self: end;
  background: var(--surface);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }

/* — timeline — */
.timeline { display: flex; flex-direction: column; }
.entry {
  display: grid;
  grid-template-columns: 104px 15px 64px 1fr;
  gap: var(--s4);
  align-items: start;
  padding-bottom: var(--s6);
}
.entry:last-child { padding-bottom: 0; }
.entry-years {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--n600);
  text-align: right;
  padding-top: 3px;
}
.entry-rail {
  position: relative;
  justify-self: center;
  align-self: stretch;
  width: 1px;
  background: var(--divider);
}
.entry-rail::before {
  content: "";
  position: absolute;
  top: 6px;
  left: -3.5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--bg);
}
.entry-logo {
  width: 64px;
  height: 64px;
  padding: 3px;
  background: var(--surface);
}
.entry-logo img { width: 100%; height: 100%; object-fit: contain; }
.entry-body { max-width: 62ch; }
.entry-role {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.3;
  margin: 0;
}
.entry-org {
  font-size: 14px;
  line-height: 1.5;
  color: var(--accent-deep);
  margin: 4px 0 0;
}
.entry-text {
  font-size: 16px;
  line-height: 1.72;
  color: var(--n700);
  margin: var(--s3) 0 0;
  text-align: justify;
}

/* — writing — */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--s6);
  flex-wrap: wrap;
  margin-bottom: var(--s6);
}
.section-head a { font-size: 14px; text-decoration: underline; }
.archive-note { margin: var(--s6) 0 0; }
/* — post list — */
.post-list { display: flex; flex-direction: column; }
.post {
  padding: var(--s6) 0;
  border-top: 1px solid var(--divider);
}
.post:last-child { border-bottom: 1px solid var(--divider); }
.post-meta {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--n600);
  margin: 0 0 var(--s2);
}
.post-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 25px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0;
}
.post-title a { color: var(--text); text-decoration: none; }
.post-title a:hover { color: var(--accent-deep); text-decoration: underline; }
.post-excerpt {
  font-size: 16px;
  line-height: 1.7;
  color: var(--n700);
  max-width: 62ch;
  margin: var(--s2) 0 0;
}

/* — connect + footer — */
.connect-blurb {
  font-size: 17px;
  line-height: 1.72;
  color: var(--n800);
  max-width: 52ch;
  margin: 0 0 var(--s4);
}
footer { padding: var(--s6) 0 var(--s8); text-align: center; }
footer p { font-size: 13px; color: var(--n600); margin: 0; }

/* — responsive — */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero h1 { font-size: 40px; }
  .portrait { justify-self: start; }
  .section-split { grid-template-columns: 1fr; gap: var(--s4); }
  .entry {
    grid-template-columns: 48px 1fr;
    gap: var(--s3);
    row-gap: var(--s2);
  }
  .entry-rail { display: none; }
  .entry-years {
    grid-column: 1 / -1;
    text-align: left;
    padding-top: 0;
  }
  .entry-logo { width: 48px; height: 48px; }
  .prose p, .entry-text { text-align: left; }
}
