﻿:root {
  color-scheme: light;
  --bg: #f8fbff;
  --surface: rgba(255, 255, 255, 0.96);
  --panel: rgba(236, 248, 255, 0.96);
  --text: #071226;
  --muted: #475569;
  --border: rgba(59, 130, 246, 0.2);
  --accent: #3b82f6;
  --accent-strong: #2563eb;
  --accent-soft: #93c5fd;
  --shadow: 0 28px 90px rgba(15, 34, 67, 0.08);
  --nav-bg: rgba(255, 255, 255, 0.9);
  --footer-bg: rgba(255, 255, 255, 0.92);
}

body.dark {
  color-scheme: dark;
  --bg: #04112a;
  --surface: rgba(7, 18, 41, 0.92);
  --panel: rgba(10, 21, 44, 0.88);
  --text: #e9f2ff;
  --muted: #acc4e3;
  --border: rgba(79, 140, 247, 0.24);
  --accent: #4f8cf7;
  --accent-strong: #7fb4ff;
  --accent-soft: #60a5fa;
  --shadow: 0 36px 110px rgba(0, 0, 0, 0.34);
  --nav-bg: rgba(6, 15, 35, 0.94);
  --footer-bg: rgba(6, 15, 35, 0.95);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(79, 140, 247, 0.08), transparent 36%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

body:not(.touch) {
  cursor: none;
}

img,
iframe {
  max-width: 100%;
  display: block;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  position: relative;
  padding-top: 96px;
  padding-bottom: 96px;
}

.top-header {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: min(98%, 1120px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(59, 130, 246, 0.18);
  box-shadow: 0 26px 70px rgba(15, 34, 67, 0.08);
  backdrop-filter: blur(16px);
}

body.dark .top-header {
  background: rgba(7, 18, 41, 0.92);
  border-color: rgba(79, 140, 247, 0.22);
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 800;
}

.brand-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0.45rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.18);
}

body.dark .contact-pill {
  background: rgba(79, 140, 247, 0.14);
}

.contact-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.hidden-contact {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.9rem;
  width: 210px;
  padding: 1rem;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.hidden-contact.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.hidden-contact a {
  display: block;
  color: var(--text);
  text-decoration: none;
  margin: 0.7rem 0;
  font-size: 0.95rem;
}

.hidden-contact a:first-child {
  margin-top: 0;
}

.page-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 2.2rem 0;
}

.section-head {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.section-label {
  text-transform: uppercase;
  letter-spacing: 0.33em;
  font-size: 0.8rem;
  color: var(--accent-strong);
}

.hero-section {
  display: grid;
  gap: 2rem;
}

.hero-copy {
  max-width: 720px;
  display: grid;
  gap: 1.4rem;
}

.eyebrow {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-strong);
  font-weight: 700;
}

.hero-section h1 {
  margin: 0;
  font-size: clamp(3rem, 5vw, 5.2rem);
  line-height: 0.92;
}

.hero-text {
  max-width: 640px;
  font-size: 1.05rem;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.95rem 1.5rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent);
  color: #fff;
}

.button-secondary {
  background: rgba(59, 130, 246, 0.11);
  color: var(--accent-strong);
  border-color: rgba(59, 130, 246, 0.18);
}

.hero-aside {
  display: grid;
  gap: 1.5rem;
}

.hero-card,
.about-card,
.project-card,
.preset-card,
.contact-panel,
.terminal-panel {
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 1.6rem;
}

.card-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.marquee-wrap {
  overflow: hidden;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.16);
}

.marquee-track {
  display: inline-flex;
  animation: marquee 18s linear infinite;
  gap: 2rem;
}

.marquee-track span {
  white-space: nowrap;
  font-size: 0.95rem;
  color: var(--accent-strong);
  padding: 0.95rem 0;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.section-split,
.about-grid,
.works-grid,
.card-grid,
.preset-grid,
.timeline {
  display: grid;
  gap: 1.25rem;
}

.section-split {
  grid-template-columns: 1fr 1fr;
}

.about-grid,
.works-grid,
.card-grid,
.preset-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.timeline-item {
  display: grid;
  gap: 0.5rem;
  padding: 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
}

.timeline-time {
  font-weight: 700;
  color: var(--accent-strong);
}

.project-card,
.works-card,
.about-card,
.preset-card {
  padding: 1.45rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover,
.works-card:hover,
.about-card:hover,
.preset-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 42px 110px rgba(15, 34, 67, 0.16);
}

.preset-card iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}

.preset-card h3 {
  margin: 0 0 0.6rem;
}

.contact-panel {
  padding: 1.75rem;
}

.contact-list {
  display: grid;
  gap: 0.85rem;
}

.contact-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.95rem 1rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.16);
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}

.contact-list a:hover {
  transform: translateY(-1px);
}

.terminal-panel {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem;
}

.terminal-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--accent-strong);
}

.terminal-content {
  margin: 0;
  white-space: pre-wrap;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  line-height: 1.7;
}

.site-footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.35rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--footer-bg);
  border-top: 1px solid var(--border);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.social-links a {
  color: var(--accent-strong);
  text-decoration: none;
}

.bottom-nav {
  position: fixed;
  inset: auto 0 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: min(98%, 1080px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 999px;
  background: var(--nav-bg);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.nav-links {
  display: grid;
  grid-auto-flow: column;
  gap: 0.85rem;
  overflow-x: auto;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  white-space: nowrap;
  padding: 0.6rem 0.95rem;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: background 0.2s ease, color 0.2s ease;
}

body.dark .nav-links a {
  background: rgba(255, 255, 255, 0.06);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: rgba(59, 130, 246, 0.14);
  color: var(--accent-strong);
}

.theme-toggle {
  padding: 0.8rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

#customCursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 26px;
  height: 26px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1);
  transition: width 0.18s ease, height 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  z-index: 60;
}

#customCursor.hovered {
  width: 38px;
  height: 38px;
  border-color: var(--accent-strong);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

.fade-out {
  opacity: 0;
  transition: opacity 0.22s ease;
}

@media (max-width: 900px) {
  .page-shell {
    padding-top: 118px;
  }

  .top-header,
  .bottom-nav,
  .site-footer {
    width: min(96%, 100%);
  }

  .top-header {
    flex-wrap: wrap;
  }

  .bottom-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-links {
    grid-auto-flow: row;
  }
}

@media (max-width: 640px) {
  .top-header {
    padding: 0.8rem 1rem;
  }

  .page-shell {
    padding-top: 132px;
  }

  .section-split,
  .about-grid,
  .works-grid,
  .card-grid,
  .preset-grid {
    grid-template-columns: 1fr;
  }
}
