/* =========================================================================
   Tran Hoang Phuc — personal site
   Palette and type follow the CV: Barlow, warm cream paper, slate + teal.
   ========================================================================= */

@font-face{ font-family:'Barlow'; font-weight:400; font-style:normal; font-display:swap;
  src:url('fonts/barlow-400.woff2') format('woff2'); }
@font-face{ font-family:'Barlow'; font-weight:600; font-style:normal; font-display:swap;
  src:url('fonts/barlow-600.woff2') format('woff2'); }
@font-face{ font-family:'Barlow'; font-weight:700; font-style:normal; font-display:swap;
  src:url('fonts/barlow-700.woff2') format('woff2'); }
@font-face{ font-family:'Barlow'; font-weight:800; font-style:normal; font-display:swap;
  src:url('fonts/barlow-800.woff2') format('woff2'); }

:root{
  --bg:      #faf7f3;
  --bg-alt:  #f2ede6;
  --surface: #ffffff;
  --ink:     #1a2228;
  --body:    #46535c;
  --muted:   #6e7d87;
  --line:    #e2dbd2;
  --accent:  #16887a;
  --accent-ink: #0e6357;
  --accent-soft:#e2f1ee;
  --slate:   #24404e;
  --shadow:  0 1px 2px rgba(26,34,40,.05), 0 8px 24px -12px rgba(26,34,40,.18);

  --wrap: 1080px;
  --r:    12px;
}

:root[data-theme="dark"]{
  --bg:      #141f26;
  --bg-alt:  #18262e;
  --surface: #1d2d36;
  --ink:     #eaf1f4;
  --body:    #b9c8d0;
  --muted:   #8ea0ab;
  --line:    #2c4049;
  --accent:  #3fc3b0;
  --accent-ink:#7fdccf;
  --accent-soft:#1b3a3a;
  --slate:   #0f1b21;
  --shadow:  0 1px 2px rgba(0,0,0,.3), 0 10px 28px -14px rgba(0,0,0,.7);
}

@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#141f26; --bg-alt:#18262e; --surface:#1d2d36; --ink:#eaf1f4; --body:#b9c8d0;
    --muted:#8ea0ab; --line:#2c4049; --accent:#3fc3b0; --accent-ink:#7fdccf;
    --accent-soft:#1b3a3a; --slate:#0f1b21;
    --shadow:0 1px 2px rgba(0,0,0,.3), 0 10px 28px -14px rgba(0,0,0,.7);
  }
}

*,*::before,*::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; scroll-padding-top:88px; }
body{
  margin:0; background:var(--bg); color:var(--body);
  font:400 17px/1.65 'Barlow',system-ui,-apple-system,'Segoe UI',sans-serif;
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
}
img{ max-width:100%; display:block; }
a{ color:var(--accent-ink); }
h1,h2,h3{ color:var(--ink); margin:0; line-height:1.15; }
p{ margin:0 0 1em; }
ul,ol{ margin:0; padding:0; list-style:none; }

.wrap{ width:100%; max-width:var(--wrap); margin:0 auto; padding:0 24px; }

.skip{
  position:absolute; left:-9999px; top:0; z-index:200;
  background:var(--accent); color:#fff; padding:12px 18px; border-radius:0 0 var(--r) 0;
}
.skip:focus{ left:0; }

:where(a,button,input):focus-visible{
  outline:2.5px solid var(--accent); outline-offset:3px; border-radius:4px;
}

/* ------------------------------- buttons -------------------------------- */
.btn{
  display:inline-flex; align-items:center; gap:9px;
  padding:13px 22px; border-radius:999px;
  background:var(--accent); color:#fff; text-decoration:none;
  font-weight:600; font-size:15.5px; letter-spacing:.2px;
  border:1.5px solid var(--accent);
  transition:transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover{ background:var(--accent-ink); border-color:var(--accent-ink);
  transform:translateY(-2px); box-shadow:var(--shadow); }
.btn svg{ width:17px; height:17px; fill:currentColor; }
.btn-ghost{ background:transparent; color:var(--ink); border-color:var(--line); }
.btn-ghost:hover{ background:var(--surface); color:var(--ink);
  border-color:var(--accent); }
.btn-sm{ padding:9px 16px; font-size:14px; }

.icon-btn{
  display:inline-grid; place-items:center; width:38px; height:38px;
  border:1.5px solid var(--line); border-radius:10px;
  background:transparent; color:var(--ink); cursor:pointer;
  transition:border-color .16s ease, background .16s ease;
}
.icon-btn:hover{ border-color:var(--accent); background:var(--surface); }
.icon-btn svg{ width:19px; height:19px; fill:currentColor; }
.i-moon{ display:none; }
:root[data-theme="dark"] .i-sun{ display:none; }
:root[data-theme="dark"] .i-moon{ display:block; }
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .i-sun{ display:none; }
  :root:not([data-theme="light"]) .i-moon{ display:block; }
}

/* -------------------------------- header -------------------------------- */
.site-header{
  position:sticky; top:0; z-index:100;
  background:color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter:saturate(160%) blur(12px);
  border-bottom:1px solid transparent;
  transition:border-color .2s ease, box-shadow .2s ease;
}
.site-header.is-stuck{ border-bottom-color:var(--line); box-shadow:0 4px 20px -18px rgba(0,0,0,.6); }
.header-inner{ display:flex; align-items:center; gap:18px; height:68px; }

.brand{ display:flex; align-items:center; gap:11px; text-decoration:none; color:var(--ink); }
.brand-mark{
  display:grid; place-items:center; width:34px; height:34px; border-radius:9px;
  background:var(--slate); color:#fff; font-weight:800; font-size:14px; letter-spacing:.5px;
}
:root[data-theme="dark"] .brand-mark{ background:var(--accent); color:#06231f; }
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .brand-mark{ background:var(--accent); color:#06231f; }
}
.brand-text{ font-weight:700; font-size:16.5px; letter-spacing:-.1px; }

.nav{ display:flex; gap:4px; margin-left:auto; }
.nav a{
  padding:8px 13px; border-radius:8px; text-decoration:none;
  color:var(--muted); font-weight:600; font-size:15px;
  transition:color .16s ease, background .16s ease;
}
.nav a:hover{ color:var(--ink); background:var(--bg-alt); }
.nav a.is-active{ color:var(--accent-ink); background:var(--accent-soft); }

.header-actions{ display:flex; align-items:center; gap:10px; }
.nav-toggle{ display:none; }

/* --------------------------------- hero --------------------------------- */
.hero{ padding:72px 0 8px; }
.hero-inner{
  display:grid; grid-template-columns:1fr auto; gap:56px; align-items:center;
}
.eyebrow{
  font-size:14px; font-weight:700; letter-spacing:2.4px; text-transform:uppercase;
  color:var(--accent-ink); margin:0 0 14px;
}
.hero h1{
  font-size:clamp(42px, 6.4vw, 68px); font-weight:800; letter-spacing:-1.4px;
  margin-bottom:20px;
}
.lede{ font-size:18.5px; line-height:1.66; max-width:56ch; color:var(--body); }
.hero-cta{ display:flex; flex-wrap:wrap; gap:12px; margin-top:28px; }

.hero-photo img{
  width:300px; height:300px; border-radius:50%; object-fit:cover;
  border:6px solid var(--surface); box-shadow:var(--shadow);
  outline:2px solid var(--accent); outline-offset:-2px;
}

.facts{
  display:grid; grid-template-columns:repeat(4,1fr); gap:1px;
  margin:64px 0 0; background:var(--line);
  border:1px solid var(--line); border-radius:var(--r); overflow:hidden;
}
.facts li{ background:var(--bg); padding:20px 22px; }
.facts strong{
  display:block; font-size:25px; font-weight:800; color:var(--ink); line-height:1.1;
}
.facts strong span{ font-size:16px; color:var(--muted); font-weight:600; }
.fact-label{ display:block; font-size:13.5px; color:var(--muted); margin-top:5px; }

/* ------------------------------- sections ------------------------------- */
.section{ padding:84px 0; }
.section-alt{ background:var(--bg-alt); }
.section-title{
  font-size:14px; font-weight:700; letter-spacing:2.6px; text-transform:uppercase;
  color:var(--muted); margin-bottom:34px; display:flex; align-items:center; gap:16px;
}
.section-title::after{ content:""; flex:1; height:1px; background:var(--line); }
.section-title span{ color:var(--ink); }

.about-grid{ display:grid; grid-template-columns:1.6fr 1fr; gap:48px; align-items:start; }
.about-grid p{ font-size:17.5px; }
.about-list{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r); padding:8px 22px; box-shadow:var(--shadow);
}
.about-list li{ padding:14px 0; border-bottom:1px solid var(--line);
  font-size:16px; color:var(--ink); font-weight:600; }
.about-list li:last-child{ border-bottom:0; }
.about-list span{ display:block; font-size:12.5px; font-weight:700; letter-spacing:1.6px;
  text-transform:uppercase; color:var(--muted); margin-bottom:3px; }

/* ------------------------------- timeline ------------------------------- */
.timeline{ position:relative; padding-left:34px; }
.timeline::before{
  content:""; position:absolute; left:7px; top:10px; bottom:10px;
  width:2px; background:var(--line);
}
.job{ position:relative; padding-bottom:38px; }
.job:last-child{ padding-bottom:0; }
.job::before{
  content:""; position:absolute; left:-34px; top:7px; width:16px; height:16px;
  border-radius:50%; background:var(--accent);
  box-shadow:0 0 0 4px var(--bg);
}
.section-alt .job::before{ box-shadow:0 0 0 4px var(--bg-alt); }
.job-head{ display:flex; flex-wrap:wrap; align-items:baseline; gap:8px 16px; }
.job h3, .edu h3{ font-size:22px; font-weight:700; letter-spacing:-.3px; }
.job-date{
  font-size:13.5px; font-weight:700; letter-spacing:.6px;
  color:var(--accent-ink); background:var(--accent-soft);
  padding:4px 11px; border-radius:999px; white-space:nowrap;
}
.job-org{ font-size:16.5px; font-weight:600; color:var(--muted); margin:5px 0 13px; }
.job-points li{
  position:relative; padding-left:19px; margin-bottom:8px; font-size:16.5px; line-height:1.6;
}
.job-points li::before{
  content:""; position:absolute; left:0; top:.68em; width:7px; height:2px;
  background:var(--accent);
}

/* -------------------------------- skills -------------------------------- */
.skill-groups{ display:grid; grid-template-columns:repeat(3,1fr); gap:24px; }
.skill-group{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r);
  padding:26px 24px 24px; box-shadow:var(--shadow);
}
.skill-group h3{
  font-size:13px; font-weight:700; letter-spacing:2px; text-transform:uppercase;
  color:var(--muted); margin-bottom:16px;
}
.tags{ display:flex; flex-wrap:wrap; gap:9px; }
.tags li{
  font-size:15px; font-weight:600; color:var(--ink);
  background:var(--bg-alt); border:1px solid var(--line);
  padding:8px 14px; border-radius:999px;
}
:root[data-theme="dark"] .tags li{ background:var(--bg); }

/* ------------------------------- education ------------------------------ */
.edu-head{ display:flex; flex-wrap:wrap; align-items:baseline; gap:8px 16px; }

/* -------------------------------- contact ------------------------------- */
.contact-lede{ font-size:18.5px; max-width:52ch; }
.contact-list{ display:flex; flex-wrap:wrap; gap:14px 40px; margin:26px 0 32px; }
.contact-list li{ display:flex; align-items:center; gap:11px; font-size:17px; color:var(--ink); }
.contact-list svg{ width:19px; height:19px; fill:var(--accent); flex:none; }
.contact-list a{ color:var(--ink); text-decoration:none; border-bottom:1.5px solid var(--accent); }
.contact-list a:hover{ color:var(--accent-ink); }
.contact-cta{ display:flex; flex-wrap:wrap; gap:12px; }

/* -------------------------------- footer -------------------------------- */
.site-footer{ border-top:1px solid var(--line); padding:28px 0; }
.footer-inner{ display:flex; align-items:center; justify-content:space-between; gap:16px; }
.site-footer p{ margin:0; font-size:15px; color:var(--muted); }
.to-top{ font-size:15px; font-weight:600; text-decoration:none; color:var(--muted); }
.to-top:hover{ color:var(--accent-ink); }

/* ------------------------------- reveals --------------------------------
   Scoped to .js so the page is fully readable if JavaScript never runs.    */
.js .reveal{ opacity:0; transform:translateY(16px); transition:opacity .6s ease, transform .6s ease; }
.js .reveal.is-in{ opacity:1; transform:none; }

/* ================================ responsive ============================= */
@media (max-width: 900px){
  .about-grid{ grid-template-columns:1fr; gap:32px; }
  .skill-groups{ grid-template-columns:1fr 1fr; }
  .facts{ grid-template-columns:1fr 1fr; }
}

@media (max-width: 780px){
  html{ scroll-padding-top:76px; }
  .nav{
    position:absolute; left:16px; right:16px; top:64px;
    flex-direction:column; gap:2px; padding:10px;
    background:var(--surface); border:1px solid var(--line);
    border-radius:var(--r); box-shadow:var(--shadow);
    display:none;
  }
  .nav.is-open{ display:flex; }
  .nav a{ padding:12px 14px; font-size:16px; }
  .nav-toggle{ display:inline-grid; }
  .header-actions{ margin-left:auto; }
  .brand-text{ display:none; }

  .hero{ padding:44px 0 0; }
  .hero-inner{ grid-template-columns:1fr; gap:30px; }
  .hero-photo{ order:-1; }
  .hero-photo img{ width:168px; height:168px; border-width:5px; }
  .lede{ font-size:17px; }
  .facts{ margin-top:44px; }

  .section{ padding:58px 0; }
  .skill-groups{ grid-template-columns:1fr; }
  .timeline{ padding-left:26px; }
  .job::before{ left:-26px; width:13px; height:13px; }
  .job h3,.edu h3{ font-size:20px; }
  .job-points li{ font-size:16px; }
  .contact-list{ flex-direction:column; gap:14px; }
  .footer-inner{ flex-direction:column; gap:8px; text-align:center; }
}

@media (max-width: 430px){
  .facts{ grid-template-columns:1fr; }
  .btn{ width:100%; justify-content:center; }
  .hero-cta, .contact-cta{ width:100%; }
}

/* ------------------------------ preferences ----------------------------- */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *,*::before,*::after{ animation:none !important; transition:none !important; }
  .js .reveal{ opacity:1; transform:none; }
}

@media print{
  .site-header,.hero-cta,.contact-cta,.site-footer,.facts{ display:none; }
  body{ background:#fff; color:#000; font-size:11pt; }
  .section{ padding:14pt 0; }
  .js .reveal{ opacity:1 !important; transform:none !important; }
}
