/* ----------------------------------------
   七叶怀瑾 — Editorial Magazine Design System
   ---------------------------------------- */

:root {
  /* Warm parchment palette — Claude-inspired paper warmth */
  --bg: #f5f4ed;
  --bg-alt: #eeece4;
  --bg-card: #faf9f5;
  --bg-dark: #121212;

  --text: #1d1b18;
  --text-secondary: #6b6560;
  --text-muted: #87867f;
  --text-light: #b0aea5;

  /* Terracotta accent — warm, earthy, deliberately un-tech */
  --accent: #c96442;
  --accent-muted: rgba(201, 100, 66, 0.08);

  --border: #e8e6dc;
  --border-light: #f0eee6;

  /* Typography — local/system-first to avoid render-blocking third-party fonts */
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --font-sans: "Inter", "HarmonyOS Sans SC", "MiSans", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  /* Spacing — generous breathing room */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 48px;
  --space-xl: 96px;
  --space-2xl: 140px;

  /* Editorial insets — keep list/card content from hugging the left edge */
  --inset-inline-start: 10px;
  --inset-inline-end: 8px;

  /* Radius */
  --radius: 8px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  /* Shadows — ring-based, Claude-inspired */
  --shadow-whisper: rgba(0, 0, 0, 0.05) 0px 4px 24px;
  --shadow-ring: 0px 0px 0px 1px var(--border);
  --shadow-card: 0px 0px 0px 1px var(--border), rgba(0, 0, 0, 0.04) 0px 2px 8px;
  --shadow-elevated: 0px 0px 0px 1px var(--border), rgba(0, 0, 0, 0.06) 0px 8px 24px;

  /* Ease */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
}

/* Dark mode — deep warm slate */
[data-theme="dark"] {
  --bg: #141413;
  --bg-alt: #1c1a17;
  --bg-card: #1e1c19;

  --text: #e8e4df;
  --text-secondary: #a09890;
  --text-muted: #706860;
  --text-light: #4a4540;

  --accent: #d97757;
  --accent-muted: rgba(217, 119, 87, 0.12);

  --border: #30302e;
  --border-light: #242120;
}

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

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

html {
  scroll-behavior: auto; /* We handle smooth scroll in JS */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  overflow-x: hidden;
  cursor: auto;
  transition: background-color 0.4s ease, color 0.4s ease;
}

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

button {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
  cursor: pointer;
}

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

body.has-fancy-cursor,
body.has-fancy-cursor a,
body.has-fancy-cursor button,
body.has-fancy-cursor input,
body.has-fancy-cursor textarea {
  cursor: none;
}

::selection {
  background: var(--accent-muted);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100000;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: var(--radius-full);
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.2s ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* ----------------------------------------
   Custom Cursor
   ---------------------------------------- */

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  background: var(--text);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transition: transform 0.15s ease, opacity 0.3s ease;
  transform: translate(-50%, -50%);
}

.cursor-circle {
  position: fixed;
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  border: 1.5px solid rgba(201, 100, 66, 0.2);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: width 0.4s var(--ease), height 0.4s var(--ease),
              border-color 0.3s ease, background 0.3s ease;
}

/* Hover state — circle grows, dot hides */
.cursor-hover .cursor-dot {
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
}

.cursor-hover .cursor-circle {
  width: 64px;
  height: 64px;
  border-color: var(--accent);
  background: rgba(201, 100, 66, 0.06);
}

/* Text hover — blend mode */
.cursor-text .cursor-circle {
  width: 100px;
  height: 100px;
  background: var(--text);
  mix-blend-mode: difference;
  border-color: transparent;
}

.cursor-text .cursor-dot {
  opacity: 0;
}

/* ----------------------------------------
   Navigation
   ---------------------------------------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 48px;
  transition: padding 0.5s var(--ease), background-color 0.3s ease, border-color 0.3s ease;
}

.nav.scrolled {
  padding: 16px 48px;
  background: rgba(245, 244, 237, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-light);
}

.nav-brand {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.3s ease;
  position: relative;
}

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

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  transition: border-color 0.3s ease, color 0.3s ease, background 0.3s ease;
  padding: 0;
  margin-left: 8px;
}

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

.theme-icon--moon { display: none; }
.theme-icon--sun { display: block; }

[data-theme="dark"] .theme-icon--sun { display: none; }
[data-theme="dark"] .theme-icon--moon { display: block; }

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

.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: 160px 48px 80px;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 60px;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

/* ---- Hero Visual (right side) ---- */

.hero-visual {
  flex-shrink: 0;
  position: relative;
  width: 440px;
  height: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  will-change: transform;
  transition: transform 0.18s var(--ease-out);
  animation: fadeInVisual 1.2s var(--ease) 0.6s forwards;
}

@keyframes fadeInVisual {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.hero-avatar-wrapper {
  position: relative;
  width: 320px;
  height: 320px;
}

.hero-avatar-wrapper picture {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 2;
  transition: border-color 0.5s ease, box-shadow 0.5s ease, transform 0.6s var(--ease);
}

.hero-avatar:hover {
  border-color: var(--text-muted);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.12);
  transform: scale(1.02);
}

/* Inner ring */
.hero-avatar-ring {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  z-index: 1;
}

.hero-avatar-ring::after {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 1px dashed var(--border);
  opacity: 0.4;
}

/* Outer ring */
.hero-avatar-ring--outer {
  inset: -40px;
  border: 1px solid var(--border-light);
  opacity: 0.35;
}

.hero-avatar-ring--outer::after {
  display: none;
}

@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.04); opacity: 1; }
}

@keyframes ringRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Decorative accent dots */
.hero-avatar-accent {
  position: absolute;
  border-radius: 50%;
  background: var(--text-muted);
  z-index: 1;
  opacity: 0;
  animation: fadeInVisual 1.2s var(--ease) 1.2s forwards;
}

.hero-avatar-accent--1 {
  width: 8px;
  height: 8px;
  top: 30px;
  right: 50px;
  opacity: 0.3;
}

.hero-avatar-accent--2 {
  width: 5px;
  height: 5px;
  bottom: 60px;
  left: 25px;
  opacity: 0.2;
}

.hero-avatar-accent--3 {
  width: 12px;
  height: 12px;
  bottom: 20px;
  right: 30px;
  background: transparent;
  border: 1px solid var(--border);
  opacity: 0.4;
}

@keyframes accentFloat1 {
  0%, 100% { transform: translateY(0); opacity: 0.3; }
  50% { transform: translateY(-10px); opacity: 0.5; }
}

@keyframes accentFloat2 {
  0%, 100% { transform: translate(0, 0); opacity: 0.2; }
  50% { transform: translate(5px, -8px); opacity: 0.4; }
}

@keyframes accentFloat3 {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.4; }
  50% { transform: translateY(-12px) rotate(180deg); opacity: 0.6; }
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: var(--space-lg);
  overflow: hidden;
}

.hero-label span {
  display: inline-block;
  transform: translateY(100%);
  transition: transform 0.8s var(--ease) 0.1s;
}

.hero-label.visible span {
  transform: translateY(0);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(72px, 12vw, 160px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: var(--space-md);
  overflow: hidden;
}

/* Each character animated individually */
.hero-title .char {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1s var(--ease);
}

.hero-title .char.visible {
  transform: translateY(0);
}

.hero-subtitle {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 400;
  font-style: italic;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.hero-subtitle .word {
  display: inline-block;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.8s var(--ease), opacity 0.6s ease;
}

.hero-subtitle .word.visible {
  transform: translateY(0);
  opacity: 1;
}

.hero-desc {
  max-width: 520px;
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-secondary);
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s var(--ease) 0.8s;
}

.hero-desc.visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-scroll {
  position: absolute;
  bottom: 48px;
  left: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-light);
  opacity: 0;
  animation: fadeIn 0.6s ease 1.5s forwards;
}

.hero-scroll-line {
  width: 1px;
  height: 48px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}

.hero-scroll-line::after {
  content: "";
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--text-muted);
  animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
  0% { top: -100%; }
  50% { top: 100%; }
  100% { top: 100%; }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* ----------------------------------------
   Marquee
   ---------------------------------------- */

.marquee-wrapper {
  overflow: hidden;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.marquee-track {
  display: flex;
  gap: 0;
  width: max-content;
}

.marquee-item {
  white-space: nowrap;
  padding: 0 24px;
  font-family: var(--font-serif);
  font-size: 16px;
  font-style: italic;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 24px;
}

.marquee-item::after {
  content: "✦";
  font-style: normal;
  font-size: 10px;
  color: var(--text-light);
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ----------------------------------------
   Sections — Shared
   ---------------------------------------- */

.section {
  padding: var(--space-2xl) 48px;
  max-width: 1400px;
  margin: 0 auto;
}

.section-number {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-light);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: var(--space-sm);
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.section-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 480px;
  line-height: 1.7;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }
.reveal-d4 { transition-delay: 0.32s; }

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

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  margin-top: var(--space-xl);
  align-items: start;
}

.about-text {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.9;
}

.about-text p + p {
  margin-top: 24px;
}

.about-text strong {
  color: var(--text);
  font-weight: 600;
}

.about-quote {
  font-family: var(--font-serif);
  font-size: 24px;
  font-style: italic;
  line-height: 1.6;
  color: var(--text);
  margin: 40px 0;
  padding-left: 28px;
  border-left: 2px solid var(--text);
}

.about-details {
  padding-top: 12px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 18px var(--inset-inline-end) 18px var(--inset-inline-start);
  border-bottom: 1px solid var(--border-light);
}

.detail-row:first-child {
  border-top: 1px solid var(--border-light);
}

.detail-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.detail-value {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.tech-item {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: all 0.3s var(--ease);
}

.tech-item:hover {
  border-color: var(--text);
  color: var(--text);
}

/* ----------------------------------------
   Projects — Horizontal Scroll
   ---------------------------------------- */

.projects-outer {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--border);
}

.projects-header {
  padding: 0 48px;
  max-width: 1400px;
  margin: 0 auto var(--space-xl);
}

.projects-wrapper {
  position: relative;
}

.projects-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.projects-track {
  display: flex;
  gap: 40px;
  padding: 0 48px;
  will-change: transform;
}

.project-card {
  flex-shrink: 0;
  width: 520px;
  padding: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
  position: relative;
  overflow: hidden;
}

.project-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease);
}

.project-card:hover::after {
  transform: scaleX(1);
}

.project-card:hover {
  border-color: var(--text);
  box-shadow: var(--shadow-elevated);
}

.project-number {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 0.1em;
  margin-bottom: 32px;
}

.project-name {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.project-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.project-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.project-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 28px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 100px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: gap 0.3s var(--ease);
}

.project-link:hover {
  gap: 16px;
}

.project-link-arrow {
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--text);
  position: relative;
  transition: width 0.3s var(--ease);
}

.project-link-arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: -3px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--text);
  border-top: 1.5px solid var(--text);
  transform: rotate(45deg);
}

.project-link:hover .project-link-arrow {
  width: 36px;
}

/* Coming Soon card */
.project-card--coming {
  border-style: dashed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.coming-symbol {
  font-size: 32px;
  color: var(--text-light);
  margin-bottom: 20px;
  font-family: var(--font-serif);
}

.coming-text {
  font-family: var(--font-serif);
  font-size: 20px;
  font-style: italic;
  color: var(--text-muted);
}

.coming-sub {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 8px;
}

/* ----------------------------------------
   Content Section (Blog + Podcast)
   ---------------------------------------- */

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: var(--space-xl);
}

.content-card {
  padding: 56px 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.content-card:hover {
  border-color: var(--text-muted);
}

.content-card-number {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 0.1em;
  margin-bottom: 28px;
}

.content-card-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.content-card-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* Typewriter cursor */
.cursor-blink {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--text);
  margin-left: 3px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Waveform */
.waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 28px;
  margin-top: 28px;
}

.waveform-bar {
  width: 2px;
  border-radius: 1px;
  background: var(--text-muted);
  opacity: 0.3;
  animation: wave 1.4s ease-in-out infinite;
}

.waveform-bar:nth-child(1) { height: 6px; animation-delay: 0s; }
.waveform-bar:nth-child(2) { height: 14px; animation-delay: 0.1s; }
.waveform-bar:nth-child(3) { height: 22px; animation-delay: 0.2s; }
.waveform-bar:nth-child(4) { height: 10px; animation-delay: 0.3s; }
.waveform-bar:nth-child(5) { height: 18px; animation-delay: 0.15s; }
.waveform-bar:nth-child(6) { height: 26px; animation-delay: 0.25s; }
.waveform-bar:nth-child(7) { height: 12px; animation-delay: 0.35s; }
.waveform-bar:nth-child(8) { height: 20px; animation-delay: 0.05s; }
.waveform-bar:nth-child(9) { height: 8px; animation-delay: 0.22s; }
.waveform-bar:nth-child(10) { height: 16px; animation-delay: 0.12s; }
.waveform-bar:nth-child(11) { height: 24px; animation-delay: 0.18s; }
.waveform-bar:nth-child(12) { height: 10px; animation-delay: 0.08s; }

@keyframes wave {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1.2); }
}

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

.footer {
  border-top: 1px solid var(--border);
  padding: var(--space-xl) 48px var(--space-lg);
  max-width: 1400px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-xl);
  padding-bottom: var(--space-xl);
}

.footer-brand-name {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.footer-brand-desc {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 340px;
  line-height: 1.7;
}

.footer-nav {
  display: flex;
  gap: 64px;
}

.footer-col-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  padding: 5px var(--inset-inline-end) 5px var(--inset-inline-start);
  transition: color 0.3s ease;
}

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

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-light);
}

/* ----------------------------------------
   Magnetic Button
   ---------------------------------------- */

.magnetic-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  transition: background 0.4s ease, color 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.magnetic-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateY(100%);
  transition: transform 0.4s var(--ease);
  border-radius: inherit;
}

.magnetic-btn:hover::before {
  transform: translateY(0);
}

.magnetic-btn span {
  position: relative;
  z-index: 1;
  transition: color 0.4s ease;
}

.magnetic-btn:hover span {
  color: var(--bg);
}

/* ----------------------------------------
   Surface Motion
   ---------------------------------------- */

.surface-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transform: translate3d(0, 0, 0);
  transition: transform 0.38s var(--ease), border-color 0.28s ease, box-shadow 0.38s var(--ease),
              background-color 0.28s ease;
}

.surface-card::before,
.surface-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: opacity 0.32s ease;
}

.surface-card::before {
  background: linear-gradient(145deg, rgba(201, 100, 66, 0.08), transparent 38%, rgba(26, 26, 26, 0.05));
  opacity: 0;
}

.surface-card::after {
  background: radial-gradient(220px circle at var(--spot-x, 50%) var(--spot-y, 50%), rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 60%);
  opacity: 0;
}

.surface-card > * {
  position: relative;
  z-index: 1;
}

body.motion-enhanced .surface-card.is-hovered {
  transform: perspective(1200px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateY(-4px);
  border-color: rgba(201, 100, 66, 0.18);
  box-shadow: 0 24px 56px rgba(26, 24, 22, 0.08);
}

body.motion-enhanced .surface-card.is-hovered::before,
body.motion-enhanced .surface-card.is-hovered::after {
  opacity: 1;
}

/* ----------------------------------------
   Scrollbar (subtle)
   ---------------------------------------- */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* Dark mode component overrides */
[data-theme="dark"] .nav.scrolled {
  background: rgba(20, 20, 19, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

[data-theme="dark"] .scene-panel {
  background: rgba(30, 28, 24, 0.78);
}

[data-theme="dark"] .scene-panel--primary {
  background: rgba(30, 28, 24, 0.95);
  border-color: rgba(30, 28, 24, 0.95);
}

[data-theme="dark"] .hero-avatar {
  border-color: var(--border);
}

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

@media (max-width: 1024px) {
  :root {
    --space-2xl: 80px;
  }

  .section, .hero, .projects-header {
    padding-left: 32px;
    padding-right: 32px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .project-card {
    width: 420px;
    padding: 36px;
  }

  .hero-visual {
    width: 300px;
    height: 300px;
  }

  .hero-avatar-wrapper {
    width: 200px;
    height: 200px;
  }

  .hero-flower {
    width: 90px;
    height: 90px;
  }

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

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 768px) {
  body {
    cursor: auto;
  }

  .cursor-dot, .cursor-circle {
    display: none;
  }

  .nav {
    padding: 16px 20px;
  }

  .nav.scrolled {
    padding: 12px 20px;
  }

  .nav-links {
    gap: 20px;
  }

  .nav-links a {
    font-size: 13px;
  }

  .hero {
    padding: 120px 20px 60px;
  }

  .hero-inner {
    flex-direction: column;
    text-align: center;
  }

  .hero-visual {
    width: 220px;
    height: 220px;
    order: -1;
    margin-bottom: 20px;
  }

  .hero-avatar-wrapper {
    width: 160px;
    height: 160px;
  }

  .hero-flower {
    width: 70px;
    height: 70px;
    top: -10px;
    right: -15px;
  }

  .hero-desc {
    max-width: 100%;
  }

  .section, .projects-header {
    padding-left: 20px;
    padding-right: 20px;
  }

  .projects-track {
    padding: 0 20px;
  }

  /* Disable horizontal scroll on mobile */
  .projects-wrapper {
    height: auto !important;
  }

  .projects-sticky {
    position: relative;
    height: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    padding: 0;
  }

  .projects-track {
    flex-direction: column;
    transform: none !important;
  }

  .project-card {
    width: 100%;
    padding: 28px;
  }

  .content-card {
    padding: 36px 24px;
  }

  .footer {
    padding: 48px 20px 32px;
  }

  .footer-nav {
    flex-direction: column;
    gap: 28px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .hero-scroll {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 56px;
  }

  .hero-subtitle {
    font-size: 22px;
  }

  .section-title {
    font-size: 32px;
  }

  .nav-links {
    display: none;
  }

  .marquee-item {
    font-size: 14px;
    padding: 0 16px;
  }
}

/* ----------------------------------------
   2026 Site Refresh
   ---------------------------------------- */

.nav-links a.nav-active {
  color: var(--text);
}

.nav-links a.nav-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: var(--text);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--text);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.3s ease;
}

.button-link:hover {
  background: var(--text);
  color: var(--bg);
  box-shadow: 0px 0px 0px 1px var(--text);
}

.button-link--ghost {
  border-color: var(--border);
  background: var(--bg-card);
}

.button-link--ghost:hover {
  border-color: var(--text);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}

.hero--home {
  min-height: auto;
  padding-bottom: 96px;
}

.hero-copy {
  flex: 1;
  min-width: 0;
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 28px;
}

.hero--home .hero-title {
  font-size: clamp(54px, 9vw, 116px);
  line-height: 1.06;
  margin-bottom: 22px;
}

.hero-title-line {
  display: block;
}

.hero-title-line--offset {
  margin-top: 0.16em;
  padding-left: 1.12em;
}

.hero-desc--home {
  opacity: 1;
  transform: none;
  transition: none;
  max-width: 620px;
  margin-bottom: 30px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.hero-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 720px;
}

.summary-card,
.story-note,
.notes-aside,
.cta-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.summary-card {
  padding: 18px 20px;
}

.summary-card--linked {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s ease;
}

.summary-card--linked:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.06);
  border-color: var(--text);
}

.summary-label,
.story-note-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.summary-card strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.summary-card p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-secondary);
}

.update-log {
  position: absolute;
  right: 0;
  bottom: 8px;
  width: 280px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
}

.update-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.update-log-title,
.update-log-note {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.update-log-window {
  height: 88px;
  overflow: hidden;
  border-top: 1px solid var(--border-light);
  padding-top: 10px;
}

.update-log-track {
  transition: transform 0.55s var(--ease);
}

.update-entry {
  height: 78px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 0 var(--inset-inline-end) 4px var(--inset-inline-start);
}

.update-entry-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.update-app,
.update-version {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
}

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

.update-change {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 420px);
  gap: 32px;
  align-items: end;
  margin-bottom: var(--space-xl);
}

.section-head--about {
  margin-bottom: 12px;
}

.section-head-side {
  display: grid;
  gap: 16px;
  justify-items: start;
}

.section-intro {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.section-link::after,
.note-link::after,
.case-links a::after {
  content: "↗";
  font-size: 12px;
}

.story-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 360px);
  gap: 36px;
  align-items: start;
}

.story-copy {
  font-size: 17px;
  line-height: 1.95;
  color: var(--text-secondary);
}

.story-copy p + p {
  margin-top: 22px;
}

.story-copy strong {
  color: var(--text);
}

.story-rail {
  display: grid;
  gap: 14px;
}

.story-note {
  padding: 20px;
}

.story-note p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-secondary);
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.case-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 24px;
  display: grid;
  gap: 18px;
}

.case-card--linked {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s ease;
}

.case-card--linked:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.06);
  border-color: var(--text);
}

.case-link-text {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.case-meta,
.note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-light);
}

.case-title,
.note-title,
.cta-title {
  font-family: var(--font-serif);
  color: var(--text);
}

.case-title {
  font-size: 30px;
  line-height: 1.15;
}

.case-desc,
.note-desc {
  font-size: 15px;
  line-height: 1.82;
  color: var(--text-secondary);
}

.case-scene {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}

.scene-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.scene-panel--primary {
  background: rgba(26, 24, 22, 0.95);
  border-color: rgba(26, 24, 22, 0.95);
}

.scene-panel strong,
.scene-panel span {
  display: block;
}

.scene-panel strong {
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text);
}

.scene-panel span {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.scene-panel--primary strong,
.scene-panel--primary span {
  color: var(--bg);
}

.case-points,
.notes-aside-list {
  display: grid;
  gap: 8px;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.75;
}

.case-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.case-links a,
.note-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.note-card,
.notes-aside {
  min-height: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 24px;
}

.note-card {
  display: grid;
  align-content: start;
  gap: 16px;
}

.note-card--linked {
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s ease;
}

.note-card--linked:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.06);
  border-color: var(--text);
}

.note-title {
  font-size: 28px;
  line-height: 1.22;
}

.notes-aside {
  display: grid;
  align-content: start;
  gap: 16px;
}

.notes-aside-title {
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 1.2;
  color: var(--text);
}

.cta-panel {
  padding: 30px 32px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) auto;
  gap: 24px;
  align-items: center;
}

.cta-title {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.22;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 1120px) {
  .case-grid,
  .notes-grid {
    grid-template-columns: 1fr;
  }

  .section-head,
  .story-layout,
  .cta-panel {
    grid-template-columns: 1fr;
  }

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

  .update-log {
    position: static;
    width: 100%;
    margin-top: 20px;
  }
}

@media (max-width: 768px) {
  .hero--home .hero-title {
    font-size: 54px;
  }

  .hero-title-line--offset {
    margin-top: 0.14em;
    padding-left: 0.6em;
  }

  .hero-actions,
  .cta-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button-link,
  .magnetic-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .nav-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .nav-links a {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

/* ----------------------------------------
   Subtle background grid refresh
   ---------------------------------------- */

:root {
  --grid-line: rgba(29, 27, 24, 0.07);
}

[data-theme="dark"] {
  --grid-line: rgba(232, 228, 223, 0.08);
}

body {
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px, 44px 44px, auto;
}
