/* DocStock — Team Pearl
   Palette: deep slate blue ink, cool pearl paper, nacre luster accents. */

:root {
  --ink: #0f2439;
  --ink-soft: #46607d;
  --pearl: #f4f7fa;
  --shell: #ffffff;
  --line: #d9e2ec;
  --luster: #7b6aa8;
  --luster-rose: #d99ab0;
  --luster-aqua: #8fc8c6;
  --focus: #1f6feb;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --measure: 66ch;
  --gutter: clamp(20px, 5vw, 56px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--pearl);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
}

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

a { color: var(--ink); text-decoration-color: var(--luster); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.4em;
}

h1 { font-size: clamp(2.6rem, 7vw, 4.2rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
h3 { font-size: 1.12rem; font-family: var(--sans); font-weight: 600; letter-spacing: 0; }

p { margin: 0 0 1em; max-width: var(--measure); }

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- Masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--line);
  background: rgba(244, 247, 250, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.masthead .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 28px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.wordmark span { color: var(--luster); }

.masthead nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
}

.masthead nav a {
  text-decoration: none;
  font-size: 0.94rem;
  color: var(--ink-soft);
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.masthead nav a:hover { color: var(--ink); }

.masthead nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--luster);
}

/* ---------- Hero ---------- */

.hero { padding: clamp(48px, 9vw, 104px) 0 clamp(40px, 7vw, 72px); }

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.kicker {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

.tagline {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-style: italic;
  color: var(--luster);
  margin: -0.1em 0 1.1em;
  max-width: 24ch;
}

.lede { font-size: 1.08rem; color: var(--ink-soft); }

/* the pearl — the one deliberate flourish */
.pearl {
  aspect-ratio: 1;
  width: 100%;
  max-width: 300px;
  margin-inline: auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #ffffff 0%, rgba(255,255,255,0) 46%),
    conic-gradient(from 210deg,
      var(--luster-rose) 0deg,
      #f0e6f2 70deg,
      var(--luster-aqua) 150deg,
      #e8eef7 225deg,
      var(--luster) 300deg,
      var(--luster-rose) 360deg);
  box-shadow: inset 0 -14px 34px rgba(15, 36, 57, 0.16);
  animation: turn 44s linear infinite;
}

@keyframes turn { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .pearl { animation: none; }
}

/* ---------- Sections ---------- */

.band { padding: clamp(40px, 6vw, 72px) 0; border-top: 1px solid var(--line); }
.band--shell { background: var(--shell); }

.section-head { max-width: var(--measure); margin-bottom: 32px; }
.section-head p { color: var(--ink-soft); margin-bottom: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px 36px;
}

.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--ink-soft); font-size: 0.97rem; margin-bottom: 0; }

.rule-list {
  list-style: none;
  padding: 0;
  margin: 0;
  columns: 2;
  column-gap: 36px;
  max-width: 760px;
}

.rule-list li {
  break-inside: avoid;
  padding: 9px 0 9px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.97rem;
  position: relative;
}

.rule-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 19px;
  width: 9px;
  height: 3px;
  border-radius: 2px;
  background: var(--luster-rose);
}

@media (max-width: 620px) { .rule-list { columns: 1; } }

.next-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
}

.button {
  display: inline-block;
  text-decoration: none;
  font-size: 0.96rem;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--pearl);
}

.button:hover { background: #1b3b5c; border-color: #1b3b5c; }

.button--quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.button--quiet:hover { background: var(--shell); border-color: var(--ink); }

/* ---------- Presentation ---------- */

.deck-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--shell);
}

.deck-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Lab writeups are portrait letter pages, not 16:9 slides. */
.deck-frame--doc {
  aspect-ratio: 8.5 / 11;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 620px) {
  .deck-frame--doc { aspect-ratio: 3 / 4; }
}

.deck-fallback {
  margin-top: 16px;
  margin-bottom: 0;
}

.deck-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.deck-empty {
  border: 1px dashed var(--luster);
  border-radius: 10px;
  background: var(--shell);
  padding: 32px;
}

.deck-empty code {
  font-size: 0.88rem;
  background: var(--pearl);
  padding: 2px 6px;
  border-radius: 4px;
}

.source {
  margin-top: 16px;
  margin-bottom: 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

/* ---------- Team ---------- */

.roster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 40px 32px;
}

.member figure { margin: 0 0 16px; }

.portrait {
  aspect-ratio: 4 / 5;
  width: 100%;
  border-radius: 120px 120px 12px 12px;
  overflow: hidden;
  background: linear-gradient(155deg, #e9edf4, #dfe6f0);
  border: 1px solid var(--line);
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait--initials {
  display: grid;
  place-items: center;
  background: conic-gradient(from 200deg, #f2e7ef, #e4edf3, #ece7f4, #f2e7ef);
  font-family: var(--serif);
  font-size: 2.4rem;
  color: var(--luster);
}

.member h3 { margin-bottom: 2px; font-size: 1.05rem; }

.member .role {
  font-size: 0.86rem;
  color: var(--luster);
  margin-bottom: 10px;
}

.member p { font-size: 0.95rem; color: var(--ink-soft); margin-bottom: 0; }

/* ---------- Glossary ---------- */

.glossary { margin: 0; max-width: 880px; }

.glossary div {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 4px 32px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.glossary div:first-child { border-top: 1px solid var(--line); }

.glossary dt { font-weight: 600; }

.glossary dd { margin: 0; color: var(--ink-soft); max-width: var(--measure); }

@media (max-width: 620px) { .glossary div { grid-template-columns: 1fr; } }

/* ---------- References ---------- */

.ref-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 880px;
}

.ref-list li {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.97rem;
  overflow-wrap: anywhere;
}

.ref-list li:first-child { border-top: 1px solid var(--line); }

.ref-list .ref-num { color: var(--ink); font-weight: 600; }

.ref-list li:target { background: var(--shell); }

/* ---------- Footer ---------- */

.site-foot {
  border-top: 1px solid var(--line);
  padding: 28px 0 44px;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 28px;
}

.site-foot p { margin: 0; max-width: none; }

.foot-links { display: flex; flex-wrap: wrap; gap: 6px 22px; }

.foot-links a { color: var(--ink-soft); }
.foot-links a:hover { color: var(--ink); }

/* ---------- Small screens ---------- */

@media (max-width: 780px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .pearl { max-width: 190px; grid-row: 1; }
  .masthead nav { width: 100%; margin-left: 0; gap: 6px 18px; }
}
