/* Shared layout and controls for both palettes. */
:root {
  --theme-surface: #161616;
  --theme-hover: #252525;
  --theme-focus: #ddd;
  --theme-radius: 10px;
  --theme-duration: 600ms;
}
header { gap: 20px; }
.error-header { display: flex; align-items: center; justify-content: space-between; }
header nav { margin-left: auto; }
.theme-picker { width: 44px; height: 44px; flex: 0 0 44px; }
.theme-trigger {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: var(--text);
  background: var(--theme-surface);
  transition: background-color .3s ease, border-color .3s ease;
}
.theme-trigger:hover { background: var(--theme-hover); }
.theme-trigger:focus-visible { outline: 2px solid var(--theme-focus); outline-offset: 3px; }
.theme-icon {
  position: absolute;
  width: 20px;
  height: 20px;
  transition: opacity .4s ease, transform .4s cubic-bezier(.2, 0, 0, 1), filter .4s ease;
}
.theme-icon-claude { object-fit: contain; }
.theme-icon-dark, [data-theme="claude"] .theme-icon-claude { opacity: 0; transform: scale(.25); filter: blur(4px); }
[data-theme="claude"] .theme-icon-dark { opacity: 1; transform: scale(1); filter: blur(0); }

/* Compact rhythm, natural heading width, and unobtrusive scroll areas. */
.hero { gap: 16px; }
.hero-heading { gap: 20px; margin-block: 16px; }
.hero h1 { width: auto; font-size: clamp(56px, 9vw, 128px); line-height: 1.05; padding: 0; }
.hero-location { margin-top: 12px; }
.tech-stack, .socials { margin-top: 20px; }
.section-title { font-size: clamp(40px, 5vw, 72px); line-height: 1.1; }
.slide :is(h1, h2)[tabindex="-1"]:focus { outline: none; }
.achievement-grid { margin-top: 20px; }
.project-group { gap: 16px; margin-top: 20px; }
.project-content { bottom: 12px; overflow-y: auto; overscroll-behavior: contain; }
html, body, .screen-body, .project-content, .projects-body { scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar, .screen-body::-webkit-scrollbar, .project-content::-webkit-scrollbar, .projects-body::-webkit-scrollbar { display: none; }
/* Reveal the incoming palette from the top right with a diagonal edge. */
::view-transition-old(root) { animation: none; }
::view-transition-new(root) {
  animation: theme-diagonal var(--theme-duration) cubic-bezier(.22, 1, .36, 1) both;
  mix-blend-mode: normal;
}
@keyframes theme-diagonal {
  from { clip-path: polygon(100% 0, 100% 0, 100% 0); }
  to { clip-path: polygon(-100% 0, 100% 0, 100% 200%); }
}
html.theme-changing :is(body, header, .btn, .tech, .discord-card, .discord-banner, .achievement-card, .achievement-row, .bullet, .project-card, .place, .stack-tag, .theme-trigger) {
  transition-property: background-color, color, border-color, box-shadow;
  transition-duration: var(--theme-duration);
}
html[data-theme="claude"] {
  color-scheme: light;
  --bg: #FAF9F6;
  --surface: #FFFFFF;
  --surface-muted: #F2F0EA;
  --surface-hover: #ECE9E2;
  --text: #25231F;
  --text-secondary: #66635D;
  --text-muted: #817C73;
  --border: #E5E1D9;
  --accent: #A44940;
  --accent-hover: #84382F;
  --accent-soft: #F2DEDA;
  --focus: #9C5B43;
  --success: #3E7657;
  --warning: #A66B29;
  --danger: #B84B43;
  --panel: var(--surface);
  --muted: var(--text-secondary);
  --font-sans: system-ui, "Segoe UI", sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --space-1: 4px; --space-2: 8px; --space-3: 12px;
  --space-4: 16px; --space-5: 24px; --space-6: 32px;
  --space-7: 40px; --space-8: 48px; --space-9: 64px;
  --space-10: 80px; --space-11: 96px; --space-12: 128px;
  --container: 1200px;
  --radius-xs: 6px; --radius-sm: 10px; --radius-md: 14px; --radius-lg: 20px;
  --theme-surface: var(--surface);
  --theme-hover: var(--surface-muted);
  --theme-focus: var(--focus);
  --theme-radius: var(--radius-sm);
  --theme-shadow: 0 2px 12px rgb(30 25 20 / .05);
  background: var(--bg);
}
html[data-theme="claude"] body { background: var(--bg); }
html[data-theme="claude"] ::selection { background: var(--accent-soft); color: var(--text); }
html[data-theme="claude"] header {
  background: var(--bg);
}
html[data-theme="claude"] :is(.logo, .error-brand, .role, .achievement-row strong, .bullet strong, .project-label strong) { color: var(--text); }
html[data-theme="claude"] nav button { color: var(--text-secondary); }
html[data-theme="claude"] nav button:is(:hover, .active) { color: var(--text); }
html[data-theme="claude"] nav button.active { color: var(--accent-hover); }
html[data-theme="claude"] :is(button, a, .project-card, .tech, .discord-badges [data-tooltip]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
html[data-theme="claude"] .prod-entry > button:focus-visible { outline-offset: -3px; }
html[data-theme="claude"] :is(.hero h1, .section-title, .footer-name) { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
html[data-theme="claude"] .hero h1 { color: #000; }
html[data-theme="claude"] :is(.section-title, .footer-name, .card-header, .group-title) { color: var(--accent-hover); }
html[data-theme="claude"] .section-title span { color: var(--accent); }
html[data-theme="claude"] :is(.eyebrow, .subtitle, .scroll-hint, .section-description,
  .achievement-row, .achievement-row small, .bullet, .prod-project p, .prod-chevron,
  .project-content p, .group-description, .group-number, .project-label span,
  .copyright, .footer-links a, .footer-links button, .discord-banner, .discord-user,
  .discord-custom-status, .discord-activity, .discord-note, .discord-badges span) { color: var(--text-secondary); }
html[data-theme="claude"] .diamond { background: var(--accent); }
html[data-theme="claude"] .tech { background: var(--surface-muted); }
html[data-theme="claude"] .tech:hover { background: var(--surface-hover); }
html[data-theme="claude"] :is(.tech::after, .discord-badges [data-tooltip]::after, .toast) {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--theme-shadow);
}
html[data-theme="claude"] .btn {
  background: var(--surface-muted);
  color: var(--text);
}
html[data-theme="claude"] .btn:hover { background: var(--surface-hover); }
html[data-theme="claude"] .btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
html[data-theme="claude"] .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
html[data-theme="claude"] .btn.primary .social-icon { filter: brightness(0) invert(1); }
/* Preserve full-color logos. Only known monochrome silhouettes are recolored. */
html[data-theme="claude"] :is(.social-icon[src$="telegram.svg"], .discord-logo) { filter: brightness(0); }
html[data-theme="claude"] .discord-card { background: var(--surface); }
html[data-theme="claude"] .discord-card:hover { border-color: var(--accent); }
html[data-theme="claude"] .discord-banner { background: var(--accent-soft); color: var(--accent-hover); }
html[data-theme="claude"] #discordAvatar { background: var(--surface-muted); }
html[data-theme="claude"] :is(.avatar, .presence) { border-color: var(--surface); }
html[data-theme="claude"] .presence::after { background: var(--surface); }
html[data-theme="claude"] .presence.online { background: var(--success); }
html[data-theme="claude"] .presence.idle { background: var(--warning); }
html[data-theme="claude"] .presence.dnd { background: var(--danger); }
html[data-theme="claude"] :is(.presence.offline, .presence.unknown) { background: var(--text-secondary); }
html[data-theme="claude"] .discord-guild-tag { background: var(--surface-muted); }
html[data-theme="claude"] .achievement-card { background: var(--surface); }
html[data-theme="claude"] :is(.prod-entry.active, .prod-entry.winner, .achievement-row.winner, .achievement-row.bronze, .bullet.highlight) {
  background: var(--accent-soft);
  color: var(--text);
}
html[data-theme="claude"] :is(.place, .winner .place, .bronze .place, .project-tech-tag, .stack-tag) {
  background: var(--surface-muted);
  color: var(--text-secondary);
}
html[data-theme="claude"] :is(.winner .place, .bronze .place) { background: var(--accent-soft); color: var(--text); }
html[data-theme="claude"] :is(.bullet.highlight strong, .prize-caption) { color: var(--text); }
html[data-theme="claude"] .project-card {
  --project-tint: #e3dfd6;
  background: color-mix(in srgb, var(--project-tint) 35%, white);
  border: 0;
  box-shadow: none;
}
html[data-theme="claude"] .project-card[data-tone="yellow"] { --project-tint: #e9d791; }
html[data-theme="claude"] .project-card[data-tone="purple"] { --project-tint: #ceb9e2; }
html[data-theme="claude"] .project-card[data-tone="blue"]:not([data-project="Q.AI"]) { --project-tint: #b1d3e6; }
html[data-theme="claude"] .project-card[data-tone="pink"] { --project-tint: #e5b9cd; }
html[data-theme="claude"] .project-card[data-tone="green"] { --project-tint: #b4d9bf; }
html[data-theme="claude"] .project-card[data-tone="teal"] { --project-tint: color-mix(in srgb, var(--project-base) 22%, white); }
html[data-theme="claude"] .project-card:hover { background: color-mix(in srgb, var(--project-tint) 45%, white); }
html[data-theme="claude"] .project-card.active { background: color-mix(in srgb, var(--project-tint) 55%, white); }
html[data-theme="claude"] .project-card.active:hover { background: color-mix(in srgb, var(--project-tint) 65%, white); }
html[data-theme="claude"] .project-link { color: var(--focus); }
html[data-theme="claude"] .project-link:hover { color: var(--accent-hover); text-decoration: underline; }
html[data-theme="claude"] .project-card[data-tone="teal"] .project-link { color: var(--accent-hover); }
html[data-theme="claude"] .footer-links a:hover { color: var(--text); text-decoration: underline; }
html[data-theme="claude"] .page-dot span { border-color: var(--text-secondary); }
html[data-theme="claude"] .page-dot.active span { background: var(--accent-hover); border-color: var(--accent-hover); }
html[data-theme="claude"] .error-scene h1 { color: var(--border); }
html[data-theme="claude"] .error-art { filter: brightness(0); }
html[data-theme="claude"] .home-link { background: var(--accent); color: #fff; }
html[data-theme="claude"] .home-link:hover { background: var(--accent-hover); }

@media (max-width: 1000px) { .project-group { gap: 10px; } }
@media (max-width: 600px) {
  header { gap: 8px; }
  header nav { gap: 12px; }
  .hero-heading { gap: 12px; margin-block: 12px; }
  .hero h1 { font-size: clamp(56px, 14vw, 80px); }
  .hero { gap: 16px; }
  .tech-stack, .socials { margin-top: 16px; }
  .achievement-grid { margin-top: 16px; }
  .project-group { gap: 8px; margin-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}
