/* ARCH 655 - clean, professional, modern */

:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #6b6b6b;
  --line: #e8e8e8;
  --soft: #f6f6f6;
  --accent: #1a1a1a;
  --max: 1180px;
  --pad: clamp(1.25rem, 4vw, 3rem);
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

a {
  color: var(--fg);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: opacity 0.25s var(--ease);
}

a:hover {
  opacity: 0.55;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.05rem;
}

.logo:hover {
  opacity: 1;
}

.logo__num {
  letter-spacing: -0.04em;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
}

.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.28em;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 10px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.nav-toggle span {
  display: block;
  height: 1.5px;
  background: var(--fg);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3.75px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3.75px) rotate(-45deg);
}

/* Main */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Home hero - Halo-inspired asymmetry */

.home-hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) var(--pad) clamp(2rem, 5vw, 3.5rem);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: end;
}

.home-hero__brand h1 {
  margin: 0;
  font-size: clamp(3.4rem, 10vw, 7.5rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
  font-weight: 800;
  text-transform: uppercase;
}

.home-hero__brand h1 span {
  display: block;
}

.home-hero__side {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding-bottom: 0.4rem;
}

.home-hero__tag {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.home-hero__mission {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.35;
}

.home-hero__meta {
  margin: 0;
  display: grid;
  gap: 0.7rem;
}

.home-hero__meta div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.75rem;
  align-items: baseline;
}

.home-hero__meta dt {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.home-hero__meta dd {
  margin: 0;
  font-size: 0.92rem;
  color: var(--fg);
  line-height: 1.4;
}

.home-hero__meta a {
  color: var(--fg);
  text-decoration: none;
}

.home-hero__meta a:hover {
  opacity: 0.55;
}

.scroll-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 2.75rem;
  margin-top: 0.35rem;
  text-decoration: none;
}

.scroll-indicator:hover {
  opacity: 1;
}

.scroll-indicator__track {
  position: relative;
  display: block;
  width: 1px;
  height: 100%;
  background: var(--line);
  overflow: hidden;
}

.scroll-indicator__mark {
  position: absolute;
  left: 50%;
  top: 0;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--fg);
  animation: scroll-mark 1.8s var(--ease) infinite;
}

@keyframes scroll-mark {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translateY(2.35rem);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-indicator__mark {
    animation: none;
    top: 55%;
    opacity: 1;
  }
}

.home-visual {
  max-width: min(1320px, 100%);
  margin: 0 auto;
  padding: 0 clamp(0.75rem, 2vw, 1.5rem) clamp(3rem, 7vw, 5rem);
}

.home-visual figure {
  margin: 0;
}

.home-visual img {
  width: 100%;
  height: auto;
  background: var(--soft);
}

.home-visual figcaption {
  margin-top: 0.85rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.home-quick {
  flex: 1;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  background-clip: content-box;
  border: none;
  min-height: clamp(22rem, 48vh, 34rem);
}

.home-quick a {
  background: var(--bg);
  padding: clamp(1.75rem, 3.5vw, 2.75rem) clamp(1.25rem, 2.5vw, 2rem);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  min-height: 100%;
  transition: background 0.3s var(--ease);
}

.home-quick a:hover {
  opacity: 1;
  background: var(--soft);
}

.home-quick__label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.home-quick__title {
  display: block;
  font-weight: 700;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  letter-spacing: -0.02em;
}

/* Page heroes */

.page,
.home {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--pad) clamp(3rem, 7vw, 5.5rem);
}

.home {
  padding: 0;
  max-width: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.page-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: end;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  padding-bottom: clamp(1.5rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line);
}

.page-hero__title h1 {
  margin: 0.35rem 0 0;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-weight: 800;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-hero__intro {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 28rem;
  justify-self: end;
}

.detail-hero {
  margin-bottom: clamp(2rem, 5vw, 3rem);
  padding-bottom: clamp(1.5rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line);
}

.detail-hero h1 {
  margin: 0.35rem 0 0;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-weight: 800;
  text-transform: uppercase;
}

.lecture-hero {
  margin-bottom: clamp(2rem, 4vw, 3rem);
  padding-bottom: clamp(1.5rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line);
  max-width: 46rem;
}

.lecture-hero h1 {
  margin: 0.45rem 0 0.85rem;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 800;
  text-transform: none;
}

.lecture-hero__meta {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.lecture-body {
  max-width: 46rem;
  font-size: 1.02rem;
  line-height: 1.7;
}

.lecture-body > p:first-child {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 1.75rem;
}

.lecture-body ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: lecture-item;
}

.lecture-body ol > li {
  counter-increment: lecture-item;
  position: relative;
  margin: 0 0 1.25rem;
  padding: 1.25rem 1.25rem 1.25rem 3.5rem;
  background: var(--soft);
  border: 1px solid var(--line);
}

.lecture-body ol > li::before {
  content: counter(lecture-item, decimal-leading-zero);
  position: absolute;
  left: 1rem;
  top: 1.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.lecture-body ol > li > p {
  margin: 0 0 0.65rem;
}

.lecture-body ol > li > p:last-child {
  margin-bottom: 0;
}

.lecture-body ol > li > p:first-child {
  font-weight: 700;
  color: var(--fg);
  font-size: 1.02rem;
  line-height: 1.4;
}

.lecture-body ul {
  margin: 0.65rem 0 0;
  padding-left: 1.1rem;
}

.lecture-body li + li {
  margin-top: 0.4rem;
}

.lecture-body a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lecture-body table {
  display: table;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
}

.lecture-body th,
.lecture-body td {
  padding: 0.7rem 0.85rem;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.75rem;
}

.meta-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.meta-value {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
}

/* Prose */

.prose {
  max-width: 48rem;
}

.prose:has(.card-grid),
.prose:has(.video-grid),
.prose:has(.calendar-panel),
.prose:has(.lecture-list),
.prose:has(.phase-block),
.gallery-page .prose,
.assignment-page .prose {
  max-width: none;
}

.assignment-image {
  margin: 0 0 var(--space-lg);
}

.assignment-image img {
  display: block;
  width: 100%;
  max-height: 28rem;
  object-fit: contain;
  background: #f3f3f3;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-weight: 800;
}

.prose h2 {
  margin-top: 2.5rem;
  font-size: 1.35rem;
  text-transform: uppercase;
}

.prose h3 {
  margin-top: 2rem;
  font-size: 1.1rem;
}

.prose p,
.prose li {
  color: #222;
}

.prose ul,
.prose ol {
  padding-left: 1.2rem;
}

.prose li + li {
  margin-top: 0.35rem;
}

.prose table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 1.5rem 0;
  display: table;
  overflow-x: auto;
  border: 1px solid var(--line);
}

.prose thead {
  background: var(--soft);
}

.prose th,
.prose td {
  text-align: left;
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.prose th {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.prose tbody tr:last-child td {
  border-bottom: 0;
}

.prose blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 2px solid var(--fg);
  color: var(--muted);
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

.prose strong {
  font-weight: 700;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--soft);
  padding: 0.1em 0.35em;
}

/* Lecture / assignment lists */

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem 1.75rem;
  max-width: none;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem 1rem;
  max-width: none;
  margin: 1.5rem 0 0;
}

.video-placeholder {
  margin: 0;
}

.video-placeholder__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #d8d8d8;
  display: grid;
  place-items: center;
}

.video-placeholder__play {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.45rem 0 0.45rem 0.75rem;
  border-color: transparent transparent transparent rgba(0, 0, 0, 0.35);
  margin-left: 0.15rem;
}

.video-placeholder figcaption {
  margin-top: 0.55rem;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
  word-break: break-word;
}

.gallery-content {
  max-width: none;
}

.gallery-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1.25rem 0 0;
  border: 1px solid var(--line);
}

.gallery-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 0 !important;
  display: table !important;
  border: 0 !important;
}

.gallery-table thead th {
  background: #2f2f2f;
  color: #fff;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 0.85rem 0.9rem;
  text-align: center;
  border-bottom: 0;
}

.gallery-table tbody td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  text-align: center;
}

.gallery-table tbody tr:nth-child(odd) td {
  background: #f0f0f0;
}

.gallery-table tbody tr:nth-child(even) td {
  background: #fff;
}

.gallery-table tbody tr:last-child td {
  border-bottom: 0;
}

.gallery-col-photo {
  width: 6.5rem;
}

.gallery-col-name {
  width: 10rem;
  font-weight: 600;
  text-align: left !important;
  white-space: nowrap;
}

.gallery-photo {
  width: 80px;
  height: 120px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  background: #ddd;
  border: 1px solid #999;
}

.gallery-thumb-link {
  display: inline-block;
  text-decoration: none;
}

.gallery-thumb-link:hover {
  opacity: 1;
}

.gallery-thumb {
  width: 160px;
  height: 120px;
  object-fit: contain;
  display: block;
  background: #e8e8e8;
  border: 2px solid #111;
}

.gallery-page .prose h2 {
  margin-top: 2rem;
}

.gallery-page .back-link {
  max-width: var(--max);
}

.calendar-panel {
  margin-top: 0.5rem;
}

.calendar-panel__frame {
  border: 1px solid var(--line);
  background: var(--bg);
  overflow: hidden;
}

.calendar-panel__iframe {
  display: block;
  width: 100%;
  min-height: clamp(28rem, 70vh, 44rem);
  height: 70vh;
  border: 0;
  filter: grayscale(1) contrast(1.04) brightness(1.02);
}

.calendar-panel__note {
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .calendar-panel__iframe {
    filter: grayscale(1);
  }
}

.card-link {
  display: block;
  text-decoration: none;
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}

.card-link:hover {
  opacity: 1;
  transform: translateY(-2px);
  border-color: var(--fg);
}

.card-link__meta {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.card-link__title {
  display: block;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.phase-block {
  margin-bottom: 3rem;
}

.phase-block h2 {
  margin: 0 0 1.25rem;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.lecture-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: none;
}

.lecture-list li {
  border-top: 1px solid var(--line);
}

.lecture-list a {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1rem;
  padding: 1rem 0;
  text-decoration: none;
  align-items: baseline;
}

.lecture-list a:hover {
  opacity: 1;
}

.lecture-list a:hover .lecture-list__title {
  opacity: 0.55;
}

.lecture-list__num {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.lecture-list__title {
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: opacity 0.25s var(--ease);
}

.lecture-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: stretch;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  max-width: none;
}

.lecture-nav__link {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  text-decoration: none;
  background: var(--bg);
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
  min-width: 0;
}

.lecture-nav__link:hover {
  opacity: 1;
  background: var(--soft);
  border-color: #cfcfcf;
}

.lecture-nav__link--prev {
  align-items: flex-start;
  justify-self: stretch;
  width: 100%;
}

.lecture-nav__link--next {
  align-items: flex-end;
  text-align: right;
  justify-self: stretch;
  width: 100%;
}

.lecture-nav__link--index {
  align-items: center;
  justify-content: center;
  justify-self: center;
  align-self: center;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.85rem 1rem;
}

.lecture-nav__dir {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.lecture-nav__name {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.lecture-nav__link.is-disabled {
  pointer-events: none;
  opacity: 0.4;
  background: transparent;
}

.back-link {
  margin-top: 3rem;
  font-size: 0.9rem;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: clamp(3rem, 8vw, 5.5rem);
  background: var(--soft);
  flex-shrink: 0;
}

.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2.75rem, 6vw, 4rem) var(--pad);
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-brand {
  margin: 0 0 0.35rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.footer-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.footer-links a {
  font-size: 0.85rem;
  text-decoration: none;
}

/* Minimal motion */

[data-animate] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

[data-animate].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  [data-animate] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .card-link,
  a {
    transition: none;
  }
}

/* Responsive */

@media (max-width: 900px) {
  .site-header__inner {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: flex;
    margin-left: auto;
  }

  .site-nav {
    display: none;
    width: 100%;
    padding-bottom: 0.5rem;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0.85rem;
    align-items: flex-start;
  }

  .home-hero,
  .page-hero {
    grid-template-columns: 1fr;
  }

  .page-hero__intro {
    justify-self: start;
  }

  .home-quick,
  .card-grid,
  .detail-meta {
    grid-template-columns: 1fr;
  }

  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .home-quick {
    grid-template-rows: none;
    min-height: 0;
  }
}

@media (max-width: 600px) {
  .lecture-list a {
    grid-template-columns: 3.5rem 1fr;
  }

  .lecture-nav {
    grid-template-columns: 1fr;
  }

  .lecture-nav__link--prev,
  .lecture-nav__link--next,
  .lecture-nav__link--index {
    justify-self: stretch;
    align-items: flex-start;
    text-align: left;
  }

  .lecture-body ol > li {
    padding-left: 1.15rem;
    padding-top: 2.4rem;
  }

  .lecture-body ol > li::before {
    left: 1.15rem;
    top: 1rem;
  }
}
