/* =============================================================================
   Sang Hoon Sung — Portfolio
   Professional, minimal, technical
   ============================================================================= */

:root {
  --color-bg: #f6f7f9;
  --color-surface: #ffffff;
  --color-text: #12151a;
  --color-text-secondary: #4a5562;
  --color-text-muted: #6b7380;
  --color-border: #dde1e6;
  --color-border-strong: #c5ccd5;
  --color-accent: #16324f;
  --color-accent-hover: #0f2438;
  --color-accent-soft: #e8eef4;
  --color-nav-bg: rgba(246, 247, 249, 0.92);
  --color-control-bg: #ffffff;
  --color-control-active: #e8eef4;
  --color-btn-bg: #16324f;
  --color-btn-text: #ffffff;
  --color-btn-hover: #0f2438;

  --font-sans: "IBM Plex Sans", "Noto Sans KR", "Apple SD Gothic Neo",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: 2.75rem;
  --text-hero: clamp(2.25rem, 5vw, 3.25rem);

  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.65;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  --container: 1120px;
  --nav-height: 4rem;
  --radius: 4px;
  --radius-md: 6px;

  --shadow-sm: 0 1px 2px rgba(18, 21, 26, 0.04);
  --transition: 180ms ease;
  --color-scheme: light;
}

html[data-theme="dark"] {
  --color-bg: #0e1116;
  --color-surface: #161b22;
  --color-text: #e8eaed;
  --color-text-secondary: #a8b0ba;
  --color-text-muted: #7d8794;
  --color-border: #2a313c;
  --color-border-strong: #3d4654;
  --color-accent: #8eb4d8;
  --color-accent-hover: #b3cce6;
  --color-accent-soft: #1a2330;
  --color-nav-bg: rgba(14, 17, 22, 0.92);
  --color-control-bg: #161b22;
  --color-control-active: #1f2a38;
  --color-btn-bg: #8eb4d8;
  --color-btn-text: #0e1116;
  --color-btn-hover: #b3cce6;
  --color-scheme: dark;
}

html {
  color-scheme: var(--color-scheme);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 1rem);
}

/* Accessibility ----------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 200;
}

.skip-link:focus {
  left: var(--space-4);
  top: var(--space-4);
  width: auto;
  height: auto;
  padding: var(--space-2) var(--space-4);
  background: var(--color-accent);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius);
  overflow: visible;
}

/* Reset ------------------------------------------------------------------- */

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

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

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4 {
  line-height: var(--leading-tight);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

p {
  color: var(--color-text-secondary);
}

/* Layout ------------------------------------------------------------------ */

.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}

.section {
  padding-block: var(--space-7);
}

.section--alt {
  background-color: var(--color-surface);
  border-block: 1px solid var(--color-border);
}

.section__header {
  margin-bottom: var(--space-5);
  max-width: 40rem;
}

.section__label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.section__title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-3);
}

.section__intro {
  font-size: var(--text-base);
  max-width: 36rem;
}

/* Header / Nav ------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--color-nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  gap: var(--space-4);
  position: relative;
}

.nav__brand {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

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

.nav__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  object-fit: cover;
  background: var(--color-surface);
  flex: 0 0 auto;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  cursor: pointer;
  padding: 0.5rem;
}

.nav__toggle-bar {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--color-text);
  transition: transform var(--transition), opacity var(--transition);
}

.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.nav__link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
}

.nav__link:hover,
.nav__link[aria-current="page"] {
  color: var(--color-text);
}

.nav__social {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-left: var(--space-4);
  border-left: 1px solid var(--color-border);
}

.nav__social a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
}

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

.nav__controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-control-bg);
}

.lang-switch__btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.4rem 0.55rem;
  cursor: pointer;
  line-height: 1;
  transition: background var(--transition), color var(--transition);
}

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

.lang-switch__btn.is-active {
  background: var(--color-control-active);
  color: var(--color-text);
}

.lang-switch__btn + .lang-switch__btn {
  border-left: 1px solid var(--color-border);
}

.theme-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 1.85rem;
  padding: 0 0.55rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-control-bg);
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
    border-color var(--transition);
}

.theme-toggle:hover {
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

/* Hero -------------------------------------------------------------------- */

.hero {
  padding-block: var(--space-7) var(--space-6);
  border-bottom: 1px solid var(--color-border);
}

.hero__inner {
  max-width: 42rem;
}

.hero__name {
  font-size: var(--text-hero);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  opacity: 0;
  animation: fade-up 0.6s ease forwards;
}

.hero__avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  object-fit: cover;
  background: var(--color-surface);
  flex: 0 0 auto;
}

.hero__roles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-4);
  opacity: 0;
  animation: fade-up 0.6s ease 0.08s forwards;
}

.hero__role {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
}

.hero__role:not(:last-child)::after {
  content: "·";
  margin-left: var(--space-3);
  color: var(--color-border-strong);
}

.hero__intro {
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-5);
  max-width: 38rem;
  opacity: 0;
  animation: fade-up 0.6s ease 0.16s forwards;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  opacity: 0;
  animation: fade-up 0.6s ease 0.24s forwards;
}

/* Buttons ----------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.7rem 1.25rem;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 550;
  line-height: 1;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
    border-color var(--transition);
}

.btn--primary {
  background: var(--color-btn-bg);
  color: var(--color-btn-text);
  border-color: var(--color-btn-bg);
}

.btn--primary:hover {
  background: var(--color-btn-hover);
  color: var(--color-btn-text);
  border-color: var(--color-btn-hover);
}

.btn--secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

.btn--secondary:hover {
  background: var(--color-surface);
  border-color: var(--color-text-muted);
  color: var(--color-text);
}

.btn--small {
  padding: 0.55rem 1rem;
  font-size: var(--text-xs);
}

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

.project-category {
  margin-bottom: var(--space-6);
}

.project-category:last-child {
  margin-bottom: 0;
}

.project-category__header {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.project-category__title {
  font-size: var(--text-lg);
  font-weight: 600;
}

.project-category__note {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}

.project-grid--wide {
  grid-template-columns: repeat(3, 1fr);
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition);
  color: inherit;
}

.project-card:has(a.project-card__media:hover),
.project-card:has(a.project-card__media:focus-visible),
.project-card:has(.project-card__footer a:hover),
.project-card:has(.project-card__footer a:focus-visible) {
  border-color: var(--color-border-strong);
}

a.project-card__media {
  color: inherit;
  text-decoration: none;
}

a.project-card__media:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

.project-card__footer a.btn {
  align-self: flex-start;
}

.project-card--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  min-height: 280px;
}

.project-card__media {
  background: var(--color-accent-soft);
  border-bottom: 1px solid var(--color-border);
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.project-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.project-card--featured .project-card__media {
  aspect-ratio: auto;
  border-bottom: none;
  border-right: 1px solid var(--color-border);
  min-height: 100%;
}

.project-card__placeholder {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--space-5);
  gap: var(--space-3);
  cursor: default;
}

.project-card__name {
  font-size: var(--text-lg);
  font-weight: 600;
}

.project-card__desc {
  font-size: var(--text-sm);
  flex: 1;
}

.project-card__meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

.project-card__footer {
  margin-top: var(--space-2);
}

/* Experience -------------------------------------------------------------- */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 2px solid var(--color-border);
  margin-left: 0.35rem;
  padding-left: var(--space-5);
}

.timeline__item {
  position: relative;
  padding-bottom: var(--space-6);
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--space-5) - 5px);
  top: 0.4rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-accent);
}

.timeline__period {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.timeline__role {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.timeline__org {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
}

.timeline__summary {
  font-size: var(--text-sm);
  max-width: 40rem;
}

.timeline__placeholder {
  color: var(--color-text-muted);
  font-style: italic;
}

/* Skills ------------------------------------------------------------------ */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.skill-group {
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.skill-group__title {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.skill-group__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.skill-group__item {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.skill-group__item--placeholder {
  color: var(--color-text-muted);
  font-style: italic;
}

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

.about__content {
  max-width: 40rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.about__content p {
  font-size: var(--text-base);
}

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

.contact__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 28rem;
}

.contact__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.contact__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.contact__value {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text);
}

.contact__value--muted {
  color: var(--color-text-muted);
  font-weight: 400;
  font-style: italic;
}

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

/* Footer ------------------------------------------------------------------ */

.site-footer {
  padding-block: var(--space-5);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.footer__copy {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.footer__links {
  display: flex;
  gap: var(--space-4);
}

.footer__links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

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

/* Project pages ----------------------------------------------------------- */

.project-hero {
  padding-block: var(--space-8) var(--space-7);
  border-bottom: 1px solid var(--color-border);
}

.project-hero__back {
  display: inline-block;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}

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

.project-hero__title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-3);
}

.project-hero__tagline {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 36rem;
  margin-bottom: var(--space-6);
}

.project-hero__media {
  background: var(--color-accent-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  aspect-ratio: 21 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-content {
  padding-block: var(--space-8);
}

.project-block {
  margin-bottom: var(--space-8);
  max-width: 42rem;
}

.project-block--wide {
  max-width: 52rem;
}

.project-block:last-child {
  margin-bottom: 0;
}

.project-block__title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.project-block__lead {
  margin-bottom: var(--space-5);
}

.project-block p,
.project-block li {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
}

.project-block ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.project-block ul > li {
  padding-left: var(--space-4);
  position: relative;
}

.project-block ul > li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--color-text-muted);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  list-style: none;
}

.project-meta li {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.project-hero__actions {
  margin-bottom: var(--space-6);
}

.project-prose {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.problem-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.problem-card {
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.problem-card__title {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.problem-card p {
  font-size: var(--text-sm);
  margin: 0;
}

.feature-group {
  margin-bottom: var(--space-5);
}

.feature-group:last-child {
  margin-bottom: 0;
}

.feature-group__title {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

.tech-list li {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.arch-diagram {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.55;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  overflow-x: auto;
  white-space: pre;
  margin-bottom: var(--space-6);
}

.project-subtitle {
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
}

.decision-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  list-style: none;
  counter-reset: decision;
}

.decision-list > li {
  padding-left: 0;
  counter-increment: decision;
  position: relative;
}

.decision-list > li::before {
  content: counter(decision) ".";
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
}

.decision-list > li {
  padding-left: 1.75rem;
}

.decision-list h4 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}

.decision-list p {
  margin: 0;
  font-size: var(--text-sm);
}

.placeholder-text {
  color: var(--color-text-muted);
  font-style: italic;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  max-width: none;
}

.screenshot-item {
  background: var(--color-accent-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-placeholder {
  background: var(--color-accent-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  aspect-ratio: 16 / 9;
  max-width: 42rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* Product page (TreeSize and similar) ------------------------------------ */

.product-hero {
  padding-block: var(--space-7) var(--space-8);
  border-bottom: 1px solid var(--color-border);
  background:
    linear-gradient(
      180deg,
      var(--color-accent-soft) 0%,
      var(--color-bg) 72%
    );
}

.product-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  gap: var(--space-7);
  align-items: center;
}

.product-hero__icon {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 1.15rem;
  margin-bottom: var(--space-4);
  box-shadow: 0 8px 24px rgba(18, 21, 26, 0.12);
}

.product-hero__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.product-hero__title {
  font-size: var(--text-3xl);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-2);
}

.product-hero__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.product-hero__tagline {
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  color: var(--color-text-secondary);
  max-width: 28rem;
  margin-bottom: var(--space-5);
}

.product-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.product-hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
}

.product-hero__facts li {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.product-hero__shot {
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #1a1a1a;
  box-shadow: 0 16px 40px rgba(18, 21, 26, 0.12);
}

.product-hero__shot img {
  width: 100%;
  height: auto;
  display: block;
}

.product-hero__shot--video,
.product-feature__media--video {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #1a1a1a;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  box-shadow: 0 16px 40px rgba(18, 21, 26, 0.12);
  transition: transform var(--transition), box-shadow var(--transition);
}

.product-hero__shot--video:hover,
.product-feature__media--video:hover,
.product-hero__shot--video:focus-visible,
.product-feature__media--video:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(18, 21, 26, 0.16);
  outline: none;
}

.product-hero__shot--video:focus-visible,
.product-feature__media--video:focus-visible {
  box-shadow:
    0 18px 44px rgba(18, 21, 26, 0.16),
    0 0 0 3px var(--color-accent-soft),
    0 0 0 5px var(--color-accent);
}

.product-hero__shot--video img,
.product-feature__media--video img {
  width: 100%;
  height: auto;
  display: block;
}

.media-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(14, 17, 22, 0.4);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.product-hero__shot--video:hover .media-play,
.product-feature__media--video:hover .media-play,
.product-hero__shot--video:focus-visible .media-play,
.product-feature__media--video:focus-visible .media-play {
  opacity: 1;
}

.media-play__icon {
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  position: relative;
  transform: scale(0.92);
  transition: transform var(--transition);
}

.product-hero__shot--video:hover .media-play__icon,
.product-feature__media--video:hover .media-play__icon,
.product-hero__shot--video:focus-visible .media-play__icon,
.product-feature__media--video:focus-visible .media-play__icon {
  transform: scale(1);
}

.media-play__icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.7rem 0 0.7rem 1.15rem;
  border-color: transparent transparent transparent var(--color-accent);
}

.media-play--sm .media-play__icon {
  width: 3.25rem;
  height: 3.25rem;
}

.media-play--sm .media-play__icon::before {
  border-width: 0.55rem 0 0.55rem 0.9rem;
}

@media (hover: none) {
  .media-play {
    opacity: 1;
    background: rgba(14, 17, 22, 0.22);
  }

  .media-play__icon {
    transform: scale(1);
  }
}

.video-modal {
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  width: fit-content;
  max-width: calc(100vw - 1.5rem);
  height: fit-content;
  max-height: calc(100dvh - 1.5rem);
}

.video-modal::backdrop {
  background: rgba(14, 17, 22, 0.72);
  backdrop-filter: blur(4px);
}

.video-modal__panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  max-height: calc(100dvh - 1.5rem);
  width: fit-content;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}

.video-modal__toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.4rem 0.5rem 0.4rem 0.65rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.video-modal__close {
  flex-shrink: 0;
  width: 1.85rem;
  height: 1.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-control-bg);
  color: var(--color-text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.video-modal__close:hover,
.video-modal__close:focus-visible {
  background: var(--color-control-active);
  outline: none;
}

.video-modal__tabs {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.video-modal__tab {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 0.28rem 0.6rem;
  cursor: pointer;
}

.video-modal__tab.is-active,
.video-modal__tab[aria-selected="true"] {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  border-color: var(--color-border-strong);
}

.video-modal__tab:hover,
.video-modal__tab:focus-visible {
  color: var(--color-text);
  outline: none;
}

.video-modal__player {
  background: #0e1116;
  line-height: 0;
}

.video-modal__player video {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 1.5rem);
  max-height: calc(100dvh - 1.5rem - 2.75rem);
  vertical-align: top;
  background: #0e1116;
}

html.is-video-modal-open {
  overflow: hidden;
}

.product-hero__grid--phone {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.7fr);
  align-items: center;
}

.product-hero__shot--phone {
  max-width: 280px;
  justify-self: center;
  background: transparent;
  border: none;
  box-shadow: none;
}

.product-hero__shot--phone img {
  border: 1px solid var(--color-border);
  border-radius: 1.25rem;
  box-shadow: 0 16px 40px rgba(18, 21, 26, 0.12);
}

.product-feature__grid--phone {
  grid-template-columns: 1.1fr 0.7fr;
}

.product-feature__media--phone {
  max-width: 260px;
  justify-self: center;
  background: transparent;
  border: none;
}

.product-feature__media--phone img {
  border: 1px solid var(--color-border);
  border-radius: 1.25rem;
}

.product-gallery--phones {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-5);
  justify-items: center;
}

.product-gallery--phones .product-gallery__item {
  max-width: 220px;
  width: 100%;
}

.product-gallery--phones .product-gallery__item img {
  border-radius: 1.1rem;
  background: transparent;
}

.product-card__media--phone {
  background: var(--color-accent-soft);
}

.product-card__media--phone img {
  object-fit: contain;
  padding: var(--space-3);
}

.product-section {
  padding-block: var(--space-8);
}

.product-section--alt {
  background: var(--color-surface);
  border-block: 1px solid var(--color-border);
}

.product-section__header {
  max-width: 36rem;
  margin-bottom: var(--space-7);
  text-align: center;
  margin-inline: auto;
}

.product-section__header--left {
  text-align: left;
  margin-inline: 0;
}

.product-section__header h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-3);
}

.product-section__header p {
  font-size: var(--text-base);
}

.product-section__narrow {
  max-width: 40rem;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.value-card h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}

.value-card p {
  font-size: var(--text-sm);
  margin: 0;
}

.product-feature {
  padding-block: var(--space-8);
  border-bottom: 1px solid var(--color-border);
}

.product-feature--alt {
  background: var(--color-surface);
}

.product-feature__grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: var(--space-7);
  align-items: center;
}

.product-feature__grid--reverse .product-feature__copy {
  order: 2;
}

.product-feature__grid--reverse .product-feature__media {
  order: 1;
}

.product-feature__narrow {
  max-width: 40rem;
}

.product-feature__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.product-feature__copy h2,
.product-feature__narrow h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
}

.product-feature__copy > p,
.product-feature__narrow > p {
  margin-bottom: var(--space-4);
}

.product-feature__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.product-feature__list li {
  padding-left: var(--space-4);
  position: relative;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.product-feature__list li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--color-text-muted);
}

.product-feature__media {
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #1a1a1a;
}

.product-feature__media img {
  width: 100%;
  height: auto;
  display: block;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  list-style: none;
  counter-reset: none;
}

.steps__item {
  padding: 0;
}

.steps__item::before {
  content: none;
}

.steps__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-bottom: var(--space-3);
  border-radius: 50%;
  border: 1px solid var(--color-border-strong);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.steps__item h3 {
  font-size: var(--text-base);
  margin-bottom: var(--space-2);
}

.steps__item p {
  font-size: var(--text-sm);
  margin: 0;
}

.product-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

.product-gallery__item {
  margin: 0;
}

.product-gallery__item img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #1a1a1a;
}

.product-gallery__item figcaption {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.product-strip {
  padding-block: var(--space-7);
  background: var(--color-accent);
  color: #fff;
}

html[data-theme="dark"] .product-strip {
  background: #1f2a38;
}

.product-strip__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.product-strip h2 {
  color: inherit;
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

.product-strip p {
  color: rgba(255, 255, 255, 0.82);
  max-width: 36rem;
  margin: 0;
}

.product-strip .btn--primary {
  background: #fff;
  color: var(--color-accent);
  border-color: #fff;
}

html[data-theme="dark"] .product-strip .btn--primary {
  color: #0e1116;
}

.product-strip .btn--primary:hover {
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-accent-hover);
  border-color: rgba(255, 255, 255, 0.92);
}

.product-note {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Animations -------------------------------------------------------------- */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  body {
    transition: none;
  }

  .hero__name,
  .hero__roles,
  .hero__intro,
  .hero__actions {
    animation: none;
    opacity: 1;
  }
}

/* Responsive -------------------------------------------------------------- */

@media (max-width: 900px) {
  .project-grid--wide {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-card--featured {
    grid-template-columns: 1fr;
  }

  .project-card--featured .project-card__media {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    aspect-ratio: 16 / 9;
    min-height: auto;
  }

  .skills-grid,
  .value-grid,
  .steps,
  .product-hero__grid,
  .product-feature__grid,
  .product-hero__grid--phone,
  .product-feature__grid--phone,
  .product-gallery--phones {
    grid-template-columns: 1fr;
  }

  .product-hero__shot--phone,
  .product-feature__media--phone {
    max-width: 240px;
  }

  .product-gallery--phones {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-feature__grid--reverse .product-feature__copy,
  .product-feature__grid--reverse .product-feature__media {
    order: initial;
  }
}

@media (max-width: 720px) {
  .section {
    padding-block: var(--space-6);
  }

  .hero {
    padding-block: var(--space-6) var(--space-5);
  }

  .nav__toggle {
    display: flex;
    order: 3;
  }

  .nav__controls {
    order: 2;
    margin-left: auto;
  }

  .nav__menu {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-4) var(--space-5) var(--space-5);
    box-shadow: var(--shadow-sm);
    order: 4;
  }

  .nav__menu.is-open {
    display: flex;
  }

  .nav__links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav__link {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border);
  }

  .nav__social {
    border-left: none;
    padding-left: 0;
    padding-top: var(--space-4);
    gap: var(--space-5);
  }

  .project-grid,
  .project-grid--wide,
  .skills-grid,
  .screenshot-grid,
  .problem-grid {
    grid-template-columns: 1fr;
  }

  .hero__intro {
    font-size: var(--text-base);
  }

  .project-hero__title,
  .product-hero__title {
    font-size: var(--text-2xl);
  }
}
