/* Duc Nhu - personal site
   Colours, fonts and spacing live in the variables below. Change them here
   and the whole site follows. */
:root {
  --bg: #F6F4EF;
  --bg-soft: #ECE8DF;
  --surface: #FFFFFF;
  --ink: #1C1F26;
  --ink-2: #3A3F4B;
  --ink-3: #5A606D;
  --muted: #6E7380;
  --line: #E4E0D6;
  --line-2: #D9D4C7;
  --accent: #2F4A8A;
  --accent-dark: #1E3266;
  --accent-light: #C9D4F2;
  --warm: #C2703D;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 32px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.site-header { padding: 28px 0; }
.site-header .wrap { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.brand { font-family: var(--serif); font-size: 22px; font-weight: 500; color: var(--ink); }
.brand:hover { color: var(--ink); }
.nav { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 14px; letter-spacing: .02em; }
.nav a { color: #4A4F5C; }
.nav a:hover { color: var(--ink); }
.nav a.cta { color: var(--accent); font-weight: 600; }

/* Type */
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; }
h1 { font-size: clamp(40px, 6vw, 64px); line-height: 1.05; letter-spacing: -.015em; }
h2 { font-size: clamp(30px, 4vw, 40px); line-height: 1.1; margin-top: 12px; }
.lede { font-family: var(--serif); font-size: clamp(20px, 2.4vw, 24px); line-height: 1.5; margin: 0; }
.body { color: var(--ink-2); margin: 0; }
.ul {
  font-style: italic;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 100% 2px; background-repeat: no-repeat; background-position: 0 100%;
}

/* Buttons */
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 999px; font-size: 15px; font-weight: 500; border: 1px solid var(--ink); transition: background .2s, color .2s; }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-dark:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--bg); }
.btn-line { color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--bg); }

/* Hero */
.hero { padding: 72px 0 96px; }
.hero .wrap { display: flex; flex-wrap: wrap; gap: 64px; align-items: center; }
.hero-text { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.hero-text .body { font-size: 18px; line-height: 1.65; max-width: 600px; }
.badge { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; font-size: 13px; color: #4A4F5C; background: var(--bg-soft); border-radius: 999px; padding: 8px 14px; }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warm); animation: pulse 2.4s ease-in-out infinite; }
.creds { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 13px; color: var(--ink-3); }
.hero-photo { flex: 0 1 360px; max-width: 360px; }
.hero-photo img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 200px 200px 12px 12px; }

/* Sections */
.section { padding: 96px 0; }
.band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.split { display: flex; flex-wrap: wrap; gap: 48px; }
.split > :first-child { flex: 1 1 240px; }
.split > :last-child { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chips li { font-size: 13px; padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--ink-2); }

/* Project cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 24px; margin-top: 40px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 32px; display: flex; flex-direction: column; gap: 14px; transition: transform .35s ease, box-shadow .35s ease; }
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -24px rgba(28, 31, 38, .35); }
.card-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.card h3 { font-weight: 500; font-size: 26px; line-height: 1.2; }
.card p { margin: 0; font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.card .more { margin-top: auto; font-size: 14px; font-weight: 600; }
.card .more span { display: inline-block; transition: transform .2s; }
.card:hover .more span { transform: translateX(4px); }

/* Publications (dark band) */
.dark { background: var(--ink); color: var(--bg); }
.dark .eyebrow { color: #A9B8E0; }
.dark a { color: var(--accent-light); }
.dark a:hover { color: #fff; }
.pubs { list-style: none; margin: 0; padding: 0; }
.pubs li { padding: 24px 0; border-top: 1px solid #3A3F4B; display: flex; flex-direction: column; gap: 6px; }
.pubs li:last-child { border-bottom: 1px solid #3A3F4B; }
.pub-type { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #A9B8E0; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; flex-wrap: wrap; gap: 4px 24px; padding: 16px 0; border-top: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.timeline .when { flex: 0 0 120px; font-size: 14px; color: var(--muted); }
.timeline .what { flex: 1 1 300px; font-size: 15px; }
.timeline b { font-weight: 600; }

/* Contact */
.contact { background: var(--bg-soft); }
.contact .wrap { padding-top: 96px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 28px; }
.contact h2 { font-size: clamp(36px, 5vw, 56px); line-height: 1.05; max-width: 760px; margin: 0; }
.footer-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--ink-3); }

/* Case-study pages */
.case-hero { padding: 48px 0 56px; }
.case-hero .wrap { display: flex; flex-direction: column; gap: 20px; max-width: 784px; }
.back { font-size: 14px; color: var(--ink-3); }
.facts { display: flex; flex-wrap: wrap; gap: 8px 32px; font-size: 14px; color: var(--ink-3); margin: 0; padding: 0; list-style: none; }
.facts b { color: var(--ink); font-weight: 600; }
.prose { max-width: 720px; margin: 0 auto; padding: 0 32px 96px; }
.prose h2 { font-size: 28px; margin: 48px 0 12px; }
.prose p, .prose li { color: var(--ink-2); font-size: 17px; line-height: 1.75; }
.prose ul { padding-left: 20px; }
.todo { background: #FFF6E5; border: 1px dashed var(--warm); border-radius: 10px; padding: 14px 18px; font-size: 15px; color: #6B4A1F; }

/* Motion */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.d1 { transition-delay: .12s; } .d2 { transition-delay: .24s; } .d3 { transition-delay: .36s; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .badge .dot { animation: none; }
  .card, .card:hover { transition: none; transform: none; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
  .hero { padding: 32px 0 64px; }
  .hero .wrap { gap: 32px; }
  .hero-photo { order: -1; flex-basis: 220px; max-width: 220px; }
  .section { padding: 64px 0; }
  .card { padding: 24px; }
  .contact .wrap { padding-top: 64px; }
  .prose { padding: 0 20px 64px; }
}
