:root {
  /* Vercel/Geist Minimalist Palette */
  --bg: #ffffff;
  --text: #171717;
  --muted: #666666;
  --soft: #707070;
  --line: #eaeaea;
  --line-strong: #d8d8d8;
  --surface: #fafafa;
  --black: #000000;
  --white: #ffffff;

  /* Refined Tags Palette */
  --tag-amber-bg: #fffbf0;
  --tag-amber-text: #b25e02;
  --tag-amber-border: #fcebc5;
  --tag-blue-bg: #f0f7ff;
  --tag-blue-text: #0068d6;
  --tag-blue-border: #cce3ff;
  --tag-purple-bg: #f9f1fe;
  --tag-purple-text: #7928ca;
  --tag-purple-border: #eedbfe;
  --tag-teal-bg: #ecfdf5;
  --tag-teal-text: #059669;
  --tag-teal-border: #d1fae5;
  --tag-gray-bg: #fafafa;
  --tag-gray-text: #666666;
  --tag-gray-border: #eaeaea;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --container: 1240px;
  --header-height: 72px;

  --font: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 32px);
  /* For anchor links */
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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




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

button {
  font: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.site-shell {
  width: min(100% - 48px, var(--container));
  margin: 0 auto;
}

/* Header & Nav */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header-height);
  width: min(100% - 48px, var(--container));
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.nav a {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid transparent;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}

.nav a:hover,
.nav a.is-active {
  color: var(--text);
  background: var(--white);
  border-color: var(--line);
}

.header-cta {
  justify-self: end;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  background: var(--white);
  transition: border-color 150ms ease, color 150ms ease;
}

.header-cta:hover {
  border-color: var(--text);
}

/* Mobile Menu Button */
.menu-button {
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: background 150ms ease;
}

.menu-button:hover {
  background: var(--surface);
}

.icon-close {
  display: none;
}

.menu-button.is-open .icon-menu {
  display: none;
}

.menu-button.is-open .icon-close {
  display: block;
}

/* Base Sections */
.section {
  padding: 120px 0;
  border-bottom: 1px solid var(--line);
}

.hero {
  padding-top: 100px;
}

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

.eyebrow span {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
}

/* Typography */
h1 {
  font-size: clamp(40px, 6vw, 84px);
  line-height: 1.05;
  letter-spacing: -0.05em;
  font-weight: 600;
  margin: 0;
}

h2 {
  font-size: clamp(32px, 4.5vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.04em;
  font-weight: 600;
  margin: 12px 0 0 0;
}

h3 {
  font-size: 18px;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0 0 8px 0;
}

.flex-heading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

p {
  margin: 0;
}

.inline-icon {
  color: var(--soft);
  transition: color 150ms ease;
}

.project-row:hover .inline-icon {
  color: var(--text);
}

/* Hero Content */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.62fr);
  gap: 64px;
  align-items: end;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.profile-image {
  position: relative;
  width: 120px;
  height: 120px;
  aspect-ratio: 1;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.profile-image img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}

.story-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center;
  transform: translate(-50%, -50%);
  width: 105.83%;
  height: 105.83%;
  z-index: 2;
  pointer-events: none;
  animation: spin-story 8s linear infinite;
}

.story-ring circle {
  stroke-dasharray: 388;
  stroke-dashoffset: 388;
  animation: draw-story 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes draw-story {
  0% { stroke-dashoffset: 388; }
  100% { stroke-dashoffset: 0; }
}

@keyframes spin-story {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Status Indicator */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: border-color 150ms ease, background-color 150ms ease;
}

.status-indicator:hover {
  border-color: var(--line-strong);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: background-color 300ms ease, transform 300ms ease, opacity 300ms ease;
}

/* Pulsing Keyframe Animations */
@keyframes pulse-purple {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(121, 40, 202, 0.5);
  }

  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 5px rgba(121, 40, 202, 0);
  }

  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(121, 40, 202, 0);
  }
}

@keyframes pulse-blue {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(0, 104, 214, 0.5);
  }

  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 5px rgba(0, 104, 214, 0);
  }

  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(0, 104, 214, 0);
  }
}

@keyframes pulse-green {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(23, 201, 100, 0.5);
  }

  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 5px rgba(23, 201, 100, 0);
  }

  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(23, 201, 100, 0);
  }
}

.status-dot.thinking {
  background-color: var(--tag-purple-text);
  animation: pulse-purple 2s infinite ease-in-out;
}

.status-dot.welcome {
  background-color: var(--tag-blue-text);
  animation: pulse-blue 2s infinite ease-in-out;
}

.status-dot.online {
  background-color: #17c964;
  animation: pulse-green 2s infinite ease-in-out;
}

.status-dot.away {
  background-color: #f5a623;
}

.wave-emoji {
  display: inline-block;
  animation: wave-animation 2.5s infinite;
  transform-origin: 70% 70%;
  margin-left: 4px;
}

@keyframes wave-animation {
  0% { transform: rotate( 0.0deg) }
  10% { transform: rotate(14.0deg) }
  20% { transform: rotate(-8.0deg) }
  30% { transform: rotate(14.0deg) }
  40% { transform: rotate(-4.0deg) }
  50% { transform: rotate(10.0deg) }
  60% { transform: rotate( 0.0deg) }
  100% { transform: rotate( 0.0deg) }
}

.hero-side p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

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

/* Buttons */
.button {
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.button.primary {
  border: 1px solid var(--black);
  background: var(--black);
  color: var(--white);
}

.button.primary:hover {
  background: #222222;
  border-color: #222222;
}

.button.secondary {
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--text);
}

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

/* Labels */
.label,
.section-label {
  color: var(--soft);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Perfect Grid System (1px Hack) - Absolutely no double borders */
.status-row,
.process-grid {
  display: grid;
  gap: 1px;
  /* Creates inner borders */
  background: var(--line);
  /* Border color */
  border: 1px solid var(--line);
  /* Outer border */
}

.status-row {
  grid-template-columns: repeat(4, 1fr);
  margin-top: 80px;
}

.process-grid {
  grid-template-columns: repeat(4, 1fr);
}

.status-item,
.process-item {
  background: var(--bg);
  /* Fills inner cells */
  transition: background 150ms ease;
}

.status-item {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.status-item strong {
  font-size: 14px;
  font-weight: 500;
}

/* Intro Section */
.intro {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
}

.line-block {
  border-bottom: 1px solid var(--line);
}

.line-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 24px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}

.line-row span {
  color: var(--soft);
  font-size: 14px;
  font-family: monospace;
}

.line-row p {
  max-width: 800px;
  color: var(--muted);
  font-size: clamp(18px, 2.5vw, 24px);
  line-height: 1.5;
  letter-spacing: -0.02em;
}

.line-row.large p {
  color: var(--text);
}

/* Section Header */
.section-header {
  display: grid;
  grid-template-columns: 1fr minmax(240px, auto);
  gap: 48px;
  align-items: end;
  margin-bottom: 40px;
}

.section-header p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

/* Projects */
.project-list {
  border-bottom: 1px solid var(--line);
}

.project-row {
  display: grid;
  grid-template-columns: 64px 140px 1fr auto;
  gap: 32px;
  align-items: center;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  transition: padding 150ms ease;
}

.project-row:hover {
  padding-left: 12px;
}

.project-index {
  color: var(--soft);
  font-size: 14px;
  font-family: monospace;
}

.project-image {
  width: 140px;
  height: 90px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}

.project-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 400ms ease;
}

.project-row:hover .project-image img {
  transform: scale(1.04);
}

.project-content p,
.process-item p {
  max-width: 600px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

/* Colored Tags */
.project-meta {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
}

.tag-amber {
  background: var(--tag-amber-bg);
  color: var(--tag-amber-text);
  border-color: var(--tag-amber-border);
}

.tag-blue {
  background: var(--tag-blue-bg);
  color: var(--tag-blue-text);
  border-color: var(--tag-blue-border);
}

.tag-purple {
  background: var(--tag-purple-bg);
  color: var(--tag-purple-text);
  border-color: var(--tag-purple-border);
}

.tag-teal {
  background: var(--tag-teal-bg);
  color: var(--tag-teal-text);
  border-color: var(--tag-teal-border);
}

.tag-gray {
  background: var(--tag-gray-bg);
  color: var(--tag-gray-text);
  border-color: var(--tag-gray-border);
}

/* Process List specific */
.process-item {
  min-height: 280px;
  padding: 32px;
}

.process-item:hover {
  background: var(--surface);
}

.process-item span {
  display: block;
  margin-bottom: 48px;
  color: var(--soft);
  font-size: 14px;
  font-family: monospace;
}

/* Principles */
.principles {
  margin-top: 40px;
  border-bottom: 1px solid var(--line);
}

.principle-row {
  display: grid;
  grid-template-columns: minmax(280px, 0.4fr) 1fr;
  gap: 32px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}

.principle-row span {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.principle-row p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

/* Notes */
.notes-list {
  border-bottom: 1px solid var(--line);
}

.note-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  transition: padding 150ms ease;
}

.note-row:hover {
  padding-left: 12px;
}

.note-row span {
  font-size: 16px;
  font-weight: 500;
}

.note-row em {
  color: var(--soft);
  font-size: 14px;
  font-style: normal;
}

/* Contact */
.contact-card {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 460px);
  gap: 56px;
  padding: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.contact-card h2 {
  margin-top: 16px;
}

.contact-right p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

/* Footer */
.footer {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--soft);
  font-size: 14px;
  border-top: 1px solid var(--line);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--soft);
  transition: color 200ms ease, opacity 200ms ease;
}

.footer-links a:hover {
  color: var(--text);
  opacity: 0.85;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 16px);
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--text);
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
  z-index: 100;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms ease, transform 500ms ease;
}

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

/* Responsive Breakpoints */
@media (max-width: 920px) {
  .site-shell {
    width: min(100% - 32px, var(--container));
  }

  .header {
    border-bottom: 1px solid transparent;
  }

  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    height: var(--header-height);
    width: min(100% - 32px, var(--container));
    margin: 0 auto;
  }

  .header.is-scrolled {
    border-bottom: 1px solid var(--line);
  }

  .header-cta {
    display: none;
  }

  .menu-button {
    display: grid;
  }

  /* Solid Mobile Menu (Opaque per request) */
  .nav {
    position: fixed;
    top: calc(var(--header-height) + 16px);
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--bg);
    /* Solid white, no transparency */
    z-index: 90;
  }

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

  .nav a {
    padding: 14px;
    border-radius: var(--radius-sm);
    text-align: left;
  }

  .hero-grid,
  .section-header,
  .intro,
  .contact-card {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* 1px Gap Grid Re-flow for Tablet */
  .status-row,
  .process-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-row {
    grid-template-columns: 48px 100px 1fr;
    gap: 20px;
  }

  .project-image {
    width: 100px;
    height: 64px;
  }

  .project-meta {
    grid-column: 3;
    justify-content: flex-start;
  }

  .section {
    padding: 80px 0;
  }
}

@media (max-width: 620px) {
  .site-shell,
  .header-inner {
    width: min(100% - 24px, var(--container));
  }

  .hero {
    padding-top: 60px;
  }

  .profile-image {
    width: 80px;
    height: 80px;
  }

  /* 1px Gap Grid Re-flow for Mobile */
  .status-row,
  .process-grid {
    grid-template-columns: 1fr;
  }

  .line-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

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

  .project-index {
    display: none;
  }

  .project-image {
    width: 100%;
    height: 180px;
  }

  .project-meta {
    grid-column: auto;
  }

  .principle-row,
  .note-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .contact-card {
    padding: 32px 24px;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 16px;
    padding: 32px 0;
  }
}

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

/* Story Modal */
.story-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms ease, visibility 300ms ease;
}

.story-modal.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.story-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.story-modal-content {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: 100dvh;
  max-height: 850px;
  background: #000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 600px) {
  .story-modal-content {
    height: 90vh;
    border-radius: 12px;
  }
}

.story-modal.is-open .story-modal-content {
  transform: scale(1);
}

.story-progress {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  height: 2px;
  display: flex;
  gap: 4px;
  z-index: 10;
}

.story-progress-bar {
  flex: 1;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
}

.story-progress-fill {
  width: 0%;
  height: 100%;
  background: #fff;
}

.story-header {
  position: absolute;
  top: 24px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.story-author {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.story-author img {
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.story-author-name {
  font-size: 13px;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.story-time {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.story-close {
  color: #fff;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
  padding: 8px;
  margin: -8px;
  transition: opacity 150ms ease;
}

.story-close:hover {
  opacity: 0.7;
}

.story-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}