/*
  styles.css  —  all styling for the site.
  Design tokens (colors, spacing) live in :root at the top, so you can
  re-skin the whole site by changing a handful of values here.

  Direction: dark-dominant. Deep navy (#163E64, sampled from the résumé) is the
  primary surface; a warm off-white is the secondary. Sharp corners everywhere,
  text links instead of buttons, large editorial type.
*/

:root {
  /* Core palette */
  --navy: #163E64;          /* primary surface */
  --navy-deep: #102F4D;     /* deeper sections / footer */
  --navy-raise: #1C4A76;    /* raised cards on dark */
  --paper: #F4F1EA;         /* the light / "white" secondary */
  --ink: #14283A;           /* text on light surfaces */
  --ink-muted: #5C6B79;

  /* Text on dark */
  --on-dark: #EAEFF4;
  --on-dark-muted: rgba(234, 239, 244, .62);
  --line: rgba(234, 239, 244, .16);      /* hairline borders on dark */
  --line-strong: rgba(234, 239, 244, .30);
  --accent: #9FC2E0;         /* pale steel-blue highlight, used sparingly */

  --maxw: 1120px;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--on-dark);
  background: var(--navy);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

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

/* ---------- Type ---------- */
h1, h2, h3 { color: var(--on-dark); line-height: 1.08; margin: 0 0 .4em; font-weight: 400; }
h1 { font-family: var(--serif); font-size: clamp(2.6rem, 7vw, 5rem); letter-spacing: -.015em; }
h2 { font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.01em; }
h3 { font-size: 1.15rem; font-weight: 500; letter-spacing: -.005em; }
p { margin: 0 0 1rem; }

.eyebrow {
  text-transform: uppercase; letter-spacing: .22em; font-size: .74rem;
  font-weight: 600; color: var(--accent); margin: 0 0 1.2rem;
}

/* Text links — the site's only "button". */
.text-link {
  display: inline-flex; align-items: center; gap: .45rem;
  color: var(--on-dark); font-weight: 500; font-size: 1rem;
  padding-bottom: 2px; border-bottom: 1px solid var(--line-strong);
  transition: color .18s ease, border-color .18s ease, gap .18s ease;
}
.text-link:hover { color: var(--accent); border-color: var(--accent); gap: .7rem; }

/* On light surfaces */
.on-light .text-link { color: var(--ink); border-color: rgba(20, 40, 58, .28); }
.on-light .text-link:hover { color: var(--navy); border-color: var(--navy); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(16, 47, 77, .72);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--on-dark); }
.brand-mark { width: 26px; height: 26px; color: var(--on-dark); display: block; }
.brand-name { font-family: var(--serif); font-size: 1.15rem; letter-spacing: .01em; }
.brand:hover .brand-name { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  color: var(--on-dark-muted); font-weight: 500; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .14em;
  padding-bottom: 4px; border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.nav-links a:hover { color: var(--on-dark); }
.nav-links a.active { color: var(--on-dark); border-color: var(--accent); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line-strong);
  width: 44px; height: 42px; cursor: pointer; color: var(--on-dark); font-size: 1.2rem;
}

/* ---------- Home launchpad ---------- */
.home-header { border-bottom: none; background: transparent; position: static; }

.launch { min-height: calc(100vh - 72px); display: flex; align-items: center; padding: clamp(2rem, 6vw, 4rem) 0; }
.launch-grid { display: grid; grid-template-columns: 1fr; gap: clamp(2.5rem, 6vw, 4.5rem); width: 100%; }
@media (min-width: 900px) { .launch-grid { grid-template-columns: 1.05fr 1fr; align-items: center; } }

.launch-loc { text-transform: uppercase; letter-spacing: .22em; font-size: .74rem; font-weight: 600; color: var(--accent); margin: 0 0 1.4rem; }
.launch-name { font-family: var(--serif); font-size: clamp(3rem, 9vw, 6.5rem); line-height: .98; letter-spacing: -.02em; margin: 0 0 1.6rem; }
.launch-tagline { font-size: clamp(1.1rem, 2.2vw, 1.45rem); color: var(--on-dark-muted); max-width: 34ch; margin: 0; }

/* The big text-link index */
.launch-index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.launch-index li { border-bottom: 1px solid var(--line); }
.launch-index a {
  display: flex; align-items: baseline; gap: 1rem;
  padding: clamp(.9rem, 2.4vw, 1.35rem) 0;
  color: var(--on-dark); transition: color .18s ease, padding-left .2s ease;
}
.launch-index a:hover { color: var(--accent); padding-left: .6rem; }
.launch-index .li-num { font-size: .78rem; font-weight: 600; letter-spacing: .1em; color: var(--on-dark-muted); width: 2.2rem; flex: none; }
.launch-index .li-label { font-family: var(--serif); font-size: clamp(1.5rem, 3.4vw, 2.2rem); line-height: 1.05; flex: 1; }
.launch-index .li-arrow { color: var(--on-dark-muted); transition: transform .2s ease, color .18s ease; }
.launch-index a:hover .li-arrow { color: var(--accent); transform: translateX(4px); }

/* ---------- Section scaffolding ---------- */
.section { padding: clamp(3rem, 8vw, 6rem) 0; }
.section-lead { max-width: 60ch; color: var(--on-dark-muted); font-size: 1.12rem; margin: 0 0 3rem; }
.page-head { max-width: 62ch; margin-bottom: clamp(2.5rem, 6vw, 4rem); }

/* A light "paper" band, used sparingly for contrast */
.band-light { background: var(--paper); color: var(--ink); }
.band-light h1, .band-light h2, .band-light h3 { color: var(--ink); }
.on-light, .on-light p { color: var(--ink); }
.on-light .eyebrow { color: var(--navy); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr; gap: clamp(2rem, 5vw, 3.5rem); align-items: start; }
@media (min-width: 860px) { .about-grid { grid-template-columns: 1.4fr .9fr; } }
.about-lead { font-family: var(--serif); font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.3; color: var(--on-dark); margin: 0 0 2rem; }
.about-body p { font-size: 1.08rem; color: var(--on-dark-muted); }
.about-body p:last-child { margin-bottom: 0; }
.about-movies { margin-top: 2.2rem; padding-top: 1.6rem; border-top: 1px solid var(--line); color: var(--on-dark-muted); font-size: 1.02rem; }
.about-movies a { color: var(--on-dark); border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; transition: color .18s ease, border-color .18s ease; }
.about-movies a:hover { color: var(--accent); border-color: var(--accent); }

.photo-frame {
  position: relative; width: 100%; aspect-ratio: 4 / 5; overflow: hidden;
  background: var(--navy-raise); border: 1px solid var(--line);
}
.photo-frame::after {
  content: "KH"; position: absolute; inset: 0; z-index: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 4rem; color: var(--on-dark); opacity: .3;
}
.photo-frame img {
  position: relative; z-index: 1; width: 100%; height: 100%;
  object-fit: cover; object-position: center 20%; opacity: 0; transition: opacity .4s ease;
}
.photo-frame img.loaded { opacity: 1; }

/* ---------- Experience timeline ---------- */
.timeline-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 3.5rem; align-items: start; }
@media (max-width: 860px) { .timeline-layout { grid-template-columns: 1fr; gap: 2.5rem; } }

.timeline { position: relative; padding-left: 34px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.tl-progress { position: absolute; left: 9px; top: 6px; width: 1px; height: 0; background: var(--accent); transition: height .15s linear; }
.tl-item { position: relative; margin-bottom: 1.4rem; outline: none; opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.tl-item.in { opacity: 1; transform: none; }
.tl-dot {
  position: absolute; left: -34px; top: 22px; width: 15px; height: 15px;
  background: var(--navy); border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--navy);
  transition: background .2s, transform .2s;
}
.tl-item:hover .tl-dot, .tl-item:focus .tl-dot { background: var(--accent); transform: scale(1.15); }
.tl-card { background: var(--navy-raise); border: 1px solid var(--line); padding: 1.3rem 1.5rem; transition: transform .16s ease, border-color .2s ease; }
.tl-item:hover .tl-card, .tl-item:focus .tl-card { transform: translateY(-2px); border-color: var(--line-strong); }
.tl-dates { font-size: .78rem; font-weight: 600; color: var(--accent); letter-spacing: .08em; text-transform: uppercase; margin: 0 0 .4rem; }
.tl-title { font-size: 1.2rem; margin: 0 0 .1rem; color: var(--on-dark); }
.tl-company { font-size: .95rem; font-weight: 500; color: var(--on-dark-muted); margin: 0 0 .7rem; }
.tl-summary { margin: 0; font-size: .98rem; color: var(--on-dark-muted); }

.resume-cta { margin-top: 2.4rem; }

/* sidebar: education + skills */
.side-panel { background: var(--navy-deep); border: 1px solid var(--line); padding: 1.8rem; position: sticky; top: 92px; }
.side-h { font-size: 1rem; color: var(--on-dark); margin: 0 0 .6rem; }
.side-block + .side-block { margin-top: 1.8rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.side-label { text-transform: uppercase; letter-spacing: .16em; font-size: .7rem; font-weight: 600; color: var(--accent); margin: 0 0 1rem; }
.edu-list { margin: 0; padding-left: 1.1rem; color: var(--on-dark-muted); }
.edu-list li { margin-bottom: .2rem; }
.skill-group + .skill-group { margin-top: 1.2rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { display: inline-block; background: transparent; color: var(--on-dark-muted); border: 1px solid var(--line-strong); padding: .3rem .7rem; font-size: .8rem; font-weight: 500; }
@media (max-width: 860px) { .side-panel { position: static; } }

/* ---------- Projects ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.4rem; }
.proj-card {
  display: flex; flex-direction: column; background: var(--navy-raise);
  border: 1px solid var(--line); padding: 1.8rem 1.9rem;
  opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .16s ease, border-color .2s ease;
}
.proj-card.in { opacity: 1; transform: none; }
.proj-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.proj-head { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: .3rem; }
.proj-title { margin: 0; font-size: 1.35rem; font-family: var(--serif); font-weight: 400; }
.proj-tagline { color: var(--accent); font-weight: 500; margin: 0 0 .8rem; }
.proj-desc { margin: 0 0 1.6rem; color: var(--on-dark-muted); flex: 1; }
.proj-action { margin-top: auto; }
.proj-note { margin: .9rem 0 0; font-size: .85rem; color: var(--on-dark-muted); }
.proj-note a { color: var(--on-dark); border-bottom: 1px solid var(--line-strong); }
.proj-note a:hover { color: var(--accent); border-color: var(--accent); }
.tag { font-size: .68rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; padding: .24rem .6rem; }
.tag-wip { background: rgba(159, 194, 224, .14); color: var(--accent); border: 1px solid var(--line-strong); }
.tag-private { background: transparent; color: var(--on-dark-muted); border: 1px solid var(--line-strong); }

/* ---------- Crafts ---------- */
.crafts-follow { margin: 0 0 3rem; }
.craft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.2rem; }
.craft {
  display: block; background: var(--navy-raise); border: 1px solid var(--line);
  opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .16s ease, border-color .2s ease;
}
.craft.in { opacity: 1; transform: none; }
a.craft:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.craft-media { position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; background: var(--navy-deep); }
.craft-media img { width: 100%; height: 100%; object-fit: cover; }
.craft-media.is-placeholder { display: flex; align-items: center; justify-content: center; }
.craft-ph { width: 40px; height: 40px; border: 1px solid var(--line-strong); position: relative; }
.craft-ph::before, .craft-ph::after { content: ""; position: absolute; background: var(--line-strong); }
.craft-ph::before { left: 50%; top: 8px; bottom: 8px; width: 1px; transform: translateX(-.5px); }
.craft-ph::after { top: 50%; left: 8px; right: 8px; height: 1px; transform: translateY(-.5px); }
.craft-meta { display: flex; flex-direction: column; gap: .1rem; padding: .9rem 1.1rem 1.1rem; }
.craft-title { font-family: var(--serif); font-size: 1.05rem; color: var(--on-dark); }
.craft-note { font-size: .82rem; color: var(--on-dark-muted); text-transform: uppercase; letter-spacing: .1em; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--navy-deep); margin-top: 4rem; padding: 2.8rem 0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1.4rem; justify-content: space-between; align-items: center; }
.social { display: flex; align-items: center; gap: 1.4rem; margin: 0; padding: 0; list-style: none; }
.social a { display: inline-flex; color: var(--on-dark-muted); transition: color .18s ease, transform .18s ease; }
.social a:hover { color: var(--accent); transform: translateY(-2px); }
.social svg { width: 22px; height: 22px; display: block; }
.footer-meta { color: var(--on-dark-muted); font-size: .84rem; margin: 0; letter-spacing: .02em; }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links {
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--navy-deep); border-bottom: 1px solid var(--line);
    padding: .6rem 28px 1.2rem; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .8rem 0; width: 100%; }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tl-item, .proj-card, .craft { opacity: 1 !important; transform: none !important; transition: none; }
}
