/* ===========================================================
   16-825 assignment page styles
   Reusable across assignments — copy this file into proj1/,
   proj2/, etc. alongside index.html.
   =========================================================== */

:root {
  /* Coordinate-axis palette: X red, Y green, Z blue */
  --x: #c0392f;
  --y: #3f7d20;
  --z: #2a5d9f;

  --ink: #16191c;
  --ink-soft: #565f68;
  --ink-faint: #8b949c;
  --paper: #f2f4f5;
  --panel: #1a1e22;
  --rule: #ccd4d8;

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
           "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas,
          "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 0 1.5rem 5rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
}

a {
  color: var(--z);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--ink); }

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

/* ---------- page frame ---------- */

.page {
  max-width: 62rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  column-gap: 3.5rem;
}

.masthead,
.content { grid-column: 1 / -1; }

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding: 3.5rem 0 1.75rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 3rem;
}

.masthead h1 {
  font-family: var(--sans);
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
  margin: 0 0 0.5rem;
}

.course {
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
}

.meta {
  font-family: var(--sans);
  font-size: 0.875rem;
  margin: 0;
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.15rem 0.75rem;
  justify-content: start;
}
.meta dt { color: var(--ink-faint); }
.meta dd { margin: 0; }

.gizmo { flex: 0 0 auto; }
.gizmo svg { display: block; width: 150px; height: 150px; }

.sphere { stroke: var(--ink-faint); fill: none; stroke-width: 1; opacity: 0.55; }
.spin { animation: turn 16s linear infinite; }
.spin-b { animation: turn 16s linear infinite -5.33s; }
.spin-c { animation: turn 16s linear infinite -10.66s; }

@keyframes turn {
  0%   { rx: 54px; }
  50%  { rx: 2px; }
  100% { rx: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  .spin, .spin-b, .spin-c { animation: none; }
}

/* ---------- side rail ---------- */

.rail {
  grid-column: 1;
  align-self: start;
  position: sticky;
  top: 2rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
}

.rail ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.rail li { margin-bottom: 0.6rem; }
.rail a {
  color: var(--ink-soft);
  text-decoration: none;
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
}
.rail a:hover { color: var(--ink); }
.rail a::before {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  background: var(--tick, var(--ink-faint));
}
.rail li:nth-child(3n + 1) a { --tick: var(--x); }
.rail li:nth-child(3n + 2) a { --tick: var(--y); }
.rail li:nth-child(3n + 3) a { --tick: var(--z); }

/* ---------- main column ---------- */

.main {
  grid-column: 2;
  max-width: 40rem;
}

.lede {
  font-size: 1.1875rem;
  line-height: 1.6;
  margin: 0 0 3.5rem;
  color: var(--ink-soft);
}

.task { margin-bottom: 4.5rem; }
.task:nth-of-type(3n + 1) { --axis: var(--x); }
.task:nth-of-type(3n + 2) { --axis: var(--y); }
.task:nth-of-type(3n + 3) { --axis: var(--z); }

.task h2 {
  font-family: var(--sans);
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin: 0 0 1.25rem;
  padding-left: 1.1rem;
  border-left: 4px solid var(--axis, var(--ink));
}

.task h3 {
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 650;
  margin: 2.25rem 0 0.75rem;
}

.task p { margin: 0 0 1.1rem; }

/* ---------- figures ---------- */

.viewport {
  margin: 0 0 1rem;
  padding: 1.25rem;
  background: var(--panel);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  border-radius: 3px;
}

.viewport img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.viewport figcaption {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-family: var(--sans);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #a8b2ba;
}
.viewport figcaption a { color: #8fb6e8; }
.viewport figcaption a:hover { color: #fff; }

/* empty placeholder — delete once you drop in a real image */
.slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 190px;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  color: #7f8a93;
  font-family: var(--sans);
  font-size: 0.8125rem;
  text-align: center;
  padding: 1rem;
}

/* side-by-side figures for later assignments */
.figs {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-bottom: 1rem;
}
.figs .viewport { margin-bottom: 0; }

/* ---------- chat transcript ---------- */

.turn {
  margin: 0 0 1.25rem;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
}
.turn h3 {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--ink-faint);
  margin: 0 0 0.4rem;
}
.turn p { margin: 0 0 0.75rem; }
.turn p:last-child { margin-bottom: 0; }

.turn-prompt { border-left-color: var(--axis, var(--ink)); }
.turn-prompt p { font-family: var(--mono); font-size: 0.9375rem; line-height: 1.55; }

/* ---------- utility blocks for later assignments ---------- */

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.9375rem;
  margin: 0 0 1.5rem;
}
th, td {
  text-align: left;
  padding: 0.55rem 0.75rem 0.55rem 0;
  border-bottom: 1px solid var(--rule);
}
th { font-weight: 650; }

pre {
  overflow-x: auto;
  padding: 1rem;
  background: #e7eaec;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.5;
}
code { font-family: var(--mono); font-size: 0.9em; }
pre code { font-size: inherit; }

.note {
  padding: 1rem 1.25rem;
  background: #e7eaec;
  border-radius: 3px;
  font-size: 1rem;
  margin: 0 0 1.5rem;
}
.note p:last-child { margin-bottom: 0; }

.foot {
  grid-column: 1 / -1;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

/* ---------- narrow screens ---------- */

@media (max-width: 720px) {
  .page { grid-template-columns: 1fr; }
  .rail, .main { grid-column: 1; }
  .rail {
    position: static;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--rule);
  }
  .rail ol { display: flex; flex-wrap: wrap; gap: 1.25rem; }
  .rail li { margin-bottom: 0; }
  .masthead {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }
  .gizmo svg { width: 110px; height: 110px; }
}
