:root {
  color-scheme: light;
  --ink: #121212;
  --muted: #5e5e5e;
  --paper: #f6f3ee;
  --surface: #fffdfa;
  --line: #d9d2c8;
  --yellow: #f6e600;
  --cyan: #02a9df;
  --pink: #fa46a9;
  --shadow: 0 18px 50px rgba(18, 18, 18, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.is-locked {
  overflow: hidden;
}

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

:focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; }
button:disabled { opacity: 0.4; cursor: default; }
body { letter-spacing: 0; }

button,
a {
  color: inherit;
  font: inherit;
}

a {
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(18, 18, 18, 0.1);
  background: rgba(246, 243, 238, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  gap: 2px;
  font-weight: 900;
}

.brand small,
.eyebrow,
.chapter-strip small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.section-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.section-nav a {
  border: 1px solid rgba(18, 18, 18, 0.12);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 253, 250, 0.78);
  font-size: 13px;
  font-weight: 800;
}

.hero {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(320px, 1.22fr);
  gap: clamp(24px, 4vw, 58px);
  align-items: center;
  min-height: 0;
  padding: clamp(32px, 6vw, 72px) clamp(18px, 4vw, 56px) 34px;
}

.hero-copy {
  max-width: 690px;
}

.eyebrow {
  margin: 0 0 14px;
}

h1,
h2 {
  margin: 0;
  line-height: 0.96;
}

h1 {
  font-size: 64px;
  line-height: 1.12;
}

.keep-together {
  white-space: nowrap;
}

h2 {
  font-size: 32px;
  line-height: 1.2;
}

.intro {
  margin: 24px 0 0;
  max-width: 590px;
  color: #343434;
  font-size: 18px;
  line-height: 1.7;
}

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

.primary-action,
.secondary-action,
.lightbox-toolbar button,
.lightbox-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 900;
  cursor: pointer;
}

.primary-action {
  background: var(--ink);
  color: white;
}

.secondary-action,
.lightbox-toolbar button,
.lightbox-nav {
  background: var(--yellow);
}

.cover-button {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(18, 18, 18, 0.14);
  border-radius: 0;
  min-width: 0;
  align-self: center;
  background: #111;
  box-shadow: var(--shadow);
  cursor: zoom-in;
}

.cover-button img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.cover-button span,
.page-card button span {
  display: block;
  padding: 8px 12px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.chapter-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 1px;
  margin: 0 clamp(18px, 4vw, 56px) 16px;
  background: var(--ink);
  border: 1px solid var(--ink);
}

.chapter-strip a {
  display: grid;
  min-height: 132px;
  align-content: space-between;
  padding: 16px;
  background: var(--surface);
}

.chapter-strip strong {
  color: var(--cyan);
  font-size: 24px;
}

.chapter-strip span {
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
}

.view-note {
  position: static;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 clamp(18px, 4vw, 56px) 20px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 11px 16px;
  background: var(--yellow);
  box-shadow: 0 10px 24px rgba(18, 18, 18, 0.12);
  font-weight: 900;
}

.view-note span {
  color: #242424;
  font-weight: 800;
}

.portfolio-feed {
  display: grid;
  gap: clamp(18px, 3vw, 34px);
  padding: 0 clamp(18px, 4vw, 56px) clamp(28px, 5vw, 58px);
}

.page-card {
  scroll-margin-top: calc(var(--nav-height, 140px) + 16px);
  margin: 0;
}

.page-card button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid rgba(18, 18, 18, 0.18);
  border-radius: 0;
  overflow: hidden;
  background: #111;
  box-shadow: var(--shadow);
  cursor: zoom-in;
}

.page-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #111;
}

.page-card figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 4px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.page-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.page-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--cyan);
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 clamp(18px, 4vw, 56px) clamp(28px, 5vw, 58px);
  border: 1px solid rgba(18, 18, 18, 0.14);
  border-radius: 8px;
  padding: clamp(22px, 4vw, 40px);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.contact p {
  overflow-wrap: anywhere;
  margin: 10px 0 0;
  max-width: 720px;
  color: #3a3a3a;
  line-height: 1.75;
}

.contact p:first-of-type {
  margin-top: 18px;
}

.contact p a {
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(92px, 0.12fr) minmax(0, 1fr) minmax(92px, 0.12fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  background: rgba(7, 7, 7, 0.94);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-toolbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: white;
  font-weight: 900;
}

.lightbox img {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  justify-self: center;
  max-width: 100%;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.lightbox-nav {
  align-self: center;
  width: 100%;
  color: var(--ink);
}

.lightbox-nav.prev {
  grid-column: 1;
  grid-row: 2;
}

.lightbox-nav.next {
  grid-column: 3;
  grid-row: 2;
}

.back-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--cyan);
  color: var(--ink);
  font-size: 26px;
  font-weight: 900;
  cursor: pointer;
}

.back-top.is-visible {
  display: grid;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .chapter-strip {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 720px) {
  h1 { font-size: 42px; }
  h2 { font-size: 28px; }
  .brand small { font-size: 10px; }
  .section-nav { width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .section-nav a { flex: 0 0 auto; min-height: 44px; display: inline-flex; align-items: center; }
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-nav {
    justify-content: flex-start;
  }

  .hero {
    padding-top: 28px;
  }

  .chapter-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .view-note {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    border-radius: 8px;
  }

  .cover-button span,
  .page-card button span {
    right: 9px;
    bottom: 9px;
    padding: 6px 9px;
    font-size: 12px;
  }

  .contact {
    align-items: flex-start;
    flex-direction: column;
  }

  .lightbox {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
  }

  .lightbox img {
    grid-column: 1 / -1;
    grid-row: 2;
    max-height: 100%;
  }

  .lightbox-nav.prev,
  .lightbox-nav.next {
    grid-row: 3;
  }

  .lightbox-nav.prev {
    grid-column: 1;
  }

  .lightbox-nav.next {
    grid-column: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
