:root {
  color-scheme: light dark;
  --bg: #f7f7f4;
  --bg-rgb: 247, 247, 244;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --surface-muted: rgba(18, 18, 20, 0.035);
  --text: #090a0c;
  --muted: #686b73;
  --subtle: #9a9da5;
  --line: rgba(9, 10, 12, 0.105);
  --line-strong: rgba(9, 10, 12, 0.18);
  --accent: #0f6fff;
  --accent-rgb: 15, 111, 255;
  --shadow-soft: 0 20px 70px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 1px 1px rgba(0, 0, 0, 0.035), 0 18px 48px rgba(0, 0, 0, 0.055);
  --radius: 8px;
  --max: 1160px;
  --header-height: 68px;
}

[data-theme="dark"] {
  --bg: #08090b;
  --bg-rgb: 8, 9, 11;
  --surface: rgba(20, 21, 25, 0.72);
  --surface-strong: rgba(28, 29, 34, 0.86);
  --surface-muted: rgba(255, 255, 255, 0.045);
  --text: #f7f8fb;
  --muted: #a8adb7;
  --subtle: #747a86;
  --line: rgba(255, 255, 255, 0.115);
  --line-strong: rgba(255, 255, 255, 0.2);
  --accent: #8ab4ff;
  --accent-rgb: 138, 180, 255;
  --shadow-soft: 0 24px 90px rgba(0, 0, 0, 0.44);
  --shadow-card: 0 1px 1px rgba(255, 255, 255, 0.035), 0 24px 70px rgba(0, 0, 0, 0.32);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #08090b;
    --bg-rgb: 8, 9, 11;
    --surface: rgba(20, 21, 25, 0.72);
    --surface-strong: rgba(28, 29, 34, 0.86);
    --surface-muted: rgba(255, 255, 255, 0.045);
    --text: #f7f8fb;
    --muted: #a8adb7;
    --subtle: #747a86;
    --line: rgba(255, 255, 255, 0.115);
    --line-strong: rgba(255, 255, 255, 0.2);
    --accent: #8ab4ff;
    --accent-rgb: 138, 180, 255;
    --shadow-soft: 0 24px 90px rgba(0, 0, 0, 0.44);
    --shadow-card: 0 1px 1px rgba(255, 255, 255, 0.035), 0 24px 70px rgba(0, 0, 0, 0.32);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 50% -18%, rgba(var(--accent-rgb), 0.12), transparent 34rem),
    linear-gradient(180deg, rgba(var(--bg-rgb), 0.98), var(--bg));
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", sans-serif;
  line-height: 1.75;
  letter-spacing: 0;
  text-rendering: geometricPrecision;
  transition: background-color 220ms ease, color 220ms ease;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(127, 133, 144, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 133, 144, 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 72%);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background: linear-gradient(180deg, transparent, rgba(var(--bg-rgb), 0.72) 46%, var(--bg));
}

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

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

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

.site-header {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 24px), var(--max));
  height: var(--header-height);
  margin: 12px auto 0;
  padding: 0 8px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(var(--bg-rgb), 0.72);
  backdrop-filter: blur(22px) saturate(1.2);
  box-shadow: 0 10px 38px rgba(0, 0, 0, 0.055);
}

.brand,
.nav-links,
.theme-toggle,
.button,
.contact-links a {
  min-height: 44px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-size: 0.72rem;
  font-weight: 800;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.nav-links a {
  padding: 8px 11px;
  border-radius: 999px;
  transition: color 180ms ease, background-color 180ms ease;
}

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

.theme-toggle {
  display: grid;
  width: 48px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.toggle-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.toggle-icon::after {
  position: absolute;
  top: -5px;
  left: 7px;
  width: 12px;
  height: 20px;
  border-radius: 999px;
  background: rgba(var(--bg-rgb), 0.9);
  content: "";
}

.section {
  width: min(calc(100% - 36px), var(--max));
  margin: 0 auto;
  padding: 92px 0;
}

.hero {
  display: grid;
  min-height: calc(100svh - var(--header-height) - 24px);
  align-items: center;
  gap: 44px;
  padding-top: 52px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  line-height: 1.2;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.02;
  letter-spacing: 0;
}

h1 {
  max-width: 850px;
  font-size: clamp(3.7rem, 18vw, 10rem);
  font-weight: 820;
}

h2 {
  max-width: 820px;
  font-size: clamp(2.1rem, 7.4vw, 5.15rem);
  font-weight: 800;
}

h3 {
  font-size: 1.2rem;
  font-weight: 760;
}

.hero-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 3.6vw, 1.2rem);
  font-weight: 700;
  line-height: 1.2;
}

.hero-roles span::before {
  margin-right: 8px;
  color: var(--subtle);
  content: "/";
}

.hero-lead {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--text);
  font-size: clamp(1.05rem, 3.5vw, 1.36rem);
  font-weight: 650;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 750;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.button-secondary {
  background: rgba(var(--bg-rgb), 0.54);
  color: var(--text);
}

.hero-visual {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.hero-visual::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  content: "";
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 32%, rgba(0, 0, 0, 0.12));
  mix-blend-mode: soft-light;
}

.hero-visual img {
  width: 100%;
  aspect-ratio: 1.2 / 1;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.05);
}

.visual-glass {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  display: inline-flex;
  max-width: calc(100% - 28px);
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(7, 8, 10, 0.54);
  color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #4dff9f;
  box-shadow: 0 0 16px rgba(77, 255, 159, 0.7);
}

.section-heading {
  margin-bottom: 34px;
}

.split-heading {
  display: grid;
  gap: 18px;
}

.split-heading > p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.about-grid {
  display: grid;
  gap: 30px;
}

.about-text {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 3.4vw, 1.34rem);
  font-weight: 500;
  line-height: 2;
}

.about-stack {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.about-stack span {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(var(--bg-rgb), 0.7);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
}

.about-stack span::after {
  color: var(--subtle);
  content: "↗";
}

.skill-grid,
.project-grid {
  display: grid;
  gap: 12px;
}

.skill-card,
.project-card,
.timeline-item,
.contact-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(16px) saturate(1.08);
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.skill-card:hover,
.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  background: var(--surface-strong);
  box-shadow: var(--shadow-card);
}

.skill-card {
  display: flex;
  min-height: 112px;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border-radius: var(--radius);
}

.skill-card span,
.project-topline,
.project-meta span,
.timeline-item time {
  color: var(--subtle);
  font-size: 0.72rem;
  font-weight: 760;
  line-height: 1.2;
  text-transform: uppercase;
}

.skill-card strong {
  font-size: clamp(1.08rem, 5vw, 1.48rem);
  line-height: 1.05;
}

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

.project-card {
  display: flex;
  min-height: 292px;
  flex-direction: column;
  justify-content: space-between;
  gap: 26px;
  padding: 22px;
  border-radius: var(--radius);
}

.project-card.featured {
  background:
    linear-gradient(145deg, rgba(var(--accent-rgb), 0.10), transparent 48%),
    var(--surface);
}

.project-topline {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.project-card p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.project-meta span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(var(--bg-rgb), 0.54);
  color: var(--muted);
}

.project-card a {
  display: inline-flex;
  width: fit-content;
  min-height: 42px;
  align-items: center;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 800;
}

.project-card a::after {
  margin-left: 8px;
  content: "->";
  transition: transform 180ms ease;
}

.project-card a:hover::after {
  transform: translateX(4px);
}

.timeline-list {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: var(--radius);
}

.timeline-item p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.contact {
  padding-bottom: 76px;
}

.contact-panel {
  padding: clamp(28px, 8vw, 78px);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.contact-panel p:not(.eyebrow) {
  max-width: 650px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--text);
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 800;
  transition: transform 180ms ease, opacity 180ms ease;
}

.contact-links a:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.site-footer {
  display: flex;
  width: min(calc(100% - 36px), var(--max));
  margin: 0 auto;
  padding: 28px 0 40px;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 640ms ease, transform 640ms ease;
}

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

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 720px) {
  .nav-links {
    display: inline-flex;
  }

  .section {
    padding: 118px 0;
  }

  .hero {
    grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.78fr);
    padding-top: 56px;
  }

  .hero-visual img {
    aspect-ratio: 0.9 / 1;
  }

  .split-heading {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
    align-items: end;
  }

  .about-grid {
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
  }

  .skill-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-card.featured {
    grid-row: span 2;
    min-height: 596px;
  }

  .timeline-item {
    grid-template-columns: 160px 1fr;
    padding: 24px;
  }
}

@media (min-width: 1020px) {
  .section,
  .site-header,
  .site-footer {
    width: min(calc(100% - 72px), var(--max));
  }

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

@media (max-width: 520px) {
  .site-header {
    top: 8px;
    width: calc(100% - 20px);
    margin-top: 8px;
  }

  .brand span:last-child {
    max-width: 136px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .section {
    width: min(calc(100% - 28px), var(--max));
    padding: 74px 0;
  }

  .hero {
    gap: 34px;
    padding-top: 36px;
  }

  h1 {
    font-size: clamp(3.2rem, 18vw, 4.9rem);
  }

  h2 {
    font-size: clamp(2.1rem, 11vw, 3.45rem);
  }

  .hero-roles {
    display: grid;
    gap: 7px;
  }

  .hero-roles span::before {
    content: none;
  }

  .hero-actions .button {
    flex: 1 1 100%;
  }

  .hero-visual img {
    aspect-ratio: 1 / 0.88;
  }

  .visual-glass {
    right: 10px;
    bottom: 10px;
    left: 10px;
    justify-content: center;
    border-radius: var(--radius);
    text-align: center;
  }

  .project-card {
    min-height: 274px;
  }

  .site-footer {
    width: min(calc(100% - 28px), var(--max));
  }
}
