/* ==========================================================
   Nathan Nguyen — Portfolio (Ocean theme)
   ========================================================== */

:root {
  --bg: #F2F7FB;
  --surface: #FFFFFF;
  --border: #D6E4EF;
  --ink: #0A2540;
  --text: #23384F;
  --text-2: #31475E;
  --muted: #4B6178;
  --tint: #E1EEF8;
  --tint-2: #EDF5FB;
  --accent: #0E6BA8;
  --deep: #0A2540;
  --aqua: #7FD1F2;
  --deep-muted: #B5C8DA;
  --ok: #1F8A4C;

  --r-sm: 18px;
  --r-md: 22px;
  --r-lg: 26px;
  --r-xl: 32px;

  --max: 1240px;
  --gutter: clamp(20px, 4vw, 56px);
  --space: clamp(64px, 8vw, 112px);
  --header-h: 76px;

  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

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

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; }
img { display: block; max-width: 100%; height: auto; }

a { color: var(--ink); }
a:hover { color: var(--accent); }

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

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #FFFFFF;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; color: #FFFFFF; }

.label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.label--accent { color: var(--accent); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(242, 247, 251, 0.9);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  transition: box-shadow 0.2s ease;
}
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--border); }

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 12px;
}

.brand {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
  text-decoration: none;
  padding: 10px 0;
  color: var(--ink);
}

.nav-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 15px;
  font-weight: 600;
}
.nav-pill a {
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.nav-pill a:hover,
.nav-pill a.is-active { background: var(--tint); color: var(--ink); }
.nav-pill .nav-cta { background: var(--ink); color: #FFFFFF; }
.nav-pill .nav-cta:hover { background: var(--accent); color: #FFFFFF; }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-dark { background: var(--ink); color: #FFFFFF; }
.btn-dark:hover { background: var(--accent); color: #FFFFFF; }
.btn-light { background: var(--surface); border: 1px solid var(--border); color: var(--ink); }
.btn-light:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 48px;
  padding-top: clamp(40px, 6vw, 88px);
  padding-bottom: clamp(40px, 5vw, 64px);
}

.hero-text {
  flex: 999 1 560px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.status {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  font-weight: 800;
  font-size: clamp(40px, 5.8vw, 82px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.hero h1 .accent { color: var(--accent); }

.lead {
  max-width: 660px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: clamp(17px, 1.5vw, 20px);
  color: var(--text-2);
}

.portrait {
  flex: 0 1 360px;
  min-width: 260px;
  padding: 10px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.portrait img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: 20px;
}

/* ---------- Highlights ---------- */
.kicker {
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.stat {
  padding: 24px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-num {
  font-weight: 800;
  font-size: 50px;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--accent);
}
.stat-unit { font-size: 18px; letter-spacing: 0.06em; }
.stat-label { font-size: 15px; color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding-bottom: var(--space); }
.section--first { padding-top: var(--space); }
.section--last { padding-bottom: clamp(40px, 5vw, 64px); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 48px;
  margin-bottom: 36px;
}
.section-title {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.section-num {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.section-title h2 {
  font-weight: 800;
  font-size: 32px;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.section-intro {
  flex: 999 1 560px;
  min-width: 0;
  font-size: 18px;
  color: var(--text-2);
}

.split { display: flex; flex-wrap: wrap; gap: 24px 48px; }
.split-body {
  flex: 999 1 560px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------- Profile ---------- */
.profile-lead {
  font-weight: 700;
  font-size: clamp(21px, 2.1vw, 27px);
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.body-lg { font-size: 18px; color: var(--text-2); }

/* ---------- Selected work ---------- */
.cases { display: flex; flex-direction: column; gap: 16px; }

.case {
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 20px 48px;
}
.case-meta {
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.case-num {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--tint);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}
.case-tag {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.case-body {
  flex: 999 1 560px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.case h3 {
  font-weight: 800;
  font-size: clamp(23px, 2.3vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.case-block { display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.case-situation { max-width: 780px; }
.case-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  font-size: 15px;
}
.case-sub { display: flex; flex-direction: column; gap: 8px; }
.case-sub h4 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.case-block ul,
.case-sub ul { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }

.case-result {
  padding: 22px;
  border-radius: var(--r-sm);
  background: var(--tint-2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 15px;
}
.case-result .label { color: var(--accent); }
.case-result strong { color: var(--ink); }
.case-result--emph p { font-weight: 600; color: var(--ink); }

.result-list {
  padding-left: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 8px 32px;
  font-weight: 600;
  color: var(--ink);
}

/* ---------- Experience ---------- */
.timeline {
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px clamp(20px, 3vw, 36px);
}
.role {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 32px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.role:last-child { border-bottom: 0; }
.role-date {
  flex: 0 0 190px;
  padding-top: 3px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}
.role--current .role-date { color: var(--accent); }
.role-main { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.role-title { font-weight: 800; font-size: 19px; line-height: 1.4; color: var(--ink); }
.role-org { font-size: 15px; font-weight: 600; color: var(--muted); }
.role-desc { margin-top: 4px; font-size: 15px; color: var(--text-2); }

.creds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.cred {
  padding: 24px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cred-value { font-weight: 800; font-size: 17px; color: var(--ink); }
.cred-sub { font-size: 15px; color: var(--muted); }
.cred-line { font-size: 17px; color: var(--muted); }
.cred-line strong { font-weight: 800; color: var(--ink); }

/* ---------- Approach ---------- */
.approach-panel {
  border-radius: var(--r-xl);
  background: var(--deep);
  color: #FFFFFF;
  padding: clamp(32px, 5vw, 72px);
}
.approach-panel .section-head { margin-bottom: 40px; }
.approach-panel .section-num { color: var(--aqua); }
.approach-panel .section-title h2 { color: #FFFFFF; }
.approach-panel .section-intro { color: var(--deep-muted); }

.principles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 14px;
}
.principle {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.06);
}
.principle-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--aqua);
  color: var(--deep);
  font-weight: 800;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.principle h3 { font-weight: 800; font-size: 20px; color: #FFFFFF; }
.principle p { font-size: 15px; color: var(--deep-muted); }

/* ---------- Toolkit ---------- */
.tool-groups { gap: 28px; }
.tool-group { display: flex; flex-direction: column; gap: 10px; }
.tool-desc { font-size: 15px; color: var(--muted); }
.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.tag {
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.tag--ai {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
  font-weight: 700;
}

/* ---------- Contact ---------- */
.contact-card {
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: clamp(32px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.contact-head { display: flex; flex-direction: column; gap: 16px; }
.contact-head .label { font-size: 13px; letter-spacing: 0.1em; }
.contact-head h2 {
  font-weight: 800;
  font-size: clamp(40px, 6vw, 80px);
  line-height: 1;
  letter-spacing: -0.045em;
  color: var(--ink);
}
.contact-intro { max-width: 680px; font-size: 18px; color: var(--text-2); }
.contact-head .actions { padding-top: 6px; }
.contact-email {
  min-height: 56px;
  padding: 0 28px;
  font-size: clamp(16px, 1.6vw, 19px);
  word-break: break-all;
}

.contact-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.detail { display: flex; flex-direction: column; gap: 4px; }
.detail-value { font-size: 17px; font-weight: 600; color: var(--ink); }
a.detail-value { text-decoration: none; padding: 4px 0; }

/* ---------- Footer ---------- */
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 32px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

/* ---------- Scroll reveal (only when JS runs) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  :root { --header-h: 112px; }

  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding-block: 8px 10px;
  }
  .brand { padding: 6px 0; }
  .nav-pill { justify-content: space-between; }
  .nav-pill a { flex: 1 1 auto; text-align: center; padding: 10px 6px; font-size: 14px; }

  .hero { gap: 32px; }
  .status { border-radius: 14px; font-size: 12px; }
  .portrait { flex-basis: 100%; }
  .stats { gap: 10px; }
  .stat { padding: 20px; }
  .stat-num { font-size: 40px; }

  .role-date { flex-basis: 100%; padding-top: 0; }
  .case-result { padding: 18px; }
  .principle { padding: 22px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
}
