/* ============================================================
   ECE 196 — Editorial Case Study Stylesheet
   Drop-in: link this in the <head> of every page.
   <link rel="stylesheet" href="styles.css">
   ============================================================ */
 
/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT,WONK@9..144,300..900,0..100,0..1&family=Inter+Tight:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');
 
/* ---------- Design tokens ---------- */
:root {
  --bg:        #f5f2ec;          /* warm paper */
  --bg-alt:    #ebe7de;          /* slightly deeper paper */
  --ink:       #1a1a1a;          /* near-black */
  --ink-soft:  #4a4a4a;          /* muted body */
  --rule:      #d8d2c4;          /* hairline dividers */
  --accent:    #5a7d6e;          /* sage / clinical green */
  --accent-dk: #3f5b4f;          /* hover state */
  --highlight: #e8d9a8;          /* subtle marker */
 
  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-body:    'Inter Tight', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;
 
  --max-width: 1180px;
  --content-width: 720px;
}
 
/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
 
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  letter-spacing: -0.005em;
  /* subtle paper grain */
  background-image:
    radial-gradient(circle at 25% 30%, rgba(0,0,0,0.012) 1px, transparent 1px),
    radial-gradient(circle at 75% 60%, rgba(0,0,0,0.012) 1px, transparent 1px);
  background-size: 4px 4px, 6px 6px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
 
/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--ink);
  margin: 0 0 0.6em;
  font-variation-settings: "opsz" 144, "SOFT" 30;
}
 
h1 { font-size: clamp(2.8rem, 6vw, 5rem); font-weight: 300; }
h2 { font-size: clamp(2rem, 3.5vw, 3rem); margin-top: 2.5em; }
h3 { font-size: 1.4rem; font-weight: 500; margin-top: 2em; }
h4 { font-size: 1.1rem; font-weight: 600; }
 
p { margin: 0 0 1.2em; color: var(--ink-soft); max-width: 65ch; }
 
a {
  color: var(--accent);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 100% 1px;
  transition: background-size 0.25s ease, color 0.25s ease;
}
a:hover {
  color: var(--accent-dk);
  background-size: 100% 2px;
}
 
strong { font-weight: 600; color: var(--ink); }
em { font-style: italic; }
 
/* small-caps labels */
.eyebrow, .label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
}
 
/* ---------- Layout ---------- */
main, header, footer { padding-inline: clamp(1.5rem, 5vw, 4rem); }
 
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-block: 4rem 6rem;
}
 
section {
  margin-block: 5rem;
  position: relative;
}
 
/* numbered sections — if you add data-num="01" to <section> */
section[data-num]::before {
  content: attr(data-num);
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--rule);
  grid-column: 1 / -1;
}
 
/* ---------- Header / Nav ---------- */
header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-block: 2rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  border-bottom: 1px solid var(--rule);
}
 
header h1, header > a:first-child {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  background: none;
  margin: 0;
}
 
nav ul {
  display: flex;
  list-style: none;
  gap: 1.8rem;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}
 
nav a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  background: none;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: none;
}
nav a.current { color: var(--ink); border-bottom-color: var(--ink); }
 
/* ---------- Hero (homepage h1 area, single-column fallback) ---------- */
main > h1:first-child {
  margin-top: 2rem;
  max-width: 14ch;
  font-size: clamp(3rem, 7vw, 5.5rem);
}
 
/* ---------- Buttons / CTAs ---------- */
.btn, a.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 0.95rem 1.6rem;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  border-radius: 0;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  background-image: none;
}
.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  transform: translateY(-2px);
}
 
.btn--ghost {
  background: transparent;
  color: var(--ink);
}
.btn--ghost:hover { background: var(--ink); color: var(--bg); }
 
/* ---------- Hero (two-column: text + image) ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  margin-top: 2.5rem;
  margin-bottom: 6rem;
}
 
.hero-text h1 {
  font-size: clamp(2rem, 3.5vw, 3rem);
  margin-top: 1rem;
  max-width: 14ch;
}
 
.hero-text .lede {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.1rem, 1.5vw, 1.35rem);
  font-weight: 300;
  line-height: 1.45;
  color: var(--ink);
  margin: 0 0 2rem;
  max-width: 50ch;
}
.hero-text .byline {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  font-weight: 300;
  font-style: normal;
  color: var(--ink-soft);
  margin: -0.5rem 0 1.5rem;
  line-height: 1.4;
  letter-spacing: -0.005em;
}
 
.cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 1.8rem;
}
.brand-mark {
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.brand-mark img {
  display: block;
  max-width: 480px;
  width: auto;
  height: auto;
}
.hero-image {
  margin: 0;
  position: relative;
}
 
.hero-image .frame {
  position: relative;
  aspect-ratio: 3 / 2;
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  overflow: hidden;
  background-image:
    repeating-linear-gradient(45deg, transparent 0 24px, rgba(0,0,0,0.018) 24px 25px);
}
 
.hero-image .frame::before {
  content: "Hero image";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
 
.hero-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
  z-index: 1;
}
 
.hero-image figcaption {
  font-family: var(--font-mono);
  font-size: 0.45rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 0.9rem;
}
 
@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-bottom: 4rem;
  }
  .hero-image { order: -1; }
}
 
/* ---------- Page intro (subpage centered heading block) ---------- */
.page-intro {
  text-align: center;
  margin-top: 2rem;
  margin-bottom: 5rem;
  max-width: 780px;
  margin-inline: auto;
}
.page-intro h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  margin: 0.8rem auto 1rem;
  max-width: 16ch;
}
.page-intro .lede {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  font-weight: 300;
  line-height: 1.5;
  color: var(--ink);
  margin: 0 auto;
  max-width: 60ch;
}
 
/* ---------- Team member section (alternating 2-col) ---------- */
.member {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  margin-block: 5rem;
}
 
.member--reverse .member-photo { grid-column: 2; grid-row: 2;}
.member--reverse .member-info  { grid-column: 1; grid-row: 2;}
 
.member-photo { margin: 0; }
.member-photo .frame {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  overflow: hidden;
}

.member-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: none;
}
 
.member-info h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.9rem, 3.5vw, 2.8rem);
  margin: 0.5rem 0 0.8rem;
  line-height: 1.05;
  letter-spacing: -0.025em;
}
.member-info .lede {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  font-weight: 300;
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 2rem;
  max-width: none;
}
.member-info .label {
  display: block;
  margin: 2rem 0 0.9rem;
}
.member-info ul.dash {
  margin-bottom: 0;
  color: var(--ink);
}
 
/* ---------- Tags ---------- */
.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 1.8rem;
}
.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 7px 13px;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  background: transparent;
}
.tag--accent {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
 
/* ---------- Page-end back link ---------- */
.page-end {
  margin-top: 5rem;
  padding-top: 2.2rem;
  border-top: 1px solid var(--rule);
  text-align: center;
}
.back-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
  background: none;
}
.back-link:hover {
  color: var(--accent);
  background: none;
}
 
/* ---------- Member mobile stacking ---------- */
@media (max-width: 700px) {
  .member {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .member--reverse .member-photo,
  .member--reverse .member-info {
    grid-column: 1;
    grid-row: auto;
  }
}
 
/* ---------- Lists ---------- */
ul, ol {
  padding-left: 1.2em;
  color: var(--ink-soft);
  max-width: 65ch;
}
ul { list-style: none; padding-left: 0; }
ul li, ol li { margin-bottom: 0.5em; }
 
/* opt-in: <ul class="dash"> for editorial dash bullets */
ul.dash li::before {
  content: "—";
  color: var(--accent);
  margin-right: 0.8em;
  font-weight: 500;
}
 
/* ---------- Cards / Section grid ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
  list-style: none;
  padding: 0;
  max-width: none;
}
.cards li { margin: 0; }
.cards li::before { content: none; }
 
.card,
.cards li > a {
  display: block;
  padding: 1.8rem;
  height: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  transition: transform 0.3s ease, border-color 0.3s, background 0.3s;
  background-image: none;
  color: var(--ink);
}
.card:hover,
.cards li > a:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  background: var(--bg);
}
.cards h3 { margin-top: 0; }
.cards p { color: var(--ink-soft); margin-bottom: 0; }
 
/* ---------- Tables (handy for milestones / specs) ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
}
th, td {
  text-align: left;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--rule);
}
th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 500;
}
 
/* ---------- Code & data ---------- */
code, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-alt);
  padding: 0.15em 0.4em;
  border-radius: 2px;
}
pre {
  padding: 1.2rem 1.4rem;
  overflow-x: auto;
  border-left: 3px solid var(--accent);
}
 
/* ---------- Images / figures ---------- */
img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--rule);
}
figure { margin: 2.5rem 0; }
figcaption {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 0.8rem;
  letter-spacing: 0.05em;
}
 
/* ---------- Blockquote / pull quote ---------- */
blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.4rem;
  line-height: 1.4;
  border-left: 2px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 2.5rem 0;
  color: var(--ink);
  max-width: 60ch;
}
 
/* ---------- Footer ---------- */
footer {
  max-width: var(--max-width);
  margin: 0 auto;
  margin-top: 6rem;
  padding-block: 2.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}
footer a { color: var(--ink-soft); }
footer a:hover { color: var(--accent); }
 
/* ---------- Page-load animation ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
 
main > * {
  animation: fadeUp 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
main > *:nth-child(1) { animation-delay: 0.05s; }
main > *:nth-child(2) { animation-delay: 0.15s; }
main > *:nth-child(3) { animation-delay: 0.25s; }
main > *:nth-child(4) { animation-delay: 0.35s; }
main > *:nth-child(5) { animation-delay: 0.45s; }
main > *:nth-child(n+6) { animation-delay: 0.55s; }
 
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
 
/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  header { flex-direction: column; align-items: flex-start; }
  nav ul { gap: 1rem; }
  main { padding-block: 2.5rem 4rem; }
  section { margin-block: 3rem; }
}