/* ============================================================
   Efficient AI · IIT Bombay — course site
   "A professor's annotated lecture notes": warm paper, graphite
   ink, one burnt-amber accent, hand-penciled marginalia.
   Type: Cormorant Garamond (headings) · Instrument Sans (body)
         Spline Sans Mono (dates)
   ============================================================ */

:root {
  --paper: #F2EFE8;
  --paper-2: #EAE6DB;
  --ink: #221E18;
  --prose: #575047;
  --muted: #8B8175;
  --line: #CDC5B4;
  --graphite: #45403A;
  --accent: #B26A2B;
  --accent-deep: #8E5220;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Spline Sans Mono", "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html {
  zoom: 0.8;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.02rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* paper grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  opacity: 0.30;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='280'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.wrap {
  max-width: 47rem;
  margin: 0 auto;
  padding-inline: 1.3rem;
}

/* schedule and references get more room to breathe */
.wrap.wide { max-width: 62rem; }

/* ------------------------------------------------------------ links */

a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s ease;
}

a:hover { text-decoration-color: var(--accent-deep); }

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0.5rem;
  z-index: 200;
  transform: translateY(-300%);
  background: var(--ink);
  color: var(--paper);
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.skip-link:focus { transform: none; }

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

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}

.site-head.scrolled { border-bottom-color: var(--line); }

/* the header runs wider than the reading column */
.site-head .wrap { max-width: 76rem; }

.head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.7rem;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.brand img {
  width: 34px;
  height: 34px;
  align-self: center;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1;
}

.brand-meta {
  font-size: 0.76rem;
  color: var(--muted);
}

.site-nav {
  display: flex;
  gap: 1.6rem;
  overflow-x: auto;
}

.site-nav a {
  font-size: 1rem;
  color: var(--prose);
  text-decoration: none;
  white-space: nowrap;
  padding-block: 0.2rem;
  border-bottom: 1px solid transparent;
}

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

.site-nav a.active {
  color: var(--accent-deep);
  border-bottom-color: var(--accent);
}

/* ------------------------------------------------------------ hero */

.hero {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding-top: 3.2rem;
  padding-bottom: 1rem;
}

.hero-text { flex: 1; }

.kicker {
  margin: 0 0 1.1rem;
  font-size: 0.88rem;
  color: var(--prose);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.circled {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.15em 0.35em;
  color: var(--ink);
}

.circled svg {
  position: absolute;
  inset: -0.4em -0.55em;
  width: calc(100% + 1.1em);
  height: calc(100% + 0.8em);
  overflow: visible;
}

.circled path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  filter: url(#pencil);
  opacity: 0.85;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.3rem, 5vw, 2.9rem);
  line-height: 1.1;
  letter-spacing: -0.005em;
  margin: 0 0 0.9rem;
}

.lede {
  max-width: 34rem;
  margin: 0 0 1.1rem;
  color: var(--prose);
  font-size: 1.04rem;
}

.facts {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.facts span { color: var(--prose); }

/* the margin sketch: a network being pruned */

.hero-sketch {
  margin: 0;
  flex-shrink: 0;
  width: 175px;
  text-align: center;
}

.hero-sketch svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.hero-sketch path,
.hero-sketch circle {
  fill: none;
  stroke: var(--graphite);
  stroke-width: 1.3;
  stroke-linecap: round;
  filter: url(#pencil);
}

.hero-sketch .sk-faint path { opacity: 0.16; }
.hero-sketch .sk-kept path { stroke-width: 1.6; opacity: 0.8; }
.hero-sketch .sk-x path { stroke: var(--accent); stroke-width: 1.4; opacity: 0.75; }
.hero-sketch .sk-node circle { fill: var(--paper); opacity: 0.85; }

/* ------------------------------------------------------------ sections */

.section {
  padding-block: 2.4rem 0.6rem;
  scroll-margin-top: 3.6rem;
}

.section h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.62rem;
  line-height: 1.15;
  margin: 0 0 1.2rem;
}

/* hand-drawn underline beneath each heading */
.scrawl {
  display: block;
  width: 108px;
  height: 8px;
  margin-top: 0.25rem;
}

.scrawl path {
  fill: none;
  stroke: var(--graphite);
  stroke-width: 1.5;
  stroke-linecap: round;
  filter: url(#pencil);
  opacity: 0.55;
}

.section-note {
  margin: -0.6rem 0 1.2rem;
  font-size: 0.93rem;
  color: var(--muted);
}

/* ------------------------------------------------------------ updates */

.updates {
  list-style: none;
  margin: 0;
  padding: 0;
}

.updates li {
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  gap: 0.9rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
}

.updates li:last-child { border-bottom: 1px solid var(--line); }

.u-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-deep);
  padding-top: 0.15rem;
}

.updates p { margin: 0; color: var(--prose); }

/* ------------------------------------------------------------ staff */

.people {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem 3.5rem;
}

.person {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  min-width: 16rem;
}

.avatar {
  position: relative;
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar svg {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.avatar circle {
  fill: var(--paper-2);
  stroke: var(--graphite);
  stroke-width: 1.4;
  filter: url(#pencil);
  opacity: 0.9;
}

.avatar b {
  position: relative;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.25rem;
  color: var(--accent-deep);
}

.person-info h3 {
  font-size: 1.04rem;
  font-weight: 600;
  margin: 0;
}

.role {
  margin: 0.05rem 0 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.contact {
  margin: 0;
  font-size: 0.9rem;
  color: var(--prose);
  line-height: 1.55;
}

/* ------------------------------------------------------------ logistics */

.loglist { margin: 0; }

.lrow {
  display: grid;
  grid-template-columns: 10.5rem 1fr;
  gap: 1.2rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
}

.lrow:last-child { border-bottom: 1px solid var(--line); }

.lrow dt {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 0.94rem;
  padding-top: 0.05rem;
}

.pic {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.pic path, .pic circle {
  fill: none;
  stroke: var(--graphite);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url(#pencil-soft);
  opacity: 0.8;
}

.lrow dd {
  margin: 0;
  color: var(--prose);
  font-size: 0.98rem;
}

.grading {
  list-style: none;
  margin: 0 0 0.4rem;
  padding: 0;
  display: grid;
  gap: 0.25rem;
  max-width: 20rem;
}

.grading li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.grading .leader {
  flex: 1;
  border-bottom: 1px dotted var(--line);
  transform: translateY(-3px);
}

.grading em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink);
}

.lrow small {
  color: var(--muted);
  font-size: 0.82rem;
}

/* ------------------------------------------------------------ contents */

.modules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.05rem;
}

.modules h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.24rem;
  margin: 0 0 0.15rem;
}

.mnum {
  font-style: italic;
  color: var(--accent-deep);
  margin-right: 0.15rem;
}

.modules p {
  margin: 0;
  color: var(--prose);
  font-size: 0.96rem;
  line-height: 1.65;
}

/* ------------------------------------------------------------ schedule */

.schedule {
  width: 100%;
  border-collapse: collapse;
}

.schedule th {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-bottom: 1.5px solid var(--graphite);
}

.schedule td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--prose);
  font-size: 0.96rem;
}

.schedule tbody tr:hover td { background: var(--paper-2); }

.schedule td:nth-child(1),
.schedule td:nth-child(2) {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  white-space: nowrap;
  padding-top: 0.72rem;
}

.schedule td:nth-child(1) { color: var(--muted); }
.schedule td:nth-child(2) { color: var(--accent-deep); }

.schedule td strong { color: var(--ink); font-weight: 600; }

.schedule td.none { color: var(--muted); }

/* resources column: real width, bold link labels like the description column */
.schedule th:last-child,
.schedule td:last-child { width: 16.5rem; }

.schedule td:last-child a {
  white-space: nowrap;
  font-weight: 600;
}

.schedule .milestone td {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--muted);
  text-align: center;
  padding: 0.55rem;
  background: var(--paper-2);
}

.schedule .milestone:hover td { background: var(--paper-2); }

/* ------------------------------------------------------------ references */

.refs {
  margin: 0;
  padding-left: 1.4rem;
  color: var(--prose);
  font-size: 0.96rem;
  display: grid;
  gap: 0.55rem;
}

.refs li { padding-left: 0.3rem; }

.refs li::marker {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
}

.refs em { color: var(--ink); }

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

.site-foot {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  padding-block: 1.4rem 2.2rem;
}

.site-foot p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 720px) {
  .head-row { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
  .site-nav { width: 100%; }
  .brand-meta { display: none; }

  .hero { flex-direction: column; align-items: flex-start; gap: 1.6rem; padding-top: 2.2rem; }
  .hero-sketch { width: 150px; align-self: center; }

  .lrow { grid-template-columns: 1fr; gap: 0.3rem; padding: 0.6rem 0; }

  .schedule thead { display: none; }
  .schedule, .schedule tbody, .schedule tr, .schedule td { display: block; }
  .schedule tr { border-bottom: 1px solid var(--line); padding: 0.7rem 0; }
  .schedule td { border: 0; padding: 0.1rem 0; }
  .schedule td:nth-child(1),
  .schedule td:nth-child(2) { display: inline-block; margin-right: 0.8rem; padding: 0 0 0.2rem; }
  .schedule td.none { display: none; }
  .schedule tbody tr:hover td { background: transparent; }
  .schedule .milestone { padding: 0.55rem 0; }
  .schedule .milestone td { background: var(--paper-2); padding: 0.5rem; }
}

/* ------------------------------------------------------------ motion */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
