/* ============================================================
   James Chen — UI Designer Portfolio
   Aesthetic: Editorial / Magazine — warm, refined, typographic
   ============================================================ */

/* --- Custom Properties --- */
:root {
  --c-bg: oklch(0.97 0.008 75);
  --c-bg-alt: oklch(0.94 0.012 70);
  --c-surface: oklch(0.99 0.004 80);
  --c-text: oklch(0.18 0.02 60);
  --c-text-muted: oklch(0.48 0.02 60);
  --c-accent: oklch(0.52 0.14 24);
  --c-accent-light: oklch(0.88 0.06 24);
  --c-border: oklch(0.88 0.01 70);

  --f-display: 'Playfair Display', Georgia, serif;
  --f-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --f-mono: 'DM Mono', 'Menlo', monospace;

  --space-xs: clamp(0.25rem, 0.5vw, 0.5rem);
  --space-sm: clamp(0.5rem, 1vw, 1rem);
  --space-md: clamp(1rem, 2vw, 2rem);
  --space-lg: clamp(2rem, 4vw, 4rem);
  --space-xl: clamp(3rem, 6vw, 6rem);
  --space-2xl: clamp(5rem, 10vw, 10rem);

  --nav-h: 64px;
  --radius: 6px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--f-body);
  font-weight: 400;
  line-height: 1.7;
  color: var(--c-text);
  background: var(--c-bg);
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
ul { list-style: none; }
em { font-family: var(--f-display); font-style: italic; }

::selection {
  background: var(--c-accent);
  color: var(--c-surface);
}

/* --- Typography Helpers --- */
.section-label {
  display: block;
  font-family: var(--f-mono);
  font-size: clamp(0.7rem, 0.8vw, 0.8rem);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: var(--space-md);
}

.section-title {
  font-family: var(--f-display);
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
}

.section-title .muted {
  color: var(--c-text-muted);
  font-weight: 400;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  background: oklch(0.97 0.008 75 / 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s, background 0.4s;
}

.nav.scrolled {
  border-bottom-color: var(--c-border);
}

.nav-logo {
  font-family: var(--f-display);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.nav-logo-dot {
  color: var(--c-accent);
}

.nav-links {
  display: flex;
  gap: var(--space-md);
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--c-text-muted);
  position: relative;
  padding: 0.2em 0;
  transition: color 0.3s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--c-accent);
  transition: width 0.4s var(--ease-out);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--c-text);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--c-text);
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
}

.nav-toggle.open span:first-child {
  transform: translateY(3.25px) rotate(45deg);
}

.nav-toggle.open span:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--c-bg);
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out);
}

.mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

.mobile-menu-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  text-align: center;
}

.mobile-menu-inner a {
  font-family: var(--f-display);
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 600;
  color: var(--c-text);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out), color 0.3s;
}

.mobile-menu.open .mobile-menu-inner a {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu-inner a:nth-child(1) { transition-delay: 0.05s; }
.mobile-menu-inner a:nth-child(2) { transition-delay: 0.1s; }
.mobile-menu-inner a:nth-child(3) { transition-delay: 0.15s; }
.mobile-menu-inner a:nth-child(4) { transition-delay: 0.2s; }
.mobile-menu-inner a:nth-child(5) { transition-delay: 0.25s; }
.mobile-menu-inner a:nth-child(6) { transition-delay: 0.3s; }

.mobile-menu-inner a:hover {
  color: var(--c-accent);
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: var(--nav-h) var(--space-lg) var(--space-lg);
  gap: var(--space-xl);
  position: relative;
}

.hero-content {
  padding: var(--space-xl) 0;
}

.hero-eyebrow {
  font-family: var(--f-mono);
  font-size: clamp(0.65rem, 0.75vw, 0.78rem);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: var(--space-md);
}

.hero-title {
  font-family: var(--f-display);
  font-size: clamp(3.5rem, 7vw, 7rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-lg);
}

.hero-line {
  display: block;
}

.hero-line-2 em {
  color: var(--c-accent);
}

.hero-subtitle {
  font-size: clamp(0.95rem, 1.1vw, 1.15rem);
  line-height: 1.8;
  color: var(--c-text-muted);
  max-width: 460px;
  margin-bottom: var(--space-lg);
}

.hero-cta {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.85em 2em;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: var(--radius);
  transition: all 0.35s var(--ease-out);
}

.btn-primary {
  background: var(--c-text);
  color: var(--c-bg);
}

.btn-primary:hover {
  background: var(--c-accent);
  transform: translateY(-2px);
}

.btn-ghost {
  border: 1.5px solid var(--c-border);
  color: var(--c-text-muted);
}

.btn-ghost:hover {
  border-color: var(--c-text);
  color: var(--c-text);
}

/* Hero Showcase */
.hero-showcase {
  position: relative;
  height: 520px;
  perspective: 800px;
}

.hero-card {
  position: absolute;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px oklch(0.18 0.02 60 / 0.1);
  transition: transform 0.6s var(--ease-out-expo);
}

.hero-card-1 {
  width: 320px;
  height: 380px;
  top: 10%;
  left: 5%;
  z-index: 3;
  transform: rotate(-2deg);
}

.hero-card-2 {
  width: 260px;
  height: 320px;
  top: 5%;
  right: 5%;
  z-index: 2;
  transform: rotate(3deg) translateZ(-30px);
}

.hero-card-3 {
  width: 200px;
  height: 250px;
  bottom: 5%;
  left: 25%;
  z-index: 1;
  transform: rotate(-4deg) translateZ(-60px);
}

.hero-card:hover {
  transform: rotate(0deg) translateY(-8px) scale(1.02);
  z-index: 10;
}

.hero-card-img {
  width: 100%;
  height: 100%;
  background: oklch(0.85 0.08 var(--hue));
  background-image:
    radial-gradient(ellipse at 30% 40%, oklch(0.78 0.12 var(--hue)) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 70%, oklch(0.65 0.1 calc(var(--hue) + 30)) 0%, transparent 50%),
    linear-gradient(135deg, oklch(0.9 0.05 var(--hue)) 0%, oklch(0.75 0.1 calc(var(--hue) + 40)) 100%);
}

.hero-card-label {
  position: absolute;
  bottom: 16px;
  left: 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: oklch(0.2 0.02 60);
  background: oklch(0.98 0.005 80 / 0.9);
  padding: 0.35em 0.8em;
  border-radius: 4px;
  backdrop-filter: blur(8px);
}

/* Hero Scroll Indicator */
.hero-scroll {
  position: absolute;
  bottom: var(--space-lg);
  left: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}

.hero-scroll-line {
  width: 48px;
  height: 1px;
  background: var(--c-border);
  position: relative;
  overflow: hidden;
}

.hero-scroll-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--c-accent);
  animation: scrollLine 2s infinite ease-in-out;
}

@keyframes scrollLine {
  0% { left: -100%; }
  50% { left: 0; }
  100% { left: 100%; }
}

/* --- About --- */
.about {
  padding: var(--space-2xl) var(--space-lg);
  background: var(--c-surface);
}

.section-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.about-bio {
  font-size: clamp(1rem, 1.15vw, 1.15rem);
  line-height: 1.9;
  color: var(--c-text-muted);
  margin-bottom: var(--space-lg);
}

.about-philosophy {
  font-family: var(--f-display);
  font-size: clamp(1.2rem, 1.5vw, 1.5rem);
  font-style: italic;
  line-height: 1.5;
  color: var(--c-accent);
  padding-left: var(--space-md);
  border-left: 3px solid var(--c-accent-light);
}

.about-heading {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--c-border);
}

.about-skills {
  margin-bottom: var(--space-xl);
}

.skill-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.skill-group h4 {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--c-text);
}

.skill-group li {
  font-size: 0.85rem;
  color: var(--c-text-muted);
  padding: 0.3em 0;
  border-bottom: 1px solid oklch(0.92 0.005 70);
}

.experience-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.experience-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-md);
  align-items: start;
}

.exp-year {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  color: var(--c-text-muted);
  white-space: nowrap;
  padding-top: 0.15em;
}

.experience-item strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.2em;
}

.exp-company {
  font-size: 0.82rem;
  color: var(--c-text-muted);
}

/* --- Portfolio --- */
.portfolio {
  padding: var(--space-2xl) var(--space-lg);
}

.portfolio-header {
  max-width: 1200px;
  margin: 0 auto var(--space-lg);
}

.portfolio-tabs {
  max-width: 1200px;
  margin: 0 auto var(--space-xl);
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.tab {
  padding: 0.55em 1.3em;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 100px;
  border: 1.5px solid var(--c-border);
  color: var(--c-text-muted);
  transition: all 0.3s var(--ease-out);
}

.tab:hover {
  border-color: var(--c-text);
  color: var(--c-text);
}

.tab.active {
  background: var(--c-text);
  border-color: var(--c-text);
  color: var(--c-bg);
}

/* Project Grid */
.project-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.project-card {
  background: var(--c-surface);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--c-border);
  transition: transform 0.5s var(--ease-out-expo), box-shadow 0.5s var(--ease-out-expo);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px oklch(0.18 0.02 60 / 0.08);
}

.project-card-large {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
}

.project-cover {
  aspect-ratio: 4/3;
  background: oklch(0.92 0.04 var(--cover-hue));
  padding: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.project-card-large .project-cover {
  aspect-ratio: auto;
  min-height: 360px;
}

.project-cover-inner {
  width: 85%;
  height: 80%;
  position: relative;
}

/* Mock UI Elements */
.mock-dashboard {
  width: 100%;
  height: 100%;
  background: oklch(0.99 0.003 var(--cover-hue));
  border-radius: 8px;
  display: grid;
  grid-template-columns: 48px 1fr;
  overflow: hidden;
  box-shadow: 0 4px 20px oklch(0.3 0.05 var(--cover-hue) / 0.1);
}

.mock-sidebar {
  background: oklch(0.25 0.06 var(--cover-hue));
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 8px;
}

.mock-sidebar::before,
.mock-sidebar::after {
  content: '';
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  background: oklch(0.35 0.05 var(--cover-hue));
}

.mock-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mock-chart {
  width: 100%;
  height: var(--chart-h, 45%);
  background: oklch(0.94 0.02 var(--cover-hue));
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

.mock-chart::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 60%;
  background: linear-gradient(0deg,
    oklch(0.6 0.12 var(--cover-hue) / 0.3) 0%,
    transparent 100%
  );
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.mock-table {
  flex: 1;
  background: oklch(0.96 0.01 var(--cover-hue));
  border-radius: 6px;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 24px,
    oklch(0.92 0.01 var(--cover-hue)) 24px,
    oklch(0.92 0.01 var(--cover-hue)) 25px
  );
}

.mock-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mock-metric {
  height: 48px;
  background: oklch(0.94 0.02 var(--cover-hue));
  border-radius: 6px;
}

.mock-phone {
  width: 55%;
  max-width: 160px;
  margin: 0 auto;
  aspect-ratio: 9/19;
  background: oklch(0.15 0.02 60);
  border-radius: 20px;
  padding: 8px;
  box-shadow: 0 8px 30px oklch(0.2 0.03 60 / 0.2);
}

.mock-phone-screen {
  width: 100%;
  height: 100%;
  background: oklch(0.98 0.005 var(--cover-hue));
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.mock-app-header {
  height: 20%;
  background: oklch(0.55 0.12 var(--cover-hue));
}

.mock-app-cards {
  flex: 1;
  padding: 8px;
  background-image:
    linear-gradient(oklch(0.94 0.02 var(--cover-hue)) 36px, transparent 0),
    linear-gradient(oklch(0.94 0.02 var(--cover-hue)) 36px, transparent 0);
  background-size: 100% 48px;
  background-position: 0 0;
}

.mock-app-nav {
  height: 14%;
  background: oklch(0.96 0.01 var(--cover-hue));
  border-top: 1px solid oklch(0.9 0.01 var(--cover-hue));
}

.mock-brand {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mock-logo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 70%;
}

.mock-logo-item {
  aspect-ratio: 1;
  border-radius: 16px;
  background: oklch(0.82 0.1 var(--cover-hue));
  box-shadow: 0 4px 12px oklch(0.5 0.08 var(--cover-hue) / 0.15);
}

.mock-logo-item:nth-child(2) {
  background: oklch(0.7 0.13 var(--cover-hue));
  border-radius: 50%;
}

.mock-logo-item:nth-child(3) {
  background: oklch(0.6 0.14 calc(var(--cover-hue) + 20));
  border-radius: 8px;
  transform: rotate(45deg) scale(0.8);
}

.mock-logo-item:nth-child(4) {
  background: oklch(0.9 0.06 calc(var(--cover-hue) - 10));
}

.mock-web {
  width: 100%;
  height: 100%;
  background: oklch(0.98 0.004 var(--cover-hue));
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px oklch(0.3 0.05 var(--cover-hue) / 0.1);
}

.mock-web-hero {
  height: 45%;
  background: linear-gradient(135deg,
    oklch(0.45 0.14 var(--cover-hue)),
    oklch(0.55 0.1 calc(var(--cover-hue) + 40))
  );
}

.mock-web-grid {
  flex: 1;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mock-web-grid::before,
.mock-web-grid::after {
  content: '';
  background: oklch(0.94 0.02 var(--cover-hue));
  border-radius: 4px;
}

.mock-web-grid::before {
  grid-column: span 2;
}

.mock-3d {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mock-3d-sphere {
  width: 55%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 35%,
    oklch(0.85 0.1 var(--cover-hue)),
    oklch(0.5 0.18 var(--cover-hue)) 50%,
    oklch(0.3 0.15 calc(var(--cover-hue) + 20)) 100%
  );
  box-shadow:
    0 20px 40px oklch(0.3 0.1 var(--cover-hue) / 0.3),
    inset 0 -10px 20px oklch(0.2 0.1 var(--cover-hue) / 0.2);
}

/* Project Info */
.project-info {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-card-large .project-info {
  padding: var(--space-lg);
}

.project-meta {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.project-tag {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  font-weight: 400;
  padding: 0.25em 0.65em;
  border: 1px solid var(--c-border);
  border-radius: 3px;
  color: var(--c-text-muted);
  letter-spacing: 0.03em;
}

.project-title {
  font-family: var(--f-body);
  font-size: clamp(1.1rem, 1.3vw, 1.35rem);
  font-weight: 700;
  margin-bottom: var(--space-xs);
  line-height: 1.3;
}

.project-desc {
  font-size: 0.88rem;
  color: var(--c-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

.project-expand {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-accent);
  text-align: left;
  transition: letter-spacing 0.3s var(--ease-out);
}

.project-expand:hover {
  letter-spacing: 0.06em;
}

/* Hidden state for filter */
.project-card.hidden {
  display: none;
}

/* --- Design System --- */
.system {
  padding: var(--space-2xl) var(--space-lg);
  background: var(--c-bg-alt);
}

.system-intro {
  position: sticky;
  top: calc(var(--nav-h) + var(--space-lg));
  align-self: start;
}

.system-desc {
  font-size: clamp(0.95rem, 1.05vw, 1.05rem);
  line-height: 1.8;
  color: var(--c-text-muted);
}

.system-showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.system-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: var(--space-md);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s;
}

.system-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px oklch(0.18 0.02 60 / 0.06);
}

.system-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.system-card p {
  font-size: 0.82rem;
  color: var(--c-text-muted);
  line-height: 1.6;
}

.system-card-visual {
  height: 120px;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-bg);
  border-radius: 8px;
  overflow: hidden;
}

/* Color Chips */
.color-chips {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  width: 85%;
  height: 70%;
}

.color-chip {
  background: var(--chip);
  border-radius: 6px;
  transition: transform 0.3s var(--ease-out);
}

.color-chip:hover {
  transform: scale(1.1);
}

/* Type Specimen */
.type-specimen {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 85%;
}

.type-display {
  font-family: var(--f-display);
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1;
}

.type-scale {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.type-scale span {
  color: var(--c-text-muted);
  white-space: nowrap;
}

/* Component Preview */
.component-preview {
  width: 85%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cp-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
}

.cp-btn-primary {
  background: var(--c-text);
  color: var(--c-bg);
}

.cp-btn-secondary {
  background: transparent;
  border: 1.5px solid var(--c-border);
  color: var(--c-text-muted);
}

.cp-input {
  padding: 6px 10px;
  border: 1.5px solid var(--c-border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
}

.cp-input-label {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--c-text-muted);
}

.cp-input-placeholder {
  font-size: 0.72rem;
  color: oklch(0.7 0.01 70);
}

.cp-toggle {
  display: flex;
  align-items: center;
}

.cp-toggle-track {
  width: 36px;
  height: 20px;
  background: var(--c-accent);
  border-radius: 10px;
  padding: 2px;
  display: flex;
  justify-content: flex-end;
}

.cp-toggle-thumb {
  width: 16px;
  height: 16px;
  background: var(--c-surface);
  border-radius: 50%;
}

/* Grid Preview */
.grid-preview {
  width: 85%;
  height: 80%;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.grid-col {
  background: oklch(0.6 0.1 24 / 0.12);
  border-radius: 2px;
}

/* Icon Grid */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 60%;
}

.icon-grid svg {
  width: 100%;
  color: var(--c-text-muted);
}

/* Spacing Preview */
.spacing-preview {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 80%;
}

.sp-block {
  background: oklch(0.6 0.12 24 / 0.15);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-mono);
  font-size: 0.6rem;
  color: var(--c-text-muted);
}

.sp-4 { width: 16px; height: 20%; }
.sp-8 { width: 20px; height: 30%; }
.sp-16 { width: 24px; height: 45%; }
.sp-24 { width: 28px; height: 58%; }
.sp-32 { width: 32px; height: 72%; }
.sp-48 { width: 36px; height: 90%; }

/* --- Creative / Original Work --- */
.creative {
  padding: var(--space-2xl) var(--space-lg);
  max-width: 1200px;
  margin: 0 auto;
}

.creative-intro {
  font-size: clamp(0.95rem, 1.05vw, 1.05rem);
  color: var(--c-text-muted);
  max-width: 560px;
  line-height: 1.8;
  margin-bottom: var(--space-xl);
}

.creative-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 180px;
  gap: var(--space-sm);
}

.creative-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
}

.creative-item-tall {
  grid-row: span 2;
}

.creative-item-wide {
  grid-column: span 2;
}

.creative-visual {
  width: 100%;
  height: 100%;
  background: oklch(0.9 var(--art-sat) var(--art-hue));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.6s var(--ease-out-expo);
}

.creative-item:hover .creative-visual {
  transform: scale(1.05);
}

.creative-label {
  position: absolute;
  bottom: 12px;
  left: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: oklch(0.2 0.02 60);
  background: oklch(0.97 0.005 80 / 0.85);
  padding: 0.3em 0.7em;
  border-radius: 4px;
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s, transform 0.3s var(--ease-out);
}

.creative-item:hover .creative-label {
  opacity: 1;
  transform: translateY(0);
}

/* Abstract Art Placeholders */
.art-abstract {
  width: 60%;
  aspect-ratio: 1;
}

.art-blob {
  border-radius: 60% 40% 70% 30% / 50% 60% 40% 50%;
  background: radial-gradient(
    circle at 40% 40%,
    oklch(0.75 0.18 var(--art-hue)),
    oklch(0.55 0.15 calc(var(--art-hue) + 30)) 60%,
    oklch(0.4 0.12 calc(var(--art-hue) + 60)) 100%
  );
  animation: blobMorph 8s infinite ease-in-out alternate;
}

@keyframes blobMorph {
  0% { border-radius: 60% 40% 70% 30% / 50% 60% 40% 50%; }
  100% { border-radius: 40% 60% 30% 70% / 60% 40% 50% 50%; }
}

.art-geo {
  background: conic-gradient(
    from 0deg,
    oklch(0.6 0.15 var(--art-hue)) 0deg,
    oklch(0.8 0.1 calc(var(--art-hue) + 60)) 90deg,
    oklch(0.5 0.18 calc(var(--art-hue) + 120)) 180deg,
    oklch(0.7 0.12 calc(var(--art-hue) + 180)) 270deg,
    oklch(0.6 0.15 var(--art-hue)) 360deg
  );
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}

.art-wave {
  width: 80%;
  height: 60%;
  background:
    repeating-linear-gradient(
      0deg,
      oklch(0.65 0.14 var(--art-hue)) 0px,
      oklch(0.65 0.14 var(--art-hue)) 3px,
      transparent 3px,
      transparent 12px
    );
  border-radius: 50%;
  transform: rotate(-15deg);
}

.art-lines {
  width: 80%;
  height: 80%;
  background:
    repeating-linear-gradient(
      45deg,
      oklch(0.5 0.12 var(--art-hue)) 0px,
      oklch(0.5 0.12 var(--art-hue)) 1.5px,
      transparent 1.5px,
      transparent 16px
    );
}

.art-circle {
  border-radius: 50%;
  background: oklch(0.88 0.06 var(--art-hue));
  box-shadow:
    inset 8px 8px 16px oklch(0.7 0.1 var(--art-hue) / 0.4),
    inset -8px -8px 16px oklch(0.97 0.03 var(--art-hue) / 0.6);
}

.art-plant {
  width: 40%;
  height: 80%;
  position: relative;
}

.art-plant::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 3px;
  height: 100%;
  background: oklch(0.5 0.12 var(--art-hue));
  transform: translateX(-50%);
}

.art-plant::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 48px;
  height: 48px;
  border-radius: 0 50% 50% 50%;
  background: oklch(0.6 0.16 var(--art-hue));
  transform: translateX(-50%) rotate(-45deg);
}

.art-typo {
  font-family: var(--f-display);
  font-size: 4rem;
  font-weight: 800;
  color: oklch(0.5 0.18 var(--art-hue));
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  aspect-ratio: auto;
}

.art-typo::after {
  content: 'Aa';
}

.art-minimal {
  width: 50%;
  height: 70%;
  border: 2px solid oklch(0.5 0.1 var(--art-hue));
  border-radius: 16px;
  position: relative;
}

.art-minimal::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  width: 30%;
  height: 3px;
  background: oklch(0.5 0.1 var(--art-hue));
  border-radius: 2px;
  transform: translateX(-50%);
}

.creative-note {
  margin-top: var(--space-lg);
  font-size: 0.82rem;
  color: var(--c-text-muted);
}

.creative-note span {
  font-weight: 600;
  color: var(--c-accent);
}

/* --- Blog & Extras --- */
.blog {
  padding: var(--space-2xl) var(--space-lg);
  background: var(--c-surface);
}

.blog-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.blog-posts {
  display: flex;
  flex-direction: column;
}

.blog-post {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--c-border);
  cursor: pointer;
  transition: padding-left 0.3s var(--ease-out);
}

.blog-post:first-child {
  border-top: 1px solid var(--c-border);
}

.blog-post:hover {
  padding-left: var(--space-sm);
}

.blog-post time {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--c-text-muted);
  display: block;
  margin-bottom: 0.3em;
}

.blog-post h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.3em;
  line-height: 1.4;
}

.blog-post p {
  font-size: 0.85rem;
  color: var(--c-text-muted);
  line-height: 1.6;
}

/* Extras */
.extras {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.extras-title {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--c-border);
}

.extras-list li {
  font-size: 0.85rem;
  padding: 0.4em 0;
  color: var(--c-text-muted);
  border-bottom: 1px solid oklch(0.94 0.005 70);
}

.extras-list li strong {
  color: var(--c-text);
  font-weight: 600;
}

/* --- Contact --- */
.contact {
  padding: var(--space-2xl) var(--space-lg);
  background: var(--c-text);
  color: var(--c-bg);
}

.contact-inner {
  max-width: 800px;
  margin: 0 auto;
}

.contact .section-label {
  color: oklch(0.6 0.01 60);
}

.contact-title {
  font-family: var(--f-display);
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-md);
}

.contact-title em {
  color: var(--c-accent);
}

.contact-desc {
  font-size: clamp(0.95rem, 1.1vw, 1.1rem);
  color: oklch(0.65 0.01 60);
  line-height: 1.7;
  margin-bottom: var(--space-xl);
  max-width: 480px;
}

.contact-links {
  display: flex;
  flex-direction: column;
}

.contact-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) 0;
  border-top: 1px solid oklch(0.3 0.01 60);
  transition: padding-left 0.3s var(--ease-out);
}

.contact-link:last-child {
  border-bottom: 1px solid oklch(0.3 0.01 60);
}

.contact-link:hover {
  padding-left: var(--space-sm);
}

.contact-link-label {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: oklch(0.55 0.01 60);
}

.contact-link-value {
  font-size: 0.92rem;
  font-weight: 500;
}

/* --- Footer --- */
.footer {
  padding: var(--space-md) var(--space-lg);
  background: oklch(0.12 0.02 60);
  color: oklch(0.5 0.01 60);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}

.footer-top {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  transition: color 0.3s;
}

.footer-top:hover {
  color: var(--c-bg);
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-bottom: var(--space-xl);
  }

  .hero-showcase {
    height: 380px;
  }

  .hero-card-1 { width: 260px; height: 300px; }
  .hero-card-2 { width: 200px; height: 260px; }
  .hero-card-3 { width: 160px; height: 200px; }

  .section-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .system-intro {
    position: static;
  }

  .project-card-large {
    grid-column: span 2;
    grid-template-columns: 1fr;
  }

  .system-showcase {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  .hero-title {
    font-size: clamp(2.8rem, 10vw, 4rem);
  }

  .hero-showcase {
    height: 300px;
  }

  .hero-card-1 { width: 200px; height: 240px; left: 0; }
  .hero-card-2 { width: 160px; height: 200px; }
  .hero-card-3 { width: 130px; height: 160px; }

  .hero-scroll { display: none; }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card-large {
    grid-column: span 1;
    grid-template-columns: 1fr;
  }

  .system-showcase {
    grid-template-columns: 1fr;
  }

  .creative-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 150px;
  }

  .creative-item-wide {
    grid-column: span 1;
  }

  .extras {
    grid-template-columns: 1fr;
  }

  .skill-grid {
    grid-template-columns: 1fr;
  }

  .portfolio-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: var(--space-xs);
  }

  .portfolio-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
  .hero-showcase {
    height: 240px;
  }

  .hero-card-2 { display: none; }
  .hero-card-3 { display: none; }

  .hero-card-1 {
    width: 100%;
    height: 100%;
    position: static;
    transform: none;
  }

  .creative-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 180px;
  }

  .creative-item-tall {
    grid-row: span 1;
  }

  .contact-title {
    font-size: clamp(2.5rem, 12vw, 3.5rem);
  }
}
