/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
  /* light-dark(light, dark) picks by color-scheme: the system's, unless the toggle set data-theme on <html> */
  color-scheme: light dark;
  --bg: light-dark(#ffffff, #0a0a0b);
  --bg-elev: light-dark(#f5f5f7, #141416);
  --surface: light-dark(#ffffff, #161618);
  --text: light-dark(#1d1d1f, #f5f5f7);
  --text-muted: light-dark(#6e6e73, #a1a1a6);
  --border: light-dark(#e5e5ea, #2a2a2e);
  --accent: light-dark(#0066cc, #2997ff);
  --accent-hover: light-dark(#0055aa, #4aa8ff);
  --accent-contrast: light-dark(#ffffff, #0a0a0b);
  --nav-bg: light-dark(rgba(255, 255, 255, 0.72), rgba(10, 10, 11, 0.72));
  --shadow: 0 1px 2px light-dark(rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.4)),
    0 8px 24px light-dark(rgba(0, 0, 0, 0.06), transparent);
  --shadow-hover: 0 2px 4px light-dark(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.5)),
    0 16px 40px light-dark(rgba(0, 0, 0, 0.10), rgba(0, 0, 0, 0.5));

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 20px;
  --radius-sm: 999px;
  --container: 1080px;
  --gutter: 24px;
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

/* ==========================================================================
   Base
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

p {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

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

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

cite {
  font-style: italic;
}

.muted {
  color: var(--text-muted);
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 14px;
  background: var(--text);
  color: var(--bg);
  border-radius: 8px;
  z-index: 100;
}

.skip-link:focus {
  top: 12px;
}

/* ==========================================================================
   Nav
   ========================================================================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.nav.is-scrolled {
  border-bottom-color: var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 16px;
}

.nav__brand {
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.nav__brand:hover {
  color: var(--text);
}

.nav__links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav__links a:hover,
.nav__links a.is-active {
  color: var(--text);
}

.nav__right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

html:not(.js) .theme-toggle {
  display: none;
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--bg-elev);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

/* Both icons share one cell; the moon shows in light mode (switch to dark), the sun in dark mode */
.theme-toggle svg {
  grid-area: 1 / 1;
}

.theme-toggle .icon-moon {
  stroke: light-dark(currentColor, transparent);
}

.theme-toggle .icon-sun {
  stroke: light-dark(transparent, currentColor);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
  padding-top: clamp(72px, 12vw, 144px);
  padding-bottom: clamp(64px, 10vw, 120px);
}

.hero__photo {
  width: clamp(200px, 26vw, 320px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  background: #ffffff;
  box-shadow: 0 0 0 1px var(--border), var(--shadow-hover);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #30d158;
  box-shadow: 0 0 0 4px rgba(48, 209, 88, 0.18);
}

.hero__title {
  font-size: clamp(48px, 9vw, 96px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
}

.hero__lede {
  margin-top: 24px;
  max-width: 34em;
  font-size: clamp(18px, 2.2vw, 21px);
  color: var(--text-muted);
  line-height: 1.55;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 22px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: var(--accent-contrast);
}

.btn--ghost {
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  color: var(--text);
  background: var(--bg-elev);
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
  padding-block: clamp(56px, 9vw, 112px);
  border-top: 1px solid var(--border);
}

.section__head {
  margin-bottom: clamp(32px, 5vw, 56px);
}

.section__kicker {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.section__title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
}

.section__sub {
  margin-top: 12px;
  font-size: clamp(18px, 2vw, 20px);
  color: var(--text-muted);
}

/* About ------------------------------------------------------------------ */

.about {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}

.about__text p {
  font-size: clamp(18px, 2vw, 20px);
  line-height: 1.65;
}

.about__text p + p {
  margin-top: 20px;
  color: var(--text-muted);
}

.facts {
  margin: 0;
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 8px 24px;
}

.facts__row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  padding: 16px 0;
}

.facts__row + .facts__row {
  border-top: 1px solid var(--border);
}

.facts dt {
  font-size: 14px;
  color: var(--text-muted);
  padding-top: 1px;
}

.facts dd {
  margin: 0;
  font-weight: 500;
  line-height: 1.45;
}

.facts dd .muted {
  font-weight: 400;
  font-size: 15px;
}

/* Projects --------------------------------------------------------------- */

.projects {
  display: grid;
  /* minmax(0, ...) so long content wraps instead of widening a column */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card__art {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-elev);
}

.card__art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  flex: 1;
}

.card__title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card__desc {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.55;
}

.card__links {
  margin-top: auto;
  padding-top: 4px;
  font-size: 14px;
}

/* placeholder card */
.card--placeholder {
  background: transparent;
  border-style: dashed;
  box-shadow: none;
}

.card--placeholder:hover {
  transform: none;
  box-shadow: none;
}

.card__art--soon {
  display: grid;
  place-items: center;
  background: var(--bg-elev);
}

.plus {
  font-size: 48px;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1;
}

/* Tags ------------------------------------------------------------------- */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tags li {
  font-size: 13px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  color: var(--text);
}

.tags--lg li {
  font-size: 15px;
  padding: 7px 14px;
}

/* Toolbox ---------------------------------------------------------------- */

.toolbox {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.toolbox__group {
  padding: 28px;
  background: var(--bg-elev);
  border-radius: var(--radius);
}

.toolbox__group h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.toolbox__group .tags li {
  background: var(--surface);
  border: 1px solid var(--border);
}

/* Hobbies ---------------------------------------------------------------- */

.hobbies {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.hobbies li {
  padding: 24px 28px;
  background: var(--bg-elev);
  border-radius: var(--radius);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 600;
  letter-spacing: -0.015em;
}

/* Contact ---------------------------------------------------------------- */

.contact {
  max-width: 720px;
}

.contact__title {
  font-size: clamp(44px, 7vw, 72px);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.contact__lede {
  margin-top: 20px;
  font-size: clamp(18px, 2vw, 20px);
  color: var(--text-muted);
}

.contact__list {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.contact__item {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 22px 4px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: padding 0.2s ease, color 0.15s ease;
}

.contact__item:hover {
  color: var(--accent);
  padding-left: 12px;
}

.contact__label {
  font-size: 14px;
  color: var(--text-muted);
}

.contact__value {
  font-size: clamp(17px, 2.2vw, 20px);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.contact__arrow {
  font-size: 20px;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.15s ease;
}

.contact__item:hover .contact__arrow {
  color: var(--accent);
  transform: translateX(4px);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  border-top: 1px solid var(--border);
  padding-block: 28px;
  font-size: 14px;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Reveal on scroll (enabled by script.js)
   ========================================================================== */

.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 860px) {
  .about {
    grid-template-columns: 1fr;
  }

  .toolbox {
    grid-template-columns: 1fr;
  }

  .hobbies {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* below this, two columns would be narrower than 300px */
@media (max-width: 720px) {
  .projects {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
  }

  .nav__brand {
    display: none;
  }

  /* links spread across the bar, toggle at the end */
  .nav__right {
    flex: 1;
    gap: 12px;
  }

  .nav__right nav {
    flex: 1;
  }

  .nav__links {
    justify-content: space-between;
    gap: 8px;
  }

  .nav__links a {
    font-size: 13px;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero__photo {
    grid-row: 1;
    width: 128px;
  }

  .hobbies li {
    padding: 18px 20px;
  }

  .contact__item {
    grid-template-columns: 1fr auto;
    row-gap: 2px;
  }

  .contact__label {
    grid-column: 1 / -1;
  }

  .contact__arrow {
    grid-row: 2;
    grid-column: 2;
  }
}

/* five links and the toggle need a smaller size on the narrowest phones */
@media (max-width: 374px) {
  .nav__links a {
    font-size: 12px;
  }
}

