/* ============================================================
   drtunguyen.ai — styles
   Palette: deep teal + fresh accent, calm clinical whitespace
   ============================================================ */

:root {
  --ink:        #0f172a;   /* headings / near-black slate */
  --body:       #334155;   /* body text */
  --muted:      #64748b;   /* secondary text */
  --line:       #e2e8f0;   /* hairlines / borders */
  --bg:         #ffffff;
  --bg-alt:     #f6f9fa;   /* alternating section bg */
  --primary:    #0e5a6b;   /* deep teal */
  --primary-dk: #0a4351;
  --accent:     #14b8a6;   /* teal accent */
  --accent-soft:#ccfbf1;
  --ring:       rgba(20,184,166,.35);

  --maxw: 1120px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.05);
  --shadow-md: 0 10px 30px -12px rgba(15,23,42,.18);
  --shadow-lg: 0 24px 60px -20px rgba(14,90,107,.35);

  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--body);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3 { color: var(--ink); line-height: 1.15; margin: 0; font-weight: 600; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 5vw, 40px); }

/* Placeholder text styling — makes TODO content obvious before you fill it in */
.todo-inline { color: #b45309; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 13px 24px; border-radius: 999px;
  font-weight: 600; font-size: .98rem; cursor: pointer;
  border: 1.5px solid transparent; transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-md); }
.btn--primary:hover { background: var(--primary-dk); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--primary); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--primary); background: #fff; }
.btn--ghost-light { color: #fff; border-color: rgba(255,255,255,.5); }
.btn--ghost-light:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.btn--on-teal { background: #fff; color: var(--primary); box-shadow: var(--shadow-md); }
.btn--on-teal:hover { background: #eefcfa; color: var(--primary-dk); transform: translateY(-2px); }

/* ============================================================
   NAV
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.8);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: var(--maxw); margin: 0 auto; padding: 14px clamp(20px, 5vw, 40px);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.nav__brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 600; }
.nav__monogram {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: var(--primary); color: #fff; font-family: var(--font-serif); font-weight: 600; font-size: 1rem;
  letter-spacing: .5px;
}
.nav__name { font-size: 1.05rem; }
.nav__cred { color: var(--primary); }
.nav__menu { display: flex; align-items: center; gap: 4px; }
.nav__menu a {
  display: inline-block; padding: 8px 14px; color: var(--body); font-weight: 500;
  font-size: .96rem; border-radius: 8px; transition: color .15s ease, background .15s ease;
}
.nav__menu a:hover { color: var(--primary); background: var(--bg-alt); }
.nav__menu a.is-active { color: var(--primary); }
.nav__cta {
  background: var(--primary); color: #fff !important; margin-left: 6px;
}
.nav__cta:hover { background: var(--primary-dk) !important; }

.nav__toggle {
  display: none; flex-direction: column; gap: 5px; background: none; border: 0;
  padding: 8px; cursor: pointer;
}
.nav__toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; overflow: hidden; }
.hero__bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(60% 80% at 85% -10%, rgba(20,184,166,.14), transparent 60%),
    radial-gradient(50% 60% at 0% 100%, rgba(14,90,107,.10), transparent 60%),
    linear-gradient(180deg, #f8fbfc 0%, #ffffff 100%);
}
.hero__inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.4fr .9fr; gap: clamp(28px, 5vw, 64px);
  align-items: center; padding: clamp(56px, 9vw, 110px) 0;
}
.hero__eyebrow { color: var(--primary); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: .82rem; margin: 0 0 14px; }
.hero__title { font-family: var(--font-serif); font-weight: 500; font-size: clamp(2.6rem, 6.5vw, 4.6rem); letter-spacing: -.01em; }
.hero__title-cred { color: var(--primary); }
.hero__tagline { font-size: clamp(1.05rem, 2vw, 1.28rem); color: var(--muted); margin: 18px 0 30px; max-width: 46ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero__links { margin-top: 26px; }
.hero__links a { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; }
.hero__links a:hover { color: var(--primary); }

.hero__portrait { display: grid; place-items: center; }
.portrait-placeholder, .hero__portrait img {
  width: min(360px, 82vw); border-radius: 24px; box-shadow: var(--shadow-lg);
}
/* Show the full (square) photo — height follows the image's natural ratio, so
   nothing is cropped on the sides. */
.hero__portrait img { height: auto; display: block; }
.portrait-placeholder {
  aspect-ratio: 1; object-fit: cover;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--primary), var(--primary-dk));
  color: rgba(255,255,255,.92); font-family: var(--font-serif); font-size: clamp(3rem, 10vw, 5rem);
  letter-spacing: 2px; border: 6px solid #fff;
}

/* ============================================================
   SECTIONS (shared)
   ============================================================ */
.section { padding: clamp(64px, 9vw, 110px) 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section__kicker { color: var(--accent); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; margin: 0 0 10px; }
.section__kicker--light { color: var(--accent-soft); }
.section__title { font-family: var(--font-serif); font-weight: 500; font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: 18px; letter-spacing: -.01em; }
.section__title--light { color: #fff; }
.section__lead { color: var(--muted); font-size: 1.12rem; max-width: 60ch; margin: 0 0 8px; }
.section__lead--light { color: rgba(255,255,255,.85); }

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: clamp(28px, 5vw, 56px); margin-top: 28px; align-items: start; }
.about__body p { margin: 0 0 18px; font-size: 1.08rem; }
.about__body p:last-child { margin-bottom: 0; }
.facts { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 22px; box-shadow: var(--shadow-sm); }
.facts li { display: flex; justify-content: space-between; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.facts li:last-child { border-bottom: 0; }
.facts__label { color: var(--muted); font-weight: 500; }
.facts__value { color: var(--ink); font-weight: 600; text-align: right; }

/* ---------- Timeline ---------- */
.timeline { position: relative; margin-top: 36px; padding-left: 8px; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--accent), var(--line)); }
.timeline__item { position: relative; padding-left: 46px; margin-bottom: 26px; }
.timeline__item:last-child { margin-bottom: 0; }
.timeline__marker { position: absolute; left: 8px; top: 22px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 0 0 4px rgba(20,184,166,.12); }
.timeline__card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; box-shadow: var(--shadow-sm); transition: box-shadow .2s ease, transform .2s ease; }
.timeline__card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.timeline__period { color: var(--accent); font-weight: 600; font-size: .85rem; letter-spacing: .03em; text-transform: uppercase; margin: 0 0 6px; }
.timeline__role { font-size: 1.25rem; margin: 0 0 4px; }
.timeline__org { color: var(--primary); font-weight: 500; margin: 0 0 10px; }
.timeline__desc { color: var(--body); margin: 0; }

/* ---------- Cards (education) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; margin-top: 36px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); transition: box-shadow .2s ease, transform .2s ease; }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.card__title { color: var(--accent); font-size: .82rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 12px; }
.card__primary { color: var(--ink); font-weight: 600; font-size: 1.12rem; margin: 0 0 6px; }
.card__meta { color: var(--muted); margin: 0; font-size: .95rem; }
.subhead { font-family: var(--font-sans); font-weight: 600; font-size: 1.05rem; color: var(--ink); margin: 44px 0 18px; letter-spacing: .01em; }
.subhead--first { margin-top: 30px; }

/* ---------- Feature (highlighted project) ---------- */
.feature { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); padding: clamp(26px, 4vw, 44px); box-shadow: var(--shadow-md); max-width: 820px; margin-top: 30px; }
.feature__tag { display: inline-block; background: var(--accent-soft); color: var(--primary-dk); font-weight: 700; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; padding: 7px 15px; border-radius: 999px; margin-bottom: 18px; }
.feature__title { font-family: var(--font-serif); font-weight: 500; font-size: clamp(1.35rem, 2.6vw, 1.95rem); color: var(--ink); margin: 0 0 12px; line-height: 1.2; }
.feature__hosts { color: var(--primary); font-weight: 600; margin: 0 0 4px; }
.feature__meta { color: var(--muted); margin: 0 0 18px; font-size: .95rem; }
.feature__desc { color: var(--body); margin: 0 0 22px; max-width: 62ch; }
.feature__list { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 11px; max-width: 60ch; }
.feature__list li { position: relative; padding-left: 32px; color: var(--body); }
.feature__list li::before {
  content: ""; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a4351' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center / 12px 12px no-repeat;
}
.feature__meta strong { color: var(--ink); font-weight: 600; }
.feature__link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--primary); transition: gap .15s ease, color .15s ease; }
.feature__link:hover { color: var(--primary-dk); gap: 12px; }
.feature__links { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin: 4px 0 22px; }

/* Two-column feature: text + phone mockup */
.feature--split { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(28px, 4vw, 52px); align-items: center; max-width: 960px; }
.feature__main { min-width: 0; }
.feature__main .feature__meta { margin-bottom: 0; }
.feature__aside { display: flex; justify-content: center; }

/* App screenshot — a pre-framed phone mockup (the bezel is part of the PNG, which has a transparent background) */
.app-shot { display: block; width: 270px; max-width: 76vw; height: auto; filter: drop-shadow(0 22px 34px rgba(15, 23, 42, .26)); }

@media (max-width: 760px) {
  .feature--split { grid-template-columns: 1fr; }
  .feature__aside { margin-top: 6px; }
}

/* ---------- Pills (expertise) ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.pill { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 10px 20px; font-weight: 500; color: var(--ink); box-shadow: var(--shadow-sm); transition: border-color .2s ease, color .2s ease, transform .2s ease; }
.pill:hover { border-color: var(--accent); color: var(--primary); transform: translateY(-2px); }

/* ---------- Publications ---------- */
.pub-list { margin-top: 30px; }
.pub { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); padding: 20px 24px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.pub__title { color: var(--ink); font-weight: 600; margin: 0 0 6px; font-size: 1.06rem; }
.pub__meta { color: var(--muted); margin: 0; font-size: .95rem; }

/* ---------- Contact ---------- */
.section--contact { background: linear-gradient(135deg, var(--primary-dk), var(--primary)); position: relative; overflow: hidden; }
.section--contact::after { content: ""; position: absolute; inset: 0; background: radial-gradient(50% 80% at 90% 0%, rgba(20,184,166,.35), transparent 55%); pointer-events: none; }
.section--contact .container { position: relative; z-index: 1; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: rgba(255,255,255,.7); padding: 30px 0; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer p { margin: 0; font-size: .92rem; }
.footer__meta { color: var(--accent); font-weight: 500; }

/* ============================================================
   Scroll reveal animation
   ============================================================ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero__text { order: 2; }
  .hero__portrait { order: 1; }
  .hero__actions, .hero__links { justify-content: center; }
  .hero__tagline { margin-inline: auto; }
  .about__grid { grid-template-columns: 1fr; }

  .nav__toggle { display: flex; }
  .nav__menu {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 12px clamp(20px, 5vw, 40px) 20px;
    box-shadow: var(--shadow-md);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: transform .2s ease, opacity .2s ease;
  }
  .nav__menu.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav__menu a { padding: 12px 14px; }
  .nav__cta { margin-left: 0; text-align: center; margin-top: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
