:root {
  color-scheme: light;
  --bg: #f7f4ef;
  --surface: #ffffff;
  --surface-strong: #f0ebe4;
  --ink: #202124;
  --muted: #64605a;
  --line: #d8d0c6;
  --accent: #0f766e;
  --accent-strong: #0b4f49;
  --gold: #c47d2f;
  --berry: #9f3f5b;
  --shadow: 0 18px 50px rgba(34, 30, 24, 0.12);
  --radius: 8px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.dark {
  color-scheme: dark;
  --bg: #171817;
  --surface: #222421;
  --surface-strong: #2f302b;
  --ink: #f3efe7;
  --muted: #bfb6a9;
  --line: #444039;
  --accent: #6bc7bb;
  --accent-strong: #9be2d8;
  --gold: #e0a14f;
  --berry: #df7d98;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

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

a:focus-visible,
button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1120px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0;
}

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

.site-nav a,
.icon-button,
.button {
  min-height: 42px;
  border-radius: var(--radius);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 650;
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--surface-strong);
}

.icon-button {
  display: inline-grid;
  width: 42px;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.section {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: center;
  gap: 56px;
  min-height: calc(100vh - 72px);
  padding-top: 36px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 5.7rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h1 span {
  color: var(--accent-strong);
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.hero-text {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.22rem);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid transparent;
  font-weight: 800;
}

.button.primary {
  background: var(--accent);
  color: #ffffff;
}

.button.primary:hover {
  background: var(--accent-strong);
}

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

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

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 560px;
  margin: 40px 0 0;
}

.quick-stats div {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.quick-stats dt {
  font-size: 1.5rem;
  font-weight: 850;
}

.quick-stats dd {
  margin: 2px 0 0;
  color: var(--muted);
}

.hero-panel {
  min-height: 540px;
}

.profile-art {
  position: relative;
  min-height: 540px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.22), transparent 42%),
    linear-gradient(315deg, rgba(196, 125, 47, 0.28), transparent 45%),
    var(--surface);
  box-shadow: var(--shadow);
}

.profile-art::before {
  position: absolute;
  inset: 32px;
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  border-radius: var(--radius);
  content: "";
}

.profile-card {
  position: absolute;
  top: 48px;
  left: 48px;
  right: 48px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 92px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.avatar-mark {
  display: inline-grid;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-weight: 850;
}

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

.code-window {
  position: absolute;
  right: 48px;
  bottom: 48px;
  left: 48px;
  min-height: 260px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #202124;
  color: #f7f4ef;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
}

.code-window span {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 7px;
  border-radius: 50%;
}

.code-window span:nth-child(1) {
  background: #df7d98;
}

.code-window span:nth-child(2) {
  background: #e0a14f;
}

.code-window span:nth-child(3) {
  background: #6bc7bb;
}

.code-window pre {
  margin: 26px 0 0;
  white-space: pre-wrap;
  color: #e9e3d7;
  font: 500 0.98rem/1.8 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.intro-band {
  width: 100%;
  max-width: none;
  padding: 26px max(16px, calc((100vw - 1120px) / 2));
  background: var(--accent);
  color: #ffffff;
}

.intro-band p {
  max-width: 960px;
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  display: flex;
  min-width: 0;
  min-height: 100%;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 10px 35px rgba(34, 30, 24, 0.08);
}

.project-visual {
  display: grid;
  aspect-ratio: 16 / 10;
  min-height: 190px;
  place-items: center;
  padding: 18px;
  color: #ffffff;
  font-weight: 850;
}

.project-visual span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
}

.visual-a {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(135deg, #0f766e, #202124);
}

.visual-b {
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2), transparent 34%),
    linear-gradient(135deg, #c47d2f, #9f3f5b);
}

.visual-c {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18) 25%, transparent 25%) 0 0 / 34px 34px,
    linear-gradient(135deg, #4b6b8a, #0f766e);
}

.project-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px;
}

.project-content p {
  margin: 10px 0 0;
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.project-links {
  display: flex;
  gap: 14px;
  margin-top: auto;
  padding-top: 24px;
}

.project-links a {
  color: var(--accent-strong);
  font-weight: 850;
}

.project-links a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.project-note {
  margin-top: auto;
  padding-top: 18px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.split-section {
  border-top: 1px solid var(--line);
}

.skill-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.skill-columns > div,
.timeline article,
.contact-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.skill-columns > div {
  padding: 22px;
}

.check-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  color: var(--muted);
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 24px;
}

.check-list li::before {
  position: absolute;
  left: 0;
  color: var(--accent);
  content: "✓";
  font-weight: 900;
}

.timeline-section {
  border-top: 1px solid var(--line);
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline article {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 20px;
  padding: 22px;
}

.timeline time {
  color: var(--accent);
  font-weight: 850;
}

.timeline p,
.contact-section p {
  margin: 8px 0 0;
  color: var(--muted);
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
  gap: 28px;
  padding: 32px;
}

.contact-links {
  display: grid;
  gap: 10px;
  align-content: start;
}

.contact-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--accent-strong);
  font-weight: 800;
}

.contact-links a::after {
  content: "↗";
}

.contact-links a:hover {
  background: var(--surface-strong);
}

.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 900px) {
  .site-header {
    gap: 12px;
  }

  .site-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .site-header {
    flex-wrap: wrap;
    padding-top: 14px;
  }

  .hero,
  .project-grid,
  .skill-columns,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    gap: 32px;
    padding-top: 44px;
  }

  .hero-panel,
  .profile-art {
    min-height: 460px;
  }

  .section {
    padding: 56px 0;
  }
}

@media (max-width: 560px) {
  .site-header,
  .section,
  .site-footer {
    width: min(100% - 24px, 1120px);
  }

  .site-nav a {
    padding: 0 10px;
    font-size: 0.88rem;
    white-space: nowrap;
  }

  .quick-stats {
    grid-template-columns: 1fr;
  }

  .hero-panel,
  .profile-art {
    min-height: 410px;
  }

  .profile-art::before {
    inset: 18px;
  }

  .profile-card,
  .code-window {
    left: 22px;
    right: 22px;
  }

  .profile-card {
    top: 26px;
  }

  .code-window {
    bottom: 26px;
    min-height: 220px;
    padding: 18px;
  }

  .code-window pre {
    font-size: 0.84rem;
  }

  .section-heading {
    display: block;
  }

  .timeline article {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .contact-section {
    padding: 22px;
  }
}
