/* ─── Nav ──────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 0;
  transition: all 0.4s var(--ease-out);
}

.nav[data-scrolled="true"] {
  padding: 0.6rem 0;
  background: oklch(from var(--bg) l c h / 0.85);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
}

.nav-logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: white;
  border-radius: 10px;
  font-weight: 800;
  font-size: 1rem;
}

.nav-links {
  display: flex;
  gap: 2px;
}

.nav-link {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--body);
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--text);
  background: oklch(from var(--text) l c h / 0.04);
}

.nav-link.active {
  color: var(--text);
  font-weight: 500;
}

.nav-link-dot {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
}

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

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: all 0.3s var(--ease-out);
}

.nav[data-menu-open="true"] .nav-hamburger span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav[data-menu-open="true"] .nav-hamburger span:nth-child(2) { opacity: 0; }
.nav[data-menu-open="true"] .nav-hamburger span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 1rem var(--page-pad) 2rem;
  gap: 4px;
}

.nav[data-menu-open="true"] .mobile-menu { display: flex; }

.mobile-menu-link {
  display: block;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  animation: menuSlideIn 0.4s var(--ease-out) both;
}

.mobile-menu-link.active { color: var(--accent); }

@keyframes menuSlideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
}

/* ─── Buttons ─────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--accent);
  color: white;
  font-family: var(--body);
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px oklch(from var(--accent) l c h / 0.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: transparent;
  color: var(--text);
  font-family: var(--body);
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  text-decoration: none;
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  background: oklch(from var(--text) l c h / 0.03);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--body);
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
  transition: gap 0.2s var(--ease-out);
}

.link-arrow:hover { gap: 10px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--body);
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  padding: 0;
  transition: color 0.2s, gap 0.2s;
}

.back-link:hover { color: var(--text); gap: 12px; }

/* ─── Hero ─────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 80px;
}

.hero-container {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 3rem;
  min-height: calc(100vh - 160px);
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.hero-label-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-name { margin-bottom: 1.5rem; }

.hero-ctas {
  display: flex;
  gap: 12px;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-canvas {
  border-radius: var(--radius-lg);
  filter: blur(0.5px);
}

.hero-scroll-indicator {
  display: flex;
  justify-content: center;
  padding-bottom: 2rem;
}

.scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--text-secondary), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

@media (max-width: 900px) {
  .hero-container { grid-template-columns: 1fr; text-align: center; }
  .hero-ctas { justify-content: center; }
  .hero-visual { display: none; }
  .hero-subtitle { margin-left: auto; margin-right: auto; }
}

/* ─── Featured Projects ───────────────────── */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 900px) { .featured-grid { grid-template-columns: 1fr; } }

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.35s var(--ease-out);
  text-align: left;
  width: 100%;
  font-family: inherit;
  color: inherit;
  position: relative;
}

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px oklch(from var(--text) l c h / 0.06);
}

.project-card-image {
  aspect-ratio: 16/10;
  overflow: hidden;
}

.project-card-content { padding: 1.25rem; }

.project-card-arrow {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(from var(--bg) l c h / 0.8);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  color: var(--text-secondary);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: all 0.3s var(--ease-out);
}

.project-card:hover .project-card-arrow {
  opacity: 1;
  transform: translate(0, 0);
}

/* ─── Project placeholder ─────────────────── */
.project-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, oklch(from var(--ph-color) l c h / 0.08), oklch(from var(--ph-color) l c h / 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.placeholder-svg {
  width: 100%;
  height: 100%;
}

.placeholder-label {
  position: absolute;
  bottom: 12px;
  right: 12px;
  font-size: 0.65rem;
  color: var(--text-secondary);
  opacity: 0.6;
}

/* ─── Status badges ───────────────────────── */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 20px;
  border: 1px solid;
}

.status-badge[data-status="shipped"] {
  color: var(--sage);
  border-color: oklch(from var(--sage) l c h / 0.3);
  background: oklch(from var(--sage) l c h / 0.08);
}

.status-badge[data-status="in-development"] {
  color: var(--accent);
  border-color: oklch(from var(--accent) l c h / 0.3);
  background: oklch(from var(--accent) l c h / 0.08);
}

.status-badge[data-status="active"] {
  color: oklch(0.55 0.12 250);
  border-color: oklch(0.55 0.12 250 / 0.3);
  background: oklch(0.55 0.12 250 / 0.08);
}

/* ─── Philosophy ──────────────────────────── */
.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.philosophy-card {
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.3s;
}

.philosophy-card:hover { border-color: var(--border-hover); }

@media (max-width: 768px) { .philosophy-grid { grid-template-columns: 1fr; } }

/* ─── Now section ─────────────────────────── */
.now-card {
  padding: clamp(2rem, 4vw, 3.5rem);
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

/* ─── Work page ───────────────────────────── */
.filter-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 18px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-family: var(--body);
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all 0.2s;
}

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

.filter-btn:not(.active):hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.work-card-image {
  aspect-ratio: 16/10;
  overflow: hidden;
}

.work-card-body { padding: 1.25rem; }

/* ─── Project Detail ──────────────────────── */
.detail-header {
  padding: 2rem 0 3rem;
}

.detail-hero-image {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  aspect-ratio: 2.2/1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, oklch(from var(--card-accent) l c h / 0.08), oklch(from var(--card-accent) l c h / 0.18));
  position: relative;
}

.detail-hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 4rem;
}

@media (max-width: 768px) { .detail-grid { grid-template-columns: 1fr; gap: 2rem; } }

.sidebar-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-section:last-child { border-bottom: none; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  color: var(--accent);
  font-weight: 500;
  transition: gap 0.2s;
}

.sidebar-link:hover { gap: 10px; }

.tech-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tech-tag {
  display: inline-block;
  padding: 4px 12px;
  background: oklch(from var(--text) l c h / 0.05);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.feature-bullet {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 8px;
}

.next-project-section {
  padding: clamp(3rem, 6vh, 5rem) 0;
  border-top: 1px solid var(--border);
}

.next-project-card {
  display: block;
  width: 100%;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: all 0.3s var(--ease-out);
}

.next-project-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ─── Writing page ────────────────────────── */
.featured-article {
  padding: clamp(2rem, 4vw, 3rem);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
}

.featured-article-badge {
  margin-bottom: 1rem;
}

.writing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.article-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.3s var(--ease-out);
  cursor: pointer;
}

.article-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.youtube-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
}

.youtube-placeholder {
  aspect-ratio: 16/9;
  background: oklch(from var(--text) l c h / 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.youtube-info { padding: 2rem 2rem 2rem 0; display: flex; flex-direction: column; justify-content: center; }

@media (max-width: 768px) {
  .youtube-card { grid-template-columns: 1fr; }
  .youtube-info { padding: 0 1.5rem 1.5rem; }
}

.speaking-list { display: flex; flex-direction: column; gap: 0; }

.speaking-item {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.speaking-year { flex-shrink: 0; width: 60px; color: var(--text-secondary); }
.speaking-details { flex: 1; min-width: 200px; }

.podcast-card {
  padding: clamp(2rem, 4vw, 3rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

/* ─── Foundation page ─────────────────────── */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.pillar-card {
  padding: 2rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.3s;
}

.pillar-card:hover { border-color: var(--sage); }

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

.structure-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.structure-card {
  padding: 2rem 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  text-align: center;
}

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

/* ─── About page ──────────────────────────── */
.about-header {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  align-items: center;
  padding-top: 5rem;
}

@media (max-width: 768px) {
  .about-header { grid-template-columns: 1fr; justify-items: center; text-align: center; }
}

.about-photo {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.about-photo-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, oklch(from var(--accent) l c h / 0.1), oklch(from var(--sage) l c h / 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-story { max-width: 700px; }

.about-paragraph {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.timeline { display: flex; flex-direction: column; gap: 0; }

.timeline-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.timeline-period { color: var(--text-secondary); padding-top: 2px; }

@media (max-width: 600px) {
  .timeline-item { grid-template-columns: 1fr; gap: 0.5rem; }
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.community-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.3s;
}

.community-card:hover { border-color: var(--border-hover); }

@media (max-width: 600px) { .community-grid { grid-template-columns: 1fr; } }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.skill-group {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

@media (max-width: 600px) { .skills-grid { grid-template-columns: 1fr; } }

.contact-links { display: flex; flex-direction: column; gap: 0; }

.contact-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  transition: all 0.2s;
  font-weight: 500;
}

.contact-link:hover { color: var(--accent); padding-left: 8px; }

/* ─── Footer ──────────────────────────────── */
.footer {
  padding: clamp(3rem, 6vh, 5rem) 0 2rem;
  border-top: 1px solid var(--border);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 3rem;
  flex-wrap: wrap;
}

.footer-links { display: flex; gap: 4rem; }

.footer-col { display: flex; flex-direction: column; gap: 6px; }

.footer-link {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--body);
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: left;
  padding: 0;
  transition: color 0.2s;
  text-decoration: none;
  display: block;
}

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

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ─── Page transition ─────────────────────── */
.page-transition {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.page-transition[data-visible="true"] {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Tweaks Panel ────────────────────────── */
.tweaks-panel {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 16px 48px oklch(from var(--text) l c h / 0.1);
  backdrop-filter: blur(20px);
  font-family: var(--body);
}

.tweaks-title {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tweak-row {
  margin-bottom: 1rem;
}

.tweak-label {
  display: block;
  font-size: 0.75rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.tweak-options {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.tweak-option {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: none;
  cursor: pointer;
  font-family: var(--body);
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.tweak-option.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.tweak-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.tweak-swatch.active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text);
}
