/* Hung Tran — Personal Site */
@import url('/css/colors_and_type.css');

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 20px; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  overflow-x: hidden;
}

a { cursor: pointer; }

/* Tweakable accent */
:root {
  --accent-color: var(--amber);
  --hero-mode: 'banner';
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 249, 251, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
}
.brand-mark { width: 26px; height: 26px; border-radius: 6px; }
.brand-word {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.01em;
  font-variation-settings: 'opsz' 36;
}
.site-nav { display: flex; align-items: center; gap: 26px; }
.nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 120ms ease;
  padding: 4px 0;
  position: relative;
}
.nav-link:hover { color: var(--fg); }
.nav-link.is-active {
  color: var(--fg);
}
.nav-link.is-active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1.5px;
  background: var(--accent-color);
}

/* ===== Hero variants ===== */
.hero {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* Banner hero (default) */
.hero.hero-banner {
  height: clamp(220px, 32vh, 360px);
  background: var(--midnight);
}
.hero.hero-banner .hero-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.85) brightness(0.9);
}
.hero.hero-banner .hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(5,19,31,0.25) 0%, rgba(5,19,31,0) 30%, rgba(5,19,31,0) 60%, rgba(5,19,31,0.55) 100%),
    linear-gradient(90deg, rgba(5,19,31,0.35) 0%, rgba(5,19,31,0) 50%);
}
.hero.hero-banner .hero-text {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px 32px;
  color: var(--shore);
}
.hero.hero-banner .hero-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--shallow);
  margin-bottom: 10px;
  opacity: 0.95;
}
.hero.hero-banner .hero-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(49.5px, 6vw, 81px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0;
  font-variation-settings: 'opsz' 144, 'SOFT' 50;
  color: var(--paper);
  max-width: 880px;
}

/* Split hero — image left, text right */
.hero.hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: clamp(320px, 54vh, 520px);
  background: var(--paper);
  border-bottom: 1px solid var(--border);
}
.hero.hero-split .hero-left {
  position: relative;
  background: var(--midnight);
  overflow: hidden;
}
.hero.hero-split .hero-left img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero.hero-split .hero-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px clamp(32px, 6vw, 88px);
}
.hero.hero-split .hero-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tide);
  margin-bottom: 14px;
}
.hero.hero-split .hero-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(36px, 3.4vw, 51.75px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 18px 0;
  color: var(--fg);
  font-variation-settings: 'opsz' 96, 'SOFT' 40;
}
.hero.hero-split .hero-lead {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--fg-muted);
  margin: 0 0 24px 0;
  max-width: 40ch;
}

/* Text-only hero — editorial */
.hero.hero-text {
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  padding: clamp(56px, 10vh, 120px) 32px clamp(48px, 7vh, 80px);
  position: relative;
}
.hero.hero-text::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/images/bathymetric_lines.png');
  background-size: 720px auto;
  background-repeat: no-repeat;
  background-position: right -120px top -80px;
  opacity: 0.28;
  pointer-events: none;
}
.hero.hero-text .hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  position: relative;
}
.hero.hero-text .hero-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tide);
  margin-bottom: 16px;
}
.hero.hero-text .hero-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(45px, 6vw, 76.5px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 20px 0;
  color: var(--fg);
  font-variation-settings: 'opsz' 144, 'SOFT' 50;
  max-width: 18ch;
}
.hero.hero-text .hero-lead {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--fg-muted);
  margin: 0;
  max-width: 52ch;
}

/* ===== Sections ===== */
section[data-section] {
  scroll-margin-top: 72px;
}
.section {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(64px, 9vh, 96px) 32px;
}
.section-prose {
  max-width: var(--container-prose);
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.section-number {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--fg-subtle);
  letter-spacing: 0.08em;
  white-space: nowrap;
  padding-top: 6px;
}
.section-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(31.5px, 2.6vw, 40.5px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin: 0;
  font-variation-settings: 'opsz' 60;
  flex: 1;
}
.section-meta {
  font-size: 14px;
  color: var(--fg-subtle);
  font-family: var(--font-sans);
}

/* ===== Intro / About ===== */
.intro-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  align-items: start;
}
.profile-pic {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.intro-copy p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--fg);
  margin: 0 0 16px 0;
  text-wrap: pretty;
}
.intro-copy .lead {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--fg-muted);
  margin: 0 0 20px 0;
  font-weight: 400;
}
.intro-now {
  margin-top: 20px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--accent-color) 8%, var(--bg-elevated));
  border-left: 3px solid var(--accent-color);
  border-radius: 0 8px 8px 0;
  font-size: 0.95rem;
  color: var(--fg-muted);
}
.intro-now-label {
  font-weight: 600;
  color: var(--accent-color);
  margin-right: 6px;
}
.quick-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  margin-top: 32px;
  border-top: 1px solid var(--border);
}
.quick-fact {
  padding: 16px 20px;
  border-right: 1px solid var(--border);
  text-align: center;
}
.quick-fact:last-child { border-right: 0; padding-right: 0; }
.quick-fact-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tide);
  margin-bottom: 6px;
}
.quick-fact-value {
  font-size: 16px;
  color: var(--fg);
  font-weight: 500;
  line-height: 1.4;
}

/* ===== Projects ===== */
.projects-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
.project-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 200ms cubic-bezier(0.2,0,0,1), box-shadow 200ms ease, border-color 200ms ease;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
}
.project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.project-card-body {
  padding: 28px 32px;
}
.project-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 6px;
}
.project-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tide);
}
.project-year {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--fg-subtle);
}
.project-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--fg);
  margin: 0 0 10px 0;
  font-variation-settings: 'opsz' 48;
}
.project-lead {
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg-muted);
  margin: 0 0 18px 0;
  max-width: 60ch;
}
.project-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.project-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--foam);
  color: var(--navy);
}
.tag-ocean     { background: #daedf7; color: #1a5575; }
.tag-climate   { background: #daf0e2; color: #1a5430; }
.tag-finance   { background: #fdf0d0; color: #7a5200; }
.tag-policy    { background: #fde8e2; color: #7a2818; }
.tag-consulting{ background: #eeecea; color: #473e35; }
.tag-product   { background: #ece8f5; color: #3d2875; }
.tag-community { background: #fdf0e2; color: #7a4500; }
.tag-default   { background: var(--foam); color: var(--navy); }
.project-cta {
  font-size: 15px;
  color: var(--link);
  font-weight: 500;
  transition: transform 200ms ease;
}
.project-card:hover .project-cta {
  transform: translateX(2px);
}

/* Expanded project content */
.project-expanded {
  max-height: 0;
  overflow: hidden;
  transition: max-height 400ms cubic-bezier(0.2,0,0,1);
  border-top: 0;
}
.project-card.is-open .project-expanded {
  max-height: 2400px;
  border-top: 1px solid var(--border);
}
.project-expanded-inner {
  padding: 28px 32px 32px;
  background: var(--shore);
}
.project-expanded h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 16px;
  color: var(--navy);
  margin: 20px 0 8px 0;
  letter-spacing: -0.005em;
}
.project-expanded h4:first-child { margin-top: 0; }
.project-expanded p, .project-expanded li {
  font-size: 16px;
  line-height: 1.65;
  color: var(--fg);
}
.project-expanded p { margin: 0 0 12px 0; max-width: 64ch; }
.project-expanded ul { margin: 0 0 16px 0; padding-left: 20px; }
.project-expanded li { margin-bottom: 6px; }
.project-expanded strong { color: var(--navy); font-weight: 600; }
.project-expanded blockquote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--fg-muted);
  border-left: 2px solid var(--accent-color);
  padding-left: 18px;
  margin: 20px 0;
  max-width: 60ch;
}

/* ===== Past Work ===== */
.past-work-head {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 48px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.past-work-list {
  display: grid;
  gap: 0;
}
.past-work-item {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.past-work-item:last-child { border-bottom: 0; }
.past-work-year {
  font-size: 0.8rem;
  color: var(--fg-muted);
  padding-top: 2px;
}
.past-work-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg);
}
.past-work-lead {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin: 4px 0 0;
  line-height: 1.5;
}
.past-work-tags {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}
.past-work-toggle {
  margin-top: 12px;
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.past-work-toggle:hover {
  background: var(--accent);
  color: #fff;
}

/* ===== Resume / CV ===== */
.resume-toggle {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.resume {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}
.resume-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
  padding-bottom: 10px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}
.resume-name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(31.5px, 3vw, 40.5px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 4px 0;
  color: var(--fg);
  font-variation-settings: 'opsz' 72;
}
.resume-subtitle {
  font-size: 16px;
  color: var(--fg-muted);
  margin: 0;
}
.resume-contact {
  text-align: right;
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.7;
}
.resume-contact a {
  color: var(--fg-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 1px;
  transition: color 120ms ease, border-color 120ms ease;
}
.resume-contact a:hover {
  color: var(--link);
  border-color: var(--accent-color);
}
.resume-section {
  margin-bottom: 0;
  padding: 10px 16px;
  border-radius: 8px;
}
.resume-section:nth-child(odd) {
  background: var(--foam);
}
.resume-section:nth-child(even) {
  background: transparent;
}
.resume-detail {
  font-size: 14.5px;
  color: var(--fg-muted);
  margin: 4px 0 0 0;
  line-height: 1.5;
  font-style: italic;
}
.resume-section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tide);
  margin-bottom: 6px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--border-subtle);
}
.resume-entry {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid var(--border-subtle);
}
.resume-entry:first-of-type { border-top: 0; padding-top: 0; }
.resume-date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-subtle);
  line-height: 1.5;
  padding-top: 2px;
}
.resume-role {
  font-weight: 600;
  font-size: 16px;
  color: var(--fg);
  margin: 0 0 1px 0;
}
.resume-org {
  font-size: 15px;
  color: var(--fg-muted);
  margin: 0 0 4px 0;
}
.resume-org-inline {
  font-weight: 400;
  color: var(--fg-muted);
}
.resume-entry-compact {
  padding: 4px 0;
}
.resume-entry ul {
  margin: 0;
  padding-left: 16px;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--fg);
}
.resume-entry li { margin-bottom: 2px; }
.resume-entry li strong { color: var(--navy); font-weight: 600; }
.skill-grid {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
}
.skill-row {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: span 2;
  padding: 4px 0;
  border-top: 1px solid var(--border-subtle);
  align-items: baseline;
}
.skill-row:first-child { border-top: 0; padding-top: 0; }
.skill-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tide);
}
.skill-body {
  font-size: 15px;
  color: var(--fg);
  line-height: 1.5;
}

.resume-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}
.btn {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 6px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 120ms ease;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
}
.btn-primary {
  background: var(--navy);
  color: var(--shore);
  border-color: var(--navy);
}
.btn-primary:hover { background: var(--midnight); border-color: var(--midnight); color: var(--shore); }
.btn-secondary {
  background: var(--paper);
  color: var(--fg);
  border-color: var(--border-strong);
}
.btn-secondary:hover { border-color: var(--fg-muted); }

/* ===== Consulting ===== */
.consulting-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.consult-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}
.consult-intro p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--fg);
  margin: 0 0 16px 0;
}
.consult-services {
  list-style: none;
  padding: 0;
  margin: 0;
}
.consult-services li {
  padding: 10px 0;
  border-top: 1px solid var(--border-subtle);
  font-size: 16px;
  color: var(--fg);
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.consult-services li::before {
  content: '→';
  color: var(--accent-color);
  font-size: 12px;
  font-weight: 600;
}
.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0;
}
.case-item {
  padding: 24px 28px;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: center;
}
.case-item:last-child { border-right: 0; }
.case-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tide);
  margin-bottom: 8px;
}
.case-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.2rem;
  line-height: 1.25;
  margin: 0 0 10px 0;
  color: var(--fg);
  font-variation-settings: 'opsz' 36;
}
.case-item p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg-muted);
  margin: 0;
}

/* ===== Flood Map ===== */
.flood-map-wrap {
  margin: 24px 0 8px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.flood-map-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
}
.flood-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 2px solid var(--layer-color, var(--border));
  background: transparent;
  color: var(--fg-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms, color 150ms;
}
.flood-btn.is-on {
  background: var(--layer-color);
  color: #fff;
}
.flood-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--layer-color);
  opacity: 0.8;
}
.flood-btn.is-on .flood-swatch { background: #fff; }
.flood-status {
  font-size: 0.8rem;
  color: var(--fg-muted);
  font-style: italic;
  margin-left: 8px;
}
.flood-map {
  height: 420px;
  width: 100%;
}
.map-note {
  font-size: 0.8rem;
  color: var(--fg-muted);
  font-style: italic;
  margin-top: 8px;
}

/* ===== Empty state ===== */
.empty-state {
  color: var(--fg-muted);
  font-style: italic;
  padding: 32px 0;
}

/* ===== People & Orgs ===== */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.person-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.person-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.person-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--fg);
}
.person-role {
  font-size: 0.8rem;
  color: var(--accent-color);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.person-why {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.5;
  flex: 1;
  margin: 0 0 12px 0;
}
.person-cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-color);
}

/* ===== Data Finds ===== */
.data-finds-list {
  display: grid;
  gap: 16px;
}
.data-find {
  padding: 20px 24px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent-color);
  border-radius: 0 12px 12px 0;
}
.data-stat {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 8px;
}
.data-context {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.6;
  margin: 0 0 12px 0;
}
.data-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.data-source {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-color);
  text-decoration: none;
}
.data-source:hover { text-decoration: underline; }
.data-date {
  font-size: 0.8rem;
  color: var(--fg-subtle, var(--fg-muted));
}

/* ===== Writing / Blog ===== */
.blog-list {
  display: grid;
  gap: 0;
}
.blog-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 32px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  align-items: baseline;
  text-decoration: none;
  color: inherit;
  transition: background 150ms ease, padding 150ms ease;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  border-radius: 6px;
}
.blog-item:hover {
  background: var(--foam);
}
.blog-date {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--fg-subtle);
}
.blog-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 0 0 6px 0;
  font-variation-settings: 'opsz' 42;
}
.blog-excerpt {
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg-muted);
  margin: 0;
  max-width: 62ch;
}
.blog-arrow {
  font-size: 16px;
  color: var(--fg-faint);
  transition: transform 200ms ease, color 200ms ease;
}
.blog-item:hover .blog-arrow {
  transform: translateX(3px);
  color: var(--accent-color);
}

/* ===== Reading Reviews ===== */
.reading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}
.book-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  box-shadow: var(--shadow-xs);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.book-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.book-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  gap: 12px;
}
.book-rating {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--accent-color);
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.book-status {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tide);
}
.book-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.1rem;
  line-height: 1.3;
  color: var(--fg);
  margin: 0 0 4px 0;
  font-variation-settings: 'opsz' 36;
}
.book-author {
  font-size: 14.5px;
  color: var(--fg-muted);
  margin: 0 0 14px 0;
  font-style: italic;
}
.book-note {
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg);
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

/* ===== Contact ===== */
.contact-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.contact-lede {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.375rem;
  line-height: 1.45;
  color: var(--fg-muted);
  margin: 0;
  max-width: 22ch;
}
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.contact-list li {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  align-items: baseline;
}
.contact-list li:first-child { border-top: 0; padding-top: 4px; }
.contact-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tide);
}
.contact-value {
  font-size: 17px;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 120ms ease, color 120ms ease;
}
a.contact-value:hover {
  color: var(--link);
  border-color: var(--accent-color);
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 40px;
  margin-top: 48px;
  background: var(--bg);
}
.site-footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  color: var(--fg-subtle);
}
.site-footer-inner a {
  color: var(--fg-muted);
  text-decoration: none;
  margin-right: 16px;
}
.site-footer-inner a:hover { color: var(--tide); }
.footer-right { display: flex; align-items: center; }
.footer-right a:last-child { margin-right: 0; }

/* ===== Fade-in on mount ===== */
.fade-in {
  opacity: 0;
  transform: translateY(8px);
  animation: fade-up 600ms cubic-bezier(0.2,0,0,1) forwards;
}
.fade-in.d-1 { animation-delay: 80ms; }
.fade-in.d-2 { animation-delay: 160ms; }
.fade-in.d-3 { animation-delay: 240ms; }
@keyframes fade-up {
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Reveal on scroll ===== */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 600ms cubic-bezier(0.2,0,0,1), transform 600ms cubic-bezier(0.2,0,0,1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Resume toggle (reused tweak-btn) ===== */
.tweak-btn {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 8px;
  border-radius: 5px;
  background: var(--paper);
  border: 1px solid var(--border-strong);
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 120ms ease;
  text-align: center;
}
.tweak-btn:hover { border-color: var(--fg-muted); color: var(--fg); }
.tweak-btn.is-on {
  background: var(--navy);
  color: var(--shore);
  border-color: var(--navy);
}

/* ===== Dark mode toggle ===== */
.dark-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
  flex-shrink: 0;
}
.dark-toggle:hover {
  background: var(--bg-subtle);
  color: var(--fg);
  border-color: var(--fg-muted);
}
[data-theme="dark"] .blog-item:hover { background: var(--bg-subtle); }
[data-theme="dark"] .site-header {
  background: rgba(10, 37, 64, 0.88);
}
[data-theme="dark"] .resume-section:nth-child(odd) {
  background: var(--bg-subtle);
}
[data-theme="dark"] .project-expanded-inner {
  background: var(--bg-subtle);
}
[data-theme="dark"] .resume-entry li strong,
[data-theme="dark"] .project-expanded h4,
[data-theme="dark"] .project-expanded strong {
  color: var(--shallow);
}
[data-theme="dark"] .depth-gauge {
  background: rgba(10, 37, 64, 0.85);
  border-color: var(--border);
}

/* ===== Depth Gauge ===== */
.depth-gauge {
  position: fixed;
  left: 16px;
  top: 80px;
  bottom: 30px;
  width: 112px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
  pointer-events: none;
  background: rgba(245, 249, 251, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 10px 10px;
}
@media (max-width: 1360px) { .depth-gauge { display: none; } }

.dg-readout {
  display: flex;
  align-items: baseline;
  gap: 3px;
}
.dg-num {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
  min-width: 40px;
  text-align: right;
}
.dg-unit {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
}
.dg-zone-cur {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tide);
  text-align: right;
  margin-top: -4px;
}

.dg-track-wrap {
  flex: 1;
  position: relative;
}
.dg-sub {
  position: absolute;
  left: 2px;
  width: 40px;
  height: 20px;
  transform: translateY(-50%) scaleX(-1);
  transition: top 80ms linear;
  color: var(--tide);
  pointer-events: none;
}
.dg-sub svg { display: block; width: 40px; height: 20px; }

.dg-track {
  position: absolute;
  left: 44px;
  top: 0;
  bottom: 0;
  width: 5px;
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.dg-band { width: 100%; }

.dg-labels {
  position: absolute;
  left: 56px;
  top: 0;
  bottom: 0;
  right: 0;
}
.dg-zone {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 4px;
  transform: translateY(-50%);
}
.dg-tick {
  display: inline-block;
  width: 6px;
  height: 1.5px;
  background: var(--border-strong);
  flex-shrink: 0;
}
.dg-name {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* ===== Section Dots ===== */
.section-dots {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
}
@media (max-width: 1360px) { .section-dots { display: none; } }

.sd-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cloud);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 200ms ease, transform 200ms ease;
}
.sd-dot:hover { background: var(--steel); transform: scale(1.4); }
.sd-dot.is-active {
  background: var(--accent-color);
  transform: scale(1.3);
}
.sd-label {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--fg-subtle);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
  background: var(--bg-elevated);
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.sd-dot:hover .sd-label,
.sd-dot.is-active .sd-label { opacity: 1; }

/* ===== Tide line ===== */
.tide-line {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(to right, var(--shallow), var(--tide), var(--ocean));
  z-index: 200;
  pointer-events: none;
  transition: width 120ms linear;
}

/* ===== Sonar pulse on active dot ===== */
.sd-dot.is-active::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-color);
  animation: sonar-ping 2.4s ease-out infinite;
  opacity: 0;
}
@keyframes sonar-ping {
  0%   { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(2.8); opacity: 0; }
}

/* ===== Bathymetric lines on intro ===== */
#intro {
  position: relative;
  overflow: hidden;
}
#intro::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/images/bathymetric_lines.png') center / cover no-repeat;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}
#intro > * { position: relative; z-index: 1; }

/* ===== Responsive ===== */
@media (max-width: 760px) {
  .site-header-inner { padding: 0 20px; }
  .site-nav { gap: 16px; }
  .brand-word { display: none; }
  .nav-link { font-size: 13px; }
  .section { padding: 56px 20px; }
  .hero.hero-split { grid-template-columns: 1fr; min-height: auto; }
  .hero.hero-split .hero-left { height: 200px; }
  .hero.hero-split .hero-right { padding: 32px 20px 40px; }
  .intro-grid { grid-template-columns: 1fr; gap: 24px; }
  .profile-pic { max-width: 140px; }
  .consult-intro { grid-template-columns: 1fr; gap: 24px; }
  .contact-block { grid-template-columns: 1fr; gap: 24px; }
  .resume-head { grid-template-columns: 1fr; align-items: start; }
  .resume-contact { text-align: left; }
  .resume-entry { grid-template-columns: 1fr; gap: 6px; }
  .skill-grid { grid-template-columns: 1fr; gap: 6px; }
  .skill-row { grid-template-columns: 1fr; gap: 4px; padding: 14px 0; }
  .blog-item { grid-template-columns: 1fr; gap: 6px; }
  .blog-arrow { display: none; }
  .quick-facts { grid-template-columns: 1fr 1fr; }
  .quick-fact { border-right: 0; border-bottom: 1px solid var(--border); padding: 14px 0; }
}

/* Print-friendly for resume */
@media print {
  .site-header, .site-footer, .hero { display: none !important; }
  body { background: white; }
  section { page-break-inside: avoid; }
}
