@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Newsreader:opsz,wght@6..72,600;6..72,700&display=swap");

:root {
  --paper: #f8f3eb;
  --paper-deep: #eee4d8;
  --ink: #20201e;
  --muted: #6a6761;
  --line: #d9d0c4;
  --coral: #ef6a5b;
  --coral-dark: #c94c40;
  --blue: #3759d7;
  --blue-soft: #dce4ff;
  --yellow: #f4c84a;
  --white: #fffdfa;
  --shadow: 0 18px 50px rgba(66, 50, 39, 0.09);
  --sans: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Newsreader", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 84% 4%, rgba(244, 200, 74, 0.21), transparent 22rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.68;
}

a {
  color: var(--blue);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--coral-dark);
}

.progress {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--coral);
}

.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 4vw;
  border-bottom: 1px solid rgba(217, 208, 196, 0.8);
  background: rgba(248, 243, 235, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50% 50% 42% 58% / 54% 42% 58% 46%;
  background: var(--coral);
  color: var(--white);
  font-family: var(--serif);
  font-size: 1.25rem;
}

.menu-button {
  display: none;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font: 600 0.85rem var(--sans);
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.menu-icon {
  position: relative;
}

.menu-icon::before,
.menu-icon::after {
  position: absolute;
  left: 0;
  content: "";
}

.menu-icon::before { top: -5px; }
.menu-icon::after { top: 5px; }

.page-shell {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  max-width: 1500px;
  margin: 0 auto;
}

.sidebar {
  position: relative;
  padding: 4rem 1.5rem 3rem 3vw;
}

.sidebar-inner {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 125px);
  overflow: auto;
  scrollbar-width: thin;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--coral-dark);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar ul ul {
  margin: 0.25rem 0 0.6rem 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--line);
}

.sidebar li {
  margin: 0;
}

.sidebar nav a {
  display: block;
  padding: 0.28rem 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  text-decoration: none;
}

.sidebar nav a:hover,
.sidebar nav a[aria-current="true"] {
  color: var(--blue);
}

.secondary-link {
  display: inline-block;
  margin-top: 1.25rem;
  font-size: 0.84rem;
  font-weight: 700;
}

main {
  min-width: 0;
  padding: 3rem 4vw 5rem 1.5rem;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  min-height: 430px;
  overflow: hidden;
  padding: clamp(2.3rem, 6vw, 5rem);
  border-radius: 28px;
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow);
}

.hero::after {
  position: absolute;
  right: -7%;
  bottom: -38%;
  width: 430px;
  height: 430px;
  border: 1px solid rgba(255, 253, 250, 0.13);
  border-radius: 50%;
  content: "";
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.hero h1 {
  max-width: 780px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.7rem, 6.3vw, 5.8rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.94;
}

.dek {
  max-width: 650px;
  margin: 1.5rem 0 0;
  color: rgba(255, 253, 250, 0.78);
  font-size: clamp(1rem, 1.7vw, 1.2rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  background: var(--coral);
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  background: #ff7868;
  color: var(--white);
}

.text-link {
  color: var(--white);
  font-weight: 600;
}

.text-link:hover {
  color: var(--yellow);
}

.hero-art {
  position: relative;
  z-index: 1;
  min-height: 260px;
}

.frame {
  position: absolute;
  display: block;
  width: 110px;
  height: 150px;
  border: 2px solid var(--white);
  border-radius: 5px;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.2);
}

.frame::before {
  position: absolute;
  inset: 9px;
  border: 1px solid currentColor;
  border-radius: 50% 50% 12% 12%;
  content: "";
}

.frame-one {
  top: 16%;
  left: 10%;
  transform: rotate(-10deg);
  background: var(--blue);
  color: var(--blue-soft);
}

.frame-two {
  top: 31%;
  left: 38%;
  transform: rotate(8deg);
  background: var(--coral);
  color: #ffd6cf;
}

.frame-three {
  top: 7%;
  left: 62%;
  transform: rotate(17deg);
  background: var(--yellow);
  color: #755b08;
}

.spark {
  position: absolute;
  display: block;
  width: 19px;
  height: 19px;
  background: var(--white);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
}

.spark-one { top: 4%; left: 25%; }
.spark-two { right: 3%; bottom: 12%; width: 30px; height: 30px; }

.notice {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 1.2rem;
  margin: 1.5rem 0 4rem;
  padding: 1.1rem 1.3rem;
  border: 1px solid #dfc56f;
  border-radius: 14px;
  background: #fff7d9;
  color: #55470f;
  font-size: 0.9rem;
}

.research-content {
  max-width: 1050px;
}

.research-content > h1:first-child {
  display: none;
}

.research-content h2,
.research-content h3,
.research-content h4 {
  font-family: var(--serif);
  line-height: 1.12;
  text-wrap: balance;
}

.research-content h2 {
  margin: 5.5rem 0 1.25rem;
  padding-top: 1rem;
  border-top: 2px solid var(--ink);
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: -0.03em;
}

.research-content h3 {
  margin: 3.5rem 0 1rem;
  color: var(--blue);
  font-size: clamp(1.5rem, 2.5vw, 2.15rem);
}

.research-content h4 {
  margin-top: 2.5rem;
  font-size: 1.3rem;
}

.research-content p,
.research-content > ul,
.research-content > ol {
  max-width: 800px;
}

.research-content strong {
  font-weight: 700;
}

.research-content blockquote {
  margin: 2rem 0;
  padding: 1rem 1.3rem;
  border-left: 4px solid var(--coral);
  background: var(--white);
}

.research-content table {
  display: block;
  width: 100%;
  margin: 1.5rem 0 2.5rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  border-spacing: 0;
  background: var(--white);
  box-shadow: 0 6px 22px rgba(66, 50, 39, 0.05);
  font-size: 0.82rem;
  line-height: 1.42;
}

.research-content thead {
  background: var(--blue-soft);
  color: #1f3279;
}

.research-content th,
.research-content td {
  min-width: 105px;
  padding: 0.8rem 0.75rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.research-content th {
  font-weight: 700;
}

.research-content tr:last-child td {
  border-bottom: 0;
}

.research-content th:last-child,
.research-content td:last-child {
  border-right: 0;
}

.research-content tbody tr:hover {
  background: #fffaf4;
}

.research-content code {
  padding: 0.12rem 0.3rem;
  border-radius: 4px;
  background: var(--paper-deep);
  font-size: 0.9em;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  max-width: 1050px;
  margin-top: 6rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

footer a {
  flex: 0 0 auto;
  font-weight: 700;
}

@media (max-width: 980px) {
  .menu-button { display: inline-flex; }

  .page-shell { display: block; }

  .sidebar {
    position: fixed;
    z-index: 35;
    top: 68px;
    right: 0;
    bottom: 0;
    left: 0;
    visibility: hidden;
    padding: 1.5rem 5vw 3rem;
    overflow: auto;
    background: var(--paper);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 160ms ease, transform 160ms ease, visibility 160ms;
  }

  .sidebar.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
  }

  .sidebar-inner {
    position: static;
    max-height: none;
  }

  .sidebar nav a {
    padding: 0.45rem 0;
    font-size: 0.95rem;
  }

  main { padding: 2rem 4vw 4rem; }
}

@media (max-width: 720px) {
  .topbar { height: 60px; }
  .brand span:last-child { font-size: 0.9rem; }
  .sidebar { top: 60px; }

  .hero {
    display: block;
    min-height: auto;
    padding: 2.4rem 1.4rem 1.6rem;
    border-radius: 18px;
  }

  .hero h1 { font-size: clamp(2.5rem, 13vw, 4rem); }
  .hero-art { min-height: 170px; margin: 1.5rem auto 0; max-width: 280px; }
  .frame { width: 82px; height: 112px; }

  .notice {
    display: block;
    margin-bottom: 3rem;
  }

  .notice strong { display: block; margin-bottom: 0.25rem; }
  .research-content h2 { margin-top: 4rem; }

  .research-content table {
    margin-right: -4vw;
    width: calc(100% + 4vw);
    border-radius: 12px 0 0 12px;
    font-size: 0.76rem;
  }

  footer { display: block; }
  footer a { display: inline-block; margin-top: 0.5rem; }
}

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