/* ==========================================================================
   Library Navigator, COMP 523
   Shared stylesheet. Plain by design: no gradients, no shadows, no rounded
   corners, no boxes. Rules and whitespace do the work.
   ========================================================================== */

:root {
  --bg:      #f7f7f5;
  --ink:     #141414;
  --body:    #2f2f2f;
  --muted:   #6a6a6a;
  --faint:   #9b9b9b;
  --rule:    #dcdcd8;
  --rule-2:  #c4c4be;
  --link:    #1a4f7a;

  --measure: 680px;
  --wide:    1120px;

  --serif: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  font-size: 19px;
  line-height: 1.75;
}

a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--bg); padding: 10px 16px; z-index: 200; }
.skip:focus { left: 12px; top: 12px; }

/* ---------------------------------------------------------------- header  */

.masthead {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 30px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }

.navtoggle {
  display: none;
  background: none;
  border: none;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  padding: 6px 0;
  cursor: pointer;
}

.nav { display: flex; align-items: center; gap: 34px; }

.nav a,
.nav .menubtn {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
  white-space: nowrap;
}
.nav a:hover, .nav .menubtn:hover { text-decoration: underline; text-underline-offset: 6px; }
.nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
}

/* dropdown */
.menu { position: relative; }
.menubtn::after { content: " \25BE"; font-size: 12px; color: var(--muted); }
.nav .menubtn[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
}

/* Invisible bridge across the gap between the button and the panel, so that
   moving the cursor down into the menu does not leave .menu and close it. */
.menu::after {
  content: "";
  display: none;
  position: absolute;
  top: 100%;
  left: -14px;
  right: -14px;
  height: 20px;
}
.menu.open::after { display: block; }

.menulist {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 14px);
  min-width: 230px;
  margin: 0;
  padding: 10px 0;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--rule-2);
  z-index: 100;
}
.menu.open .menulist { display: block; }
.menulist li { margin: 0; }
.menulist a {
  display: block;
  padding: 9px 20px;
  font-size: 16px;
  text-decoration: none;
}
.menulist a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------------------------------------------------------------- layout  */

main { max-width: var(--wide); margin: 0 auto; padding: 0 40px 170px; }

.col { max-width: var(--measure); margin: 0 auto; }

.pagehead { text-align: center; padding: 130px 0 0; }

.pagetitle {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(42px, 6.6vw, 80px);
  line-height: 1.04;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin: 0;
}

.deck {
  max-width: 620px;
  margin: 38px auto 0;
  font-size: 20px;
  line-height: 1.6;
  color: var(--body);
}

.section { margin-top: 115px; }
.section:first-of-type { margin-top: 130px; }

/* ------------------------------------------------------------- typography */

h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(30px, 4.2vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin: 0 0 30px;
}

h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 21px;
  line-height: 1.35;
  color: var(--ink);
  margin: 58px 0 14px;
}

h4 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 44px 0 12px;
}

p { margin: 0 0 24px; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 24px; padding-left: 24px; }
li { margin-bottom: 14px; }
li:last-child { margin-bottom: 0; }

strong { color: var(--ink); font-weight: 600; }
em { font-style: italic; }

.lede { font-size: 22px; line-height: 1.65; color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 16px; line-height: 1.65; }
.center { text-align: center; }

.tbd  { color: #8a6000; font-weight: 600; }
.done { color: #2c6132; font-weight: 600; }
.wip  { color: var(--link); font-weight: 600; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  color: var(--ink);
}

/* --------------------------------------------------------- jump sub-nav  */

.jump {
  margin: 44px 0 0;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: 16px;
  line-height: 2;
}
.jump a { margin-right: 22px; white-space: nowrap; }

/* ------------------------------------------------------- record patterns */

/* One item per rule, used for requirements, deliverables, links, people. */
.record {
  padding: 30px 0;
  border-top: 1px solid var(--rule);
}
.record:last-child { border-bottom: 1px solid var(--rule); }

.record-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 9px;
}
.record-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 9px;
}
.record-body { font-size: 17px; line-height: 1.72; color: var(--muted); margin: 0; }
.record-body ul { margin: 12px 0 0; }
.record-body li { margin-bottom: 9px; font-size: 17px; }
.record-meta { font-size: 16px; color: var(--muted); margin-top: 9px; }

.records { margin-top: 10px; }

/* two-part record: term on the left, behavior on the right */
.pair { display: grid; grid-template-columns: 230px 1fr; gap: 30px; }
.pair-term { font-size: 17px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.pair-body { font-size: 17px; line-height: 1.72; color: var(--muted); }

/* person */
.person-name { font-family: var(--serif); font-size: 27px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.person-role { font-size: 17px; color: var(--ink); margin-top: 6px; font-weight: 600; }

/* stories */
.story { padding: 22px 0; border-top: 1px solid var(--rule); }
.story:last-child { border-bottom: 1px solid var(--rule); }
.story-text { font-size: 18px; color: var(--ink); line-height: 1.6; }
.story-accept { font-size: 16px; color: var(--muted); margin-top: 8px; line-height: 1.65; }

/* callout: a rule, not a box */
.note {
  border-left: 2px solid var(--rule-2);
  padding: 4px 0 4px 22px;
  margin: 32px 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

/* -------------------------------------------------------------- diagram  */

.diagram { margin: 0; padding: 0; overflow-x: auto; }
.diagram svg { display: block; width: 100%; min-width: 940px; height: auto; }
.diagram-caption {
  font-size: 15px; line-height: 1.65; color: var(--muted);
  margin-top: 20px; max-width: var(--measure);
}

/* ---------------------------------------------------------------- footer  */

.sitefoot {
  border-top: 1px solid var(--rule);
  margin-top: 60px;
}
.sitefoot-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 48px 40px 90px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--muted);
}
.sitefoot-nav { margin-bottom: 14px; }
.sitefoot-nav a { margin-right: 22px; display: inline-block; }

/* --------------------------------------------------------------- mobile  */

@media (max-width: 860px) {
  body { font-size: 18px; }
  .masthead { padding: 22px 24px; flex-wrap: wrap; }
  .navtoggle { display: block; }
  .nav {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    padding: 20px 0 6px;
  }
  .nav.open { display: flex; }
  .nav a, .nav .menubtn { font-size: 18px; padding: 9px 0; }
  .menu { width: 100%; }
  .menu::after, .menu.open::after { display: none; }
  .menulist {
    display: block;
    position: static;
    border: none;
    padding: 0 0 6px 20px;
    min-width: 0;
    background: none;
  }
  .menulist a { padding: 7px 0; font-size: 17px; }
  main { padding: 0 24px 110px; }
  .pagehead { padding: 70px 0 0; }
  .deck { font-size: 19px; margin-top: 28px; }
  .section { margin-top: 80px; }
  .section:first-of-type { margin-top: 90px; }
  .pair { grid-template-columns: 1fr; gap: 10px; }
  .sitefoot-inner { padding: 36px 24px 70px; }
}

@media print {
  .masthead, .sitefoot, .jump, .navtoggle { display: none; }
  body { background: #fff; font-size: 12pt; }
  .pagehead { padding-top: 0; }
  .section { margin-top: 36px; page-break-inside: avoid; }
  a { color: #000; }
}
