/* ============================================================
   trongdao.com — style.css
   Minimal, one-family type, chalkboard-green accent.
   ============================================================ */

:root {
  --paper: #f3f5f8;
  --ink: #16202e;
  --muted: #5a6678;
  --rule: #d5dbe4;
  --accent: #1f4fb0;        /* cobalt */
  --accent-soft: #e3eafa;   /* hover wash for rows */
  --accent-ink: #f3f5f8;    /* text on accent */
  --nav-bg: rgba(243, 245, 248, 0.86);

  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(1rem, 4vw, 3rem);
  --measure: 38rem;
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* Dark mode: deep navy page, sky-blue accent */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131c2c;
    --ink: #e7ecf4;
    --muted: #9aa8bd;
    --rule: #2a3750;
    --accent: #8fb6ff;       /* sky */
    --accent-soft: #1c2940;
    --accent-ink: #131c2c;
    --nav-bg: rgba(19, 28, 44, 0.86);
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.5rem 0.9rem;
  z-index: 2000;
  text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

/* ---------- Scroll progress hairline ---------- */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  z-index: 1001;
  pointer-events: none;
}

/* ---------- Nav ---------- */
.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.9rem var(--gutter);
}

.monogram {
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.site-nav ul {
  display: flex;
  gap: clamp(0.9rem, 2vw, 1.75rem);
  font-size: 0.9375rem;
}

.site-nav a:not(.monogram) {
  position: relative;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s ease;
}

.site-nav a:not(.monogram)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s var(--ease);
}

.site-nav a:not(.monogram):hover,
.site-nav a.is-active { color: var(--ink); }

.site-nav a:not(.monogram):hover::after,
.site-nav a.is-active::after { transform: scaleX(1); }

@media (max-width: 720px) {
  .site-nav nav {
    overflow-x: auto;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, #000 85%, transparent);
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
  }
  .site-nav nav::-webkit-scrollbar { display: none; }
  .site-nav ul { padding-right: 1.5rem; }
  .site-nav li { flex-shrink: 0; }
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 7rem var(--gutter) clamp(3rem, 8vh, 5rem);
  border-bottom: 1px solid var(--rule);
}

.hero-role {
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.hero-name {
  font-size: clamp(3.4rem, 13.5vw, 13rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.045em;
  margin-left: -0.05em;          /* optical alignment with body text */
}

.hero-name .line {
  display: block;
  overflow: hidden;              /* mask for the slide-up reveal */
  padding-bottom: 0.16em;        /* keeps descenders inside the mask */
  margin-bottom: -0.12em;        /* ...without loosening the line spacing */
}

.hero-name .line-inner { display: block; }

.hero-name .line:last-child .line-inner { color: var(--accent); }

.hero-foot {
  display: grid;
  gap: 1.75rem;
  margin-top: clamp(2rem, 5vh, 3.5rem);
}

@media (min-width: 900px) {
  .hero-foot {
    grid-template-columns: minmax(0, 32rem) auto;
    justify-content: space-between;
    align-items: end;
  }
}

.hero-intro { max-width: 32rem; font-size: 1.125rem; }

/* ---------- Buttons ---------- */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.8rem 1.3rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.975rem;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-solid {
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
}
.btn-solid:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.btn-line {
  border: 1px solid var(--rule);
}
.btn-line:hover { border-color: var(--ink); }

.arrow {
  display: inline-block;
  transition: transform 0.22s var(--ease);
}
a:hover .arrow { transform: translate(3px, -3px); }

.dl {
  display: inline-block;
  transition: transform 0.22s var(--ease);
}
a:hover .dl { transform: translateY(3px); }

/* ---------- Sections: sticky label left, content right ---------- */
.section {
  display: grid;
  gap: 1.5rem;
  padding: clamp(4.5rem, 11vh, 8rem) var(--gutter);
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 900px) {
  .section {
    grid-template-columns: minmax(10rem, 1fr) 3fr;
    gap: 3rem;
  }
  .section-title {
    position: sticky;
    top: 5.5rem;
    align-self: start;
  }
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

.section-body { max-width: 52rem; }

.prose > * + * { margin-top: 1.25rem; }
.prose p { max-width: var(--measure); }

.lead {
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
  max-width: 36rem;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 3rem;
  padding-top: 1.75rem !important;
  margin-top: 2.5rem !important;
  border-top: 1px solid var(--rule);
}
.facts dt { font-size: 0.875rem; color: var(--muted); }
.facts dd { font-weight: 600; }

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.org { color: var(--muted); margin-top: 0.15rem; }

.tags {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.when {
  font-size: 0.9375rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- Timeline ---------- */
.timeline-wrap { position: relative; }

.timeline-line {
  position: absolute;
  top: 0.6rem;
  bottom: 0;
  left: 0;
  width: 1px;
  background: var(--accent);
  transform-origin: top center;
}

.timeline-item {
  position: relative;
  display: grid;
  gap: 0.35rem 2rem;
  padding: 0 0 3.25rem 1.75rem;
}
.timeline-item:last-child { padding-bottom: 0; }

/* the dot on the line */
.timeline-item::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 0.55rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--accent);
}

@media (min-width: 700px) {
  .timeline-item { grid-template-columns: 8.5rem 1fr; }
  .timeline-item .when { padding-top: 0.2rem; }
}

.duties {
  margin-top: 1rem;
  display: grid;
  gap: 0.6rem;
  max-width: var(--measure);
}

.duties li {
  position: relative;
  padding-left: 1.1rem;
}
.duties li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 0.45rem;
  height: 1px;
  background: var(--muted);
}

/* Collapsible duties (set up by script.js; without JS all show) */
.duties-extra {
  display: grid;
  gap: 0.6rem;
  overflow: hidden;
}
.duties-extra[hidden] { display: none; }

.toggle {
  margin-top: 0.9rem;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}
.toggle:hover { text-decoration: underline; text-underline-offset: 3px; }
.toggle .chev {
  display: inline-block;
  transition: transform 0.25s var(--ease);
}
.toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }

/* ---------- Education ---------- */
.plain-list li {
  display: grid;
  gap: 0.35rem 2rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
}
.plain-list li:first-child { border-top: 0; padding-top: 0; }

@media (min-width: 700px) {
  .plain-list li { grid-template-columns: 10.25rem 1fr; }
  .plain-list .when { padding-top: 0.2rem; }
}

/* ---------- Skills ---------- */
.skills {
  display: grid;
  gap: 2rem 3rem;
}
@media (min-width: 700px) {
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.skills h3 { font-size: 1rem; margin-bottom: 0.35rem; }
.skills p { color: var(--muted); }

/* ---------- Projects ---------- */
.project {
  display: grid;
  gap: 0.35rem 2rem;
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
}
.project:first-child { border-top: 0; padding-top: 0; }
.project .kind { color: var(--muted); font-size: 0.9375rem; }
.project h3 + p { margin-top: 0.5rem; max-width: var(--measure); }

@media (min-width: 700px) {
  .project { grid-template-columns: 8.5rem 1fr; }
  .project .kind { padding-top: 0.2rem; }
}

/* ---------- Documents (downloads) ---------- */
.docs-intro { color: var(--muted); max-width: var(--measure); margin-bottom: 1.5rem; }

.docs { border-top: 1px solid var(--rule); }

.doc {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.25rem 1.5rem;
  padding: 1.1rem 0.75rem;
  margin: 0 -0.75rem;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.doc:hover { background: var(--accent-soft); }

.doc-name { font-weight: 700; }
.doc-meta { font-size: 0.875rem; color: var(--muted); }

.doc-action {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--accent);
}
.doc-action .dl {
  display: inline-block;
  transition: transform 0.22s var(--ease);
}
.doc:hover .dl { transform: translateY(3px); }

/* ---------- Contact ---------- */
.contact-big {
  font-size: clamp(2.8rem, 8vw, 6.5rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 1.5rem;
}
.contact .lead { margin-bottom: 2rem; }

/* ---------- Footer ---------- */
.site-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem var(--gutter);
  font-size: 0.875rem;
  color: var(--muted);
}
.site-foot a { text-decoration: none; }
.site-foot a:hover { color: var(--ink); }

/* ---------- Pre-animation state (only when JS + GSAP run) ----------
   script.js removes .js if GSAP fails to load, so content
   never gets stuck hidden. */
.js .hero-name .line-inner,
.js [data-hero-fade] { visibility: hidden; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .js .hero-name .line-inner,
  .js [data-hero-fade] { visibility: visible; }
}
