:root {
  --bg: #14110e;
  --bg-2: #1c1814;
  --ink: #f4efe6;
  --muted: #b7ae9f;
  --line: rgba(244, 239, 230, 0.12);
  --accent: #e8b86d;
  --card: #221e19;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 72px;
  --tab-h: 0px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + var(--safe-top));
}

body {
  font-family: "Noto Sans SC", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.05;
  background-image: radial-gradient(rgba(255, 255, 255, 0.35) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
  z-index: 0;
}

.nav,
main,
footer,
.tabbar {
  position: relative;
  z-index: 1;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(16px + var(--safe-top)) 8vw 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(20, 17, 14, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.logo {
  font-family: "Instrument Serif", serif;
  font-size: 28px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.04em;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.top-nav {
  display: flex;
  gap: 28px;
}

.menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  padding: 10px 8px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.menu-btn span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav.open .menu-btn span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav.open .menu-btn span:nth-child(2) {
  opacity: 0;
}

.nav.open .menu-btn span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

nav a,
.contact-row a,
.logo,
.cta,
.tabbar a {
  color: var(--ink);
  text-decoration: none;
}

.top-nav a {
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.top-nav a:hover,
.contact-row a:hover,
.tabbar a.active,
.tabbar a:hover {
  color: var(--accent);
}

main {
  padding: 0 8vw 80px;
}

.hero {
  padding: 72px 0 56px;
  max-width: 820px;
}

.eyebrow {
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  margin-bottom: 18px;
}

h1 {
  font-family: "Instrument Serif", "Noto Sans SC", serif;
  font-size: clamp(34px, 8vw, 84px);
  line-height: 1.15;
  font-weight: 400;
  word-break: break-word;
}

.accent {
  color: var(--accent);
  font-style: italic;
}

.lead {
  margin-top: 24px;
  font-size: 18px;
  color: var(--muted);
  max-width: 640px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 14px;
}

.hero-meta span {
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 999px;
}

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

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--accent);
  color: #1a140c;
  font-weight: 600;
  word-break: break-all;
}

.cta.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

section {
  padding: 64px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--nav-h) + var(--safe-top));
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 28px;
}

h2 {
  font-family: "Instrument Serif", serif;
  font-size: clamp(28px, 7vw, 40px);
  font-weight: 400;
}

.section-head p,
.about-grid p,
.card p,
.skill-cols p {
  color: var(--muted);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.9fr;
  gap: 24px;
}

.facts {
  list-style: none;
  display: grid;
  gap: 12px;
}

.facts strong {
  color: var(--accent);
  display: block;
  font-size: 22px;
  font-family: "Instrument Serif", serif;
}

.about-extra {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}

.about-extra article,
.project,
.timeline li,
.faq-list article {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 24px;
}

.about-extra h3,
.project h3,
.timeline h3,
.faq-list h3 {
  font-family: "Instrument Serif", serif;
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 10px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 24px;
  min-height: 180px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(232, 184, 109, 0.45);
}

.tag {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.card h3,
.skill-cols h3 {
  margin: 12px 0 10px;
  font-size: 22px;
  font-family: "Instrument Serif", serif;
  font-weight: 400;
}

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

.skill-cols > div {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 20px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.skill-tags span {
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
}

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

.project-list,
.timeline,
.faq-list {
  display: grid;
  gap: 16px;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.project ul {
  margin-top: 14px;
  padding-left: 18px;
  color: var(--muted);
}

.timeline {
  list-style: none;
}

.timeline span {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.contact-note {
  color: var(--muted);
  max-width: 640px;
  margin-bottom: 20px;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 18px;
}

.contact-row .cta {
  margin-top: 0;
  width: 100%;
  max-width: 420px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 28px 8vw calc(40px + var(--tab-h) + var(--safe-bottom));
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.tabbar {
  display: none;
}

@media (max-width: 900px) {
  .about-grid,
  .about-extra,
  .cards,
  .cards.three,
  .skill-cols {
    grid-template-columns: 1fr;
  }

  .top-nav {
    gap: 16px;
  }

  .section-head {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-h: 64px;
    --tab-h: 56px;
  }

  .nav,
  main,
  footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .menu-btn {
    display: flex;
  }

  .top-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(20, 17, 14, 0.98);
    border-bottom: 1px solid var(--line);
    padding: 8px 20px 16px;
  }

  .nav.open .top-nav {
    display: flex;
  }

  .top-nav a {
    min-height: 48px;
    font-size: 16px;
    border-bottom: 1px solid var(--line);
  }

  .hero {
    padding: 36px 0 40px;
  }

  .lead {
    font-size: 16px;
  }

  .hero-actions,
  .cta {
    width: 100%;
  }

  .hero-actions .cta {
    flex: 1;
  }

  section {
    padding: 40px 0;
  }

  .card {
    min-height: 0;
  }

  .card:hover {
    transform: none;
  }

  footer {
    flex-direction: column;
  }

  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    height: calc(56px + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: rgba(20, 17, 14, 0.96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }

  .tabbar a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--muted);
    min-height: 56px;
  }
}
