/* ==========================================================================
   JJ Portfolio v2 — Design System Stylesheet
   Built from JJ-Portfolio-v2-Design-Doc.md
   ========================================================================== */

/* ---------- Fonts: General Sans (Fontshare) + IBM Plex Mono (Google) ---------- */
@import url('https://api.fontshare.com/v2/css?f[]=general-sans@400,500,600,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ---------- Design tokens ---------- */
:root{
  /* Light theme (default) — Ch.5.3 */
  --bg: #FAFAF8;
  --surface: #F3F3F0;
  --elevated: #FFFFFF;
  --text: #111111;
  --text-secondary: #5F6368;
  --border: #E6E6E2;
  --glass: rgba(255,255,255,0.65);
  --glass-blur: 20px;
  --accent: #3B82F6;
  --accent-text: #FFFFFF;
  --shadow-color: 220 30% 10%;

  /* Spacing — 8px system */
  --space-1: 0.5rem;   /* 8 */
  --space-2: 1rem;     /* 16 */
  --space-3: 1.5rem;   /* 24 */
  --space-4: 2rem;     /* 32 */
  --space-5: 3rem;     /* 48 */
  --space-6: 4rem;     /* 64 */
  --space-7: 6rem;     /* 96 */
  --space-8: 8rem;     /* 128 */

  /* Radius */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 30px;
  --radius-pill: 999px;

  /* Motion timing — Ch.8 */
  --t-fast: 120ms;
  --t-quick: 180ms;
  --t-base: 280ms;
  --t-slow: 450ms;
  --t-slower: 700ms;
  --ease: cubic-bezier(.22,.61,.36,1);

  /* Typography */
  --font-sans: 'General Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  /* Compatibility aliases — some page markup references these
     style2-style variable names directly via inline styles */
  --bg-elevated: var(--elevated);
  --text-muted: var(--text-secondary);

  color-scheme: light;
}

[data-theme="dark"]{
  --bg: #0D0D0D;
  --surface: #171717;
  --elevated: #202020;
  --text: #F5F5F5;
  --text-secondary: #B8B8B8;
  --border: #2A2A2A;
  --glass: rgba(24,24,24,0.55);
  --glass-blur: 24px;
  --accent: #3B82F6;
  --accent-text: #0D0D0D;
  --bg-elevated: var(--elevated);
  --text-muted: var(--text-secondary);
  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: auto; }
body{
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--t-slow) var(--ease), color var(--t-slow) var(--ease);
  overflow-x: hidden;
}
img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
ul{ margin: 0; padding: 0; list-style: none; }
button{ font-family: inherit; }
h1,h2,h3,h4,p{ margin: 0; }

::selection{ background: var(--accent); color: #fff; }

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

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, [data-reveal]{ opacity: 1 !important; transform: none !important; }
}

/* ---------- Layout helpers ---------- */
.wrap{
  width: 90%;
  max-width: 1320px;
  margin: 0 auto;
}
.section{
  padding: var(--space-7) 0;
}
.section-tight{ padding: var(--space-6) 0; }

.eyebrow{
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.section-head{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

/* ---------- Typography scale ---------- */
h1, .h1{
  font-size: clamp(2.4rem, 5.6vw, 4.6rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
h2, .h2{
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
}
h3, .h3{
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-weight: 600;
  line-height: 1.25;
}
.lead{
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--text-secondary);
  line-height: 1.65;
  font-weight: 400;
}
p{
  line-height: 1.65;
  color: var(--text-secondary);
}
.text-body{ color: var(--text); }
.text-muted{ color: var(--text-secondary); }
.small{ font-size: 0.875rem; }
.caption{ font-size: 0.8125rem; color: var(--text-secondary); }

.mono{
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Buttons — pill, subtle hover ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--t-quick) var(--ease), box-shadow var(--t-quick) var(--ease), background var(--t-quick) var(--ease), color var(--t-quick) var(--ease), border-color var(--t-quick) var(--ease);
  white-space: nowrap;
}
.btn svg{ width: 16px; height: 16px; flex: none; }
.btn-primary{
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -8px hsl(217 91% 60% / 0.45);
  background: #2f6fe0;
}
.btn-primary:active{ transform: translateY(0) scale(0.98); }

.btn-accent{
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -8px hsl(217 91% 60% / 0.45);
  background: #2f6fe0;
}
.btn-accent:active{ transform: translateY(0) scale(0.98); }

.btn-ghost{
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover{
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--accent);
}
.btn-ghost:active{ transform: translateY(0) scale(0.98); }

.btn-lg{ padding: 1rem 2rem; font-size: 1rem; }
.btn-block{ width: 100%; justify-content: center; }

.text-link{
  position: relative;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 2px;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: 0% 1.5px;
  transition: background-size var(--t-base) var(--ease), color var(--t-base) var(--ease);
}
.text-link:hover{ background-size: 100% 1.5px; color: var(--accent); }
.text-link .ext{ width: 12px; height: 12px; margin-left: 4px; vertical-align: -1px; opacity: 0.6; }

/* ==========================================================================
   NAVBAR — floating glass, Ch.6.6–6.13
   ========================================================================== */
.navbar{
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 1320px;
  z-index: 1000;
  border-radius: var(--radius-lg);
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  border: 1px solid var(--border);
  box-shadow: 0 10px 40px -12px hsl(var(--shadow-color) / 0.18);
  transition: height var(--t-slow) var(--ease), box-shadow var(--t-slow) var(--ease), background var(--t-slow) var(--ease), padding var(--t-slow) var(--ease);
  opacity: 0;
  transform: translateX(-50%) translateY(-16px);
}
.navbar.is-ready{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition: opacity var(--t-slower) var(--ease), transform var(--t-slower) var(--ease);
}
.navbar.is-scrolled{
  box-shadow: 0 14px 44px -10px hsl(var(--shadow-color) / 0.28);
}
.nav-inner{
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-3);
  transition: height var(--t-slow) var(--ease);
}
.navbar.is-scrolled .nav-inner{ height: 64px; }

.brand{
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-links{
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.nav-link{
  position: relative;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 4px 0;
  transition: color var(--t-quick) var(--ease);
}
.nav-link::after{
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%; height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-quick) var(--ease);
}
.nav-link:hover{ color: var(--text); }
.nav-link:hover::after{ transform: scaleX(1); }
.nav-link.active{ color: var(--accent); }
.nav-link.active::after{ transform: scaleX(1); }

.nav-right{
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Theme toggle — pill, sun/moon slide */
.theme-toggle{
  position: relative;
  width: 52px;
  height: 30px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 3px;
}
.theme-toggle .knob{
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--elevated);
  box-shadow: 0 2px 6px hsl(var(--shadow-color) / 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(0);
  transition: transform var(--t-base) var(--ease), background var(--t-base) var(--ease);
}
[data-theme="dark"] .theme-toggle .knob{ transform: translateX(22px); }
.theme-toggle svg{ width: 13px; height: 13px; color: var(--accent); }
.theme-toggle .icon-moon{ display: none; }
[data-theme="dark"] .theme-toggle .icon-sun{ display: none; }
[data-theme="dark"] .theme-toggle .icon-moon{ display: block; }

/* Mobile menu button */
.menu-btn{
  display: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  position: relative;
}
.menu-btn span{
  position: absolute;
  left: 10px; right: 10px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--t-base) var(--ease), opacity var(--t-fast) var(--ease), top var(--t-base) var(--ease);
}
.menu-btn span:nth-child(1){ top: 15px; }
.menu-btn span:nth-child(2){ top: 20px; }
.menu-btn span:nth-child(3){ top: 25px; }
.menu-btn.is-open span:nth-child(1){ top: 20px; transform: rotate(45deg); }
.menu-btn.is-open span:nth-child(2){ opacity: 0; }
.menu-btn.is-open span:nth-child(3){ top: 20px; transform: rotate(-45deg); }

/* Mobile full-screen panel */
.mobile-panel{
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-slow) var(--ease);
}
.mobile-panel.is-open{ opacity: 1; visibility: visible; }
.mobile-panel .nav-link{ font-size: 2rem; font-weight: 600; color: var(--text); opacity: 0; transform: translateY(16px); }
.mobile-panel .nav-link::after{ display: none; }
.mobile-panel.is-open .nav-link{ animation: mnav-in var(--t-slow) var(--ease) forwards; }
.mobile-panel .nav-link:nth-child(1){ animation-delay: .05s; }
.mobile-panel .nav-link:nth-child(2){ animation-delay: .11s; }
.mobile-panel .nav-link:nth-child(3){ animation-delay: .17s; }
.mobile-panel .btn{ opacity: 0; transform: translateY(16px); }
.mobile-panel.is-open .btn{ animation: mnav-in var(--t-slow) var(--ease) forwards; animation-delay: .23s; }
@keyframes mnav-in{ to{ opacity: 1; transform: translateY(0); } }
body.menu-locked{ overflow: hidden; }

@media (max-width: 860px){
  .nav-links, .nav-right .btn{ display: none; }
  .nav-right{ gap: var(--space-2); }
  .menu-btn{ display: block; }
}

/* ---------- Scroll progress — desktop only, Ch.6.16 ---------- */
.scroll-progress{
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 1100;
  transition: width 60ms linear;
}
@media (max-width: 860px){ .scroll-progress{ display: none; } }

/* ---------- Back to top — Ch.6.17 ---------- */
.back-to-top{
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease), visibility var(--t-base) var(--ease);
  box-shadow: 0 8px 24px -8px hsl(var(--shadow-color) / 0.25);
}
.back-to-top.is-visible{ opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top svg{ width: 18px; height: 18px; color: var(--text); }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero{
  padding: calc(72px + var(--space-8)) 0 var(--space-7);
  position: relative;
}
.hero::before{
  content: "";
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: min(900px, 90vw);
  height: 480px;
  background: radial-gradient(closest-side, hsl(217 91% 60% / 0.16), transparent 70%);
  z-index: -1;
  pointer-events: none;
}
.hero-inner{
  max-width: 860px;
}
.hero h1{ overflow: hidden; }
.hero h1 .line{ display: block; overflow: hidden; }
.hero h1 .line span{ display: block; transform: translateY(110%); }
.hero-lead{
  margin-top: var(--space-3);
  max-width: 560px;
}

/* Hero two-column layout (text + portrait) */
.hero-grid{
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-6);
  align-items: center;
}
@media (max-width: 860px){
  .hero-grid{ grid-template-columns: 1fr; gap: var(--space-5); text-align: left; }
  .hero-grid .hero-portrait{ max-width: 280px; }
}

/* About section two-column layout */
.about-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  align-items: start;
}
@media (max-width: 780px){
  .about-grid{ grid-template-columns: 1fr; gap: var(--space-4); }
}

.about-tags{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
@media (max-width: 420px){
  .about-tags{ grid-template-columns: 1fr; }
}
.hero-cta{
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
  flex-wrap: wrap;
}
.hero-meta{
  margin-top: var(--space-6);
  display: flex;
  gap: var(--space-5);
  flex-wrap: wrap;
}
.hero-meta div{ display: flex; flex-direction: column; gap: 2px; }
.hero-meta .num{ font-size: 1.6rem; font-weight: 600; }
.hero-meta .label{ font-size: 0.8125rem; color: var(--text-secondary); }

/* ---------- Availability badge ---------- */
.availability{
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 500;
}
.availability .dot{
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px hsl(142 71% 45% / 0.2);
}

/* ==========================================================================
   CARDS / PROJECTS / CAPABILITIES / TESTIMONIALS
   ========================================================================== */
.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.grid{ display: grid; gap: var(--space-3); }
.grid-3{ grid-template-columns: repeat(3, 1fr); }
.grid-2{ grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px){ .grid-3{ grid-template-columns: 1fr; } .grid-2{ grid-template-columns: 1fr; } }

/* Featured work preview strip (home) */
.work-preview{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}
@media (max-width: 780px){ .work-preview{ grid-template-columns: 1fr; } }

.work-card{
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
}
.work-card .img-wrap{
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--elevated);
}
.work-card img{
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--t-slower) var(--ease);
}
.work-card:hover img{ transform: scale(1.035); }
.work-card .meta{
  padding: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.work-card .meta h3{ font-size: 1.05rem; }
.work-card .tag{ font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.work-card .arrow{ width: 18px; height: 18px; color: var(--text-secondary); transition: transform var(--t-base) var(--ease), color var(--t-base) var(--ease); }
.work-card:hover .arrow{ transform: translate(3px,-3px); color: var(--accent); }

/* Capabilities grid — icon cards (from style2, tokens translated) */
.cap-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3);
}
.cap-card .cap-icon{
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: hsl(217 91% 60% / 0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
}
.cap-card .cap-icon svg{ width: 20px; height: 20px; }
.cap-card h3{ font-size: 1.08rem; margin-bottom: var(--space-1); }
.cap-card p{ color: var(--text-secondary); font-size: 0.94rem; margin: 0 0 var(--space-2); }
.cap-card a{
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color var(--t-quick) var(--ease);
}
.cap-card a:hover{ color: var(--accent); }

/* Testimonials — 3-card grid (from style2, tokens translated) */
.testi-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
}
.testi-card p{ font-size: 0.98rem; color: var(--text); line-height: 1.55; margin: 0 0 var(--space-3); }
.testi-person{
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.testi-person img{
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--elevated);
  border: 1px solid var(--border);
}
.testi-person strong{ font-size: 0.9rem; display: block; }
.testi-person span{ font-size: 0.8rem; color: var(--text-secondary); }

/* Legacy alias in case any page still renders the old .testimonial/.who/.avatar markup */
.testimonial{ display: flex; flex-direction: column; justify-content: space-between; min-height: 220px; }
.testimonial .quote{ font-size: 1.05rem; color: var(--text); line-height: 1.55; }
.testimonial .who{ margin-top: var(--space-3); display: flex; align-items: center; gap: 0.75rem; }
.testimonial .avatar{ width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--elevated); border: 1px solid var(--border); }
.testimonial .who strong{ font-size: 0.9rem; display: block; }
.testimonial .who span{ font-size: 0.8rem; color: var(--text-secondary); }

/* Final CTA band */
.cta-band{
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--space-6) var(--space-5);
  text-align: center;
}
.cta-band h2{ max-width: 640px; margin: 0 auto; }
.cta-band .lead{ margin: var(--space-2) auto 0; max-width: 520px; }
.cta-band .hero-cta{ justify-content: center; margin-top: var(--space-4); }

/* ==========================================================================
   FOOTER — Ch.6.21–6.22
   ========================================================================== */
.site-footer{
  padding: var(--space-6) 0 var(--space-5);
  border-top: 1px solid var(--border);
  margin-top: var(--space-7);
}
.footer-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
}
.footer-nav{
  display: flex;
  gap: var(--space-3);
}
.footer-nav a{ font-size: 0.9rem; color: var(--text-secondary); transition: color var(--t-quick) var(--ease); }
.footer-nav a:hover{ color: var(--accent); }
.footer-socials{
  display: flex;
  gap: var(--space-2);
}
.footer-socials a{
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: color var(--t-quick) var(--ease), border-color var(--t-quick) var(--ease), transform var(--t-quick) var(--ease);
}
.footer-socials a:hover{ color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.footer-socials svg{ width: 16px; height: 16px; }
.footer-bottom{
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

@media (max-width: 600px){
  .footer-top, .footer-bottom{ flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   WORK PAGE — editorial list layout (from style2), Ch.10
   ========================================================================== */
.page-hero{
  padding: calc(72px + var(--space-7)) 0 var(--space-6);
}
.page-hero h1{ max-width: 760px; }
.page-hero .lead{ max-width: 560px; margin-top: var(--space-3); }

/* Editorial work list — pulled in from style2, no sliders/carousels.
   Tokens translated to this file's design system (--space-*, --radius-*,
   --t-*, --surface/--elevated/--border/--accent) so nothing conflicts
   with the rest of the sheet. */
.work-row{
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}
.work-row:first-of-type{ padding-top: var(--space-1); }
.work-row:last-of-type{ border-bottom: none; }

.work-media{
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--elevated);
  aspect-ratio: 16/11;
  will-change: transform;
}
.work-media img{
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--t-slower) var(--ease);
}
.work-row:hover .work-media img{ transform: scale(1.04); }

.work-index{ font-size: 0.78rem; color: var(--text-secondary); margin-bottom: var(--space-3); }
.work-title{ font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: var(--space-2); }
.work-desc{ color: var(--text-secondary); max-width: 42ch; margin-bottom: var(--space-3); }
.work-tags{ display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: var(--space-3); }
.tag{
  font-size: 0.72rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-pill);
  background: hsl(217 91% 60% / 0.12);
  color: var(--accent);
}
.work-link{ font-weight: 600; font-size: 0.92rem; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.work-row:hover .work-link{ color: var(--accent); }

@media (max-width: 760px){
  .work-row{ grid-template-columns: 1fr; gap: var(--space-3); padding: var(--space-4) 0; }
}

/* Simple gallery grid (graphics work, no carousel) — also from style2 */
.gallery-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-2);
}
.gallery-grid > a{
  /* Skip render/layout work for offscreen tiles — this is the main
     fix for scroll jank on long image grids. */
  content-visibility: auto;
  contain-intrinsic-size: 260px 260px;
}
.gallery-grid img{
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  transition: transform var(--t-slow) var(--ease);
}
.gallery-grid a:hover img{ transform: scale(1.03); }

/* Show-4-then-expand (populated via data-gallery-limit in JS) */
.gallery-grid > a.gallery-hidden{ display: none; }
.gallery-toggle{ margin-top: var(--space-3); }

@media (max-width: 600px){
  /* Force exactly 2 columns on phones instead of the 1-column result
     auto-fill gives once minmax(220px) no longer fits two per row.
     !important is safe here — it only needs to beat the inline
     grid-template-columns override on the certificates gallery. */
  .gallery-grid{ grid-template-columns: repeat(2, 1fr) !important; gap: var(--space-1); }
}

/* ==========================================================================
   CONTACT PAGE — Ch.11
   ========================================================================== */
.contact-methods{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}
@media (max-width: 780px){ .contact-methods{ grid-template-columns: 1fr; } }
.contact-card{
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
.contact-card:hover{ transform: translateY(-3px); border-color: var(--accent); }
.contact-card .ic{
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--elevated);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.contact-card .ic svg{ width: 20px; height: 20px; color: var(--accent); }
.contact-card h3{ font-size: 1rem; }
.contact-card p{ margin: 0; font-size: 0.875rem; }

.process{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
@media (max-width: 780px){ .process{ grid-template-columns: 1fr; } }
.process-step .idx{
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  display: block;
  margin-bottom: var(--space-1);
}
.process-step h3{ font-size: 1.05rem; margin-bottom: 4px; }
.process-step p{ font-size: 0.9rem; }

/* ==========================================================================
   404 PAGE
   ========================================================================== */
.error-page{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-4);
}
.error-page .code{
  font-size: clamp(4rem, 16vw, 8rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.error-page h1{ margin-top: var(--space-2); font-size: clamp(1.4rem, 3vw, 2rem); }
.error-page p{ margin-top: var(--space-2); max-width: 420px; }
.error-page .hero-cta{ margin-top: var(--space-4); justify-content: center; }

/* ---------- Hero portrait (rotating photo, from style2) ---------- */
.hero-portrait{
  position: relative;
  display: flex;
  justify-content: center;
  max-width: 420px;
  margin: 0 auto;
}
.hero-portrait img{
  width: 100%;
  max-width: 420px;
  height: auto;
  object-fit: contain;
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), filter 0.6s var(--ease);
}
.hero-portrait img.fade-out{
  opacity: 0;
  transform: scale(0.97);
  filter: blur(4px);
}

/* ---------- Page-load / GSAP helper classes ---------- */
.reveal{ opacity: 0; transform: translateY(24px); }
.js-ready .reveal{ opacity: 0; }
[data-reveal]{ opacity: 0; transform: translateY(24px); }

@media (max-width: 600px){
  .hero{ padding-top: calc(72px + var(--space-6)); padding-bottom: var(--space-5); }
  .page-hero{ padding-top: calc(72px + var(--space-5)); }
  .cta-card{ padding: var(--space-5) var(--space-3) !important; }
}

.cta-card{ padding: 56px 32px; }
