/* Data Archipelago: book website. House palette from the book's illustrations. */
:root {
  --navy: #041e42;
  --navy-2: #0b2d5c;
  --orange: #ff9100;
  --orange-d: #b85c00;
  --light-o: #ffb24d;
  --peach: #ffd9a8;
  --pale-o: #ffe3c2;
  --cream: #fff3e6;
  --cream-s: #edcba5;
  --grey: #5b6b80;
  --grey-l: #c9d1db;
  --grey-bg: #eceef1;
  --sky: #eef4fa;
  --wave: #cfdfee;
  --white: #fff;
  --radius: 12px;
  --max: 1080px;
  --font: "Montserrat", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font);
  font-weight: 500;
  color: var(--navy);
  background: var(--white);
  line-height: 1.6;
  font-size: 17px;
}
img { max-width: 100%; display: block; }
a { color: var(--orange-d); }
a:hover { color: var(--orange); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 800; letter-spacing: -.5px; }
h2 { font-size: clamp(1.45rem, 2.8vw, 2rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

.kicker {
  display: inline-block;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--orange-d);
  margin-bottom: .6em;
}
.on-dark .kicker { color: var(--light-o); }

/* ---------------- header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--navy);
  color: var(--white);
  border-bottom: 3px solid var(--orange);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; font-weight: 800; letter-spacing: .4px; }
.brand svg { flex: none; }
.brand:hover { color: var(--light-o); }
.nav { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block; padding: 8px 12px; border-radius: 9px;
  color: var(--white); text-decoration: none; font-weight: 600; font-size: .9rem;
}
.nav a:hover { background: var(--navy-2); color: var(--light-o); }
.nav a[aria-current="page"] { color: var(--navy); background: var(--orange); }
.nav .lock::before { content: "⚓ "; }
.nav-toggle { display: none; background: none; border: 2px solid var(--light-o); color: var(--white); border-radius: 9px; padding: 6px 12px; font: 700 .9rem var(--font); cursor: pointer; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 71px; left: 0; right: 0; flex-direction: column; background: var(--navy); padding: 10px 24px 18px; border-bottom: 3px solid var(--orange); }
  .nav.open { display: flex; }
}

/* ---------------- hero */
section.hero {
  padding: 0;
  background: var(--navy);
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.hero::after { /* soft waves */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .14;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cpath d='M10 30 q8 -6 16 0 t16 0' fill='none' stroke='%23cfdfee' stroke-width='1.6' stroke-linecap='round'/%3E%3Cpath d='M70 10 q8 -6 16 0 t16 0' fill='none' stroke='%23cfdfee' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}
.hero .wrap { position: relative; z-index: 1; padding-top: 72px; padding-bottom: 72px; }
.hero-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 56px; align-items: center; }
.hero h1 span { color: var(--orange); }
.hero .lede { font-size: 1.2rem; color: #dbe5f1; max-width: 36em; }
.hero .cover { border-radius: 10px; box-shadow: 0 0 0 1px rgba(255,255,255,.12); transform: rotate(1.5deg); }
.hero-small .wrap { padding-top: 56px; padding-bottom: 56px; }
.hero-small .lede { max-width: 44em; }
@media (max-width: 800px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero .cover { max-width: 260px; }
}

.btn {
  display: inline-block; padding: 12px 22px; border-radius: 999px;
  font: 700 .95rem var(--font); text-decoration: none; cursor: pointer;
  border: 2px solid var(--orange); background: var(--orange); color: var(--navy);
}
.btn:hover { background: var(--light-o); border-color: var(--light-o); color: var(--navy); }
.btn.ghost { background: transparent; color: var(--white); border-color: var(--light-o); }
.btn.ghost:hover { background: var(--navy-2); color: var(--light-o); }
.btn.ink { background: var(--navy); border-color: var(--navy); color: var(--white); }
.btn.ink:hover { background: var(--navy-2); color: var(--light-o); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.6em; }

/* ---------------- sections */
section { padding: 72px 0; }
section.sea { background: var(--sky); }
section.grey { background: var(--grey-bg); }
section.night { background: var(--navy); color: var(--white); }
.section-head { max-width: 46em; margin-bottom: 36px; }
.section-head p { color: var(--grey); font-size: 1.05rem; }
.night .section-head p { color: #dbe5f1; }

.figure { background: var(--white); border-radius: var(--radius); padding: 14px; }
.sea .figure, .grey .figure { box-shadow: 0 0 0 1px var(--wave); }
.figure.flush { padding: 0; background: none; box-shadow: none; }
.caption { font-size: .85rem; color: var(--grey); margin-top: 10px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--cream);
  border: 1px solid var(--cream-s);
  border-radius: var(--radius);
  padding: 24px;
}
.card.white { background: var(--white); border-color: var(--wave); }
.card h3 { margin-top: .2em; }
.card p:last-child { margin-bottom: 0; }

.stat { font-size: 2.6rem; font-weight: 800; color: var(--orange); line-height: 1; margin-bottom: 6px; }
.stat-label { font-size: .92rem; font-weight: 600; }

.pill {
  display: inline-block; padding: 3px 12px; border-radius: 9px;
  background: var(--pale-o); color: var(--orange-d);
  font-size: .78rem; font-weight: 700; letter-spacing: .3px;
}
.pill.navy { background: var(--navy); color: var(--white); }
.pill.grey { background: var(--grey-bg); color: var(--grey); }

ul.ticks { list-style: none; padding: 0; margin: 0; }
ul.ticks li { position: relative; padding-left: 30px; margin-bottom: .7em; }
ul.ticks li::before {
  content: ""; position: absolute; left: 0; top: .35em;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--orange); box-shadow: inset 0 0 0 4px var(--pale-o);
}

/* lettered beads, like the frameworks in the book */
.beads { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.bead {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--navy); color: var(--white);
  display: grid; place-items: center; font-weight: 800; font-size: .85rem;
}
.bead.o { background: var(--orange); color: var(--navy); }

.quote {
  font-size: 1.35rem; font-weight: 700; line-height: 1.4;
  border-left: 5px solid var(--orange); padding-left: 22px; margin: 0;
}
.night .quote { color: var(--white); }

/* ---------------- notes (TA corner / Navigators' lounge) */
.chapter-index { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 40px; padding: 0; list-style: none; }
.chapter-index a {
  display: block; padding: 6px 14px; border-radius: 9px; text-decoration: none;
  background: var(--white); border: 1px solid var(--wave); color: var(--navy); font-weight: 600; font-size: .88rem;
}
.chapter-index a:hover { border-color: var(--orange); color: var(--orange-d); }

.note {
  display: grid; grid-template-columns: 56px 1fr; gap: 18px;
  background: var(--white); border: 1px solid var(--wave); border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px;
}
.note:target { border-color: var(--orange); box-shadow: 0 0 0 3px var(--pale-o); }
.note .icon { width: 56px; height: 56px; border-radius: 50%; background: var(--cream); border: 1px solid var(--cream-s); display: grid; place-items: center; }
.note .icon img { width: 30px; height: 30px; }
.note .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.note h3 { margin-bottom: .4em; }
.note .byline { font-size: .88rem; color: var(--grey); margin: 0; }
.note .body p:last-of-type { margin-bottom: .6em; }
@media (max-width: 560px) { .note { grid-template-columns: 1fr; } }

.placeholder-flag {
  background: var(--pale-o); border: 1px dashed var(--orange); color: var(--orange-d);
  border-radius: 9px; padding: 10px 14px; font-size: .88rem; font-weight: 600; margin-bottom: 28px;
}

/* ---------------- login */
.login-shell { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 800px) { .login-shell { grid-template-columns: 1fr; } }
.form label { display: block; font-weight: 700; font-size: .9rem; margin: 0 0 6px; }
.form input {
  width: 100%; padding: 12px 14px; margin-bottom: 18px;
  border: 1.5px solid var(--grey-l); border-radius: 9px; font: 500 1rem var(--font); color: var(--navy); background: var(--white);
}
.form input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--pale-o); }
.form .small { font-size: .85rem; color: var(--grey); }
.form-msg { display: none; margin-top: 16px; padding: 12px 14px; border-radius: 9px; background: var(--sky); border: 1px solid var(--wave); font-size: .9rem; }
.form-msg.show { display: block; }

/* ---------------- author */
.portrait {
  aspect-ratio: 4 / 5; border-radius: var(--radius); background: var(--navy);
  display: grid; place-items: center; color: var(--orange); font-size: 4rem; font-weight: 800;
  position: relative; overflow: hidden;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; border-left: 2px dashed var(--navy); opacity: .5; }
.timeline li { position: relative; padding: 0 0 18px 34px; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 5px; width: 16px; height: 16px; border-radius: 50%; background: var(--white); border: 3px solid var(--navy); }
.timeline li.o::before { background: var(--orange); border-color: var(--orange); }
.timeline .when { font-weight: 800; font-size: .82rem; color: var(--orange-d); letter-spacing: .5px; }

/* ---------------- footer */
.site-footer { background: var(--navy); color: #c3d0e0; padding: 40px 0; font-size: .9rem; border-top: 3px solid var(--orange); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; }
.site-footer a { color: var(--light-o); text-decoration: none; }
.site-footer a:hover { color: var(--orange); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
