@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Roboto+Flex:opsz,wght@8..144,400;8..144,500;8..144,600;8..144,700&display=swap");

:root {
  --surface: #f9f9ff;
  --surface-dim: #cfdaf3;
  --surface-bright: #f9f9ff;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f0f3ff;
  --surface-container: #e8eeff;
  --surface-container-high: #dfe8ff;
  --surface-container-highest: #d8e3fc;
  --on-surface: #101c2e;
  --on-surface-variant: #414750;
  --inverse-surface: #263144;
  --inverse-on-surface: #ecf0ff;
  --outline: #717881;
  --outline-variant: #c0c7d2;
  --surface-tint: #0062a0;
  --primary: #00629f;
  --on-primary: #ffffff;
  --primary-container: #2b7bbd;
  --on-primary-container: #00050e;
  --inverse-primary: #9bcbff;
  --secondary: #7a5368;
  --on-secondary: #ffffff;
  --secondary-container: #ffcce5;
  --on-secondary-container: #7b5368;
  --tertiary: #923e6a;
  --on-tertiary: #ffffff;
  --tertiary-container: #b05683;
  --on-tertiary-container: #fffbff;
  --primary-fixed: #d0e4ff;
  --primary-fixed-dim: #9bcbff;
  --on-primary-fixed: #001d34;
  --on-primary-fixed-variant: #004a7a;
  --secondary-fixed: #ffd8ea;
  --secondary-fixed-dim: #eab9d1;
  --on-secondary-fixed: #2f1123;
  --on-secondary-fixed-variant: #603c50;
  --tertiary-fixed: #ffd8e7;
  --tertiary-fixed-dim: #ffafd2;
  --on-tertiary-fixed: #3d0025;
  --on-tertiary-fixed-variant: #782954;
  --background: #f9f9ff;
  --on-background: #101c2e;
  --surface-variant: #d8e3fc;
  --error: #ba1a1a;
  --font-display: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Roboto Flex", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius-sm: 0.25rem;
  --radius: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --content-width: 1120px;
  --wide-content-width: 1180px;
  --shadow-1: 0 1px 2px rgba(0, 98, 160, 0.08), 0 1px 1px rgba(16, 28, 46, 0.04);
  --shadow-2: 0 2px 8px rgba(0, 98, 160, 0.12), 0 1px 3px rgba(16, 28, 46, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, var(--surface-bright) 0, var(--surface) 300px, var(--surface-container-low) 100%);
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
[contenteditable="true"] {
  font: inherit;
}

button {
  letter-spacing: 0;
}

[contenteditable="true"] {
  outline: none;
  white-space: pre-wrap;
}

[contenteditable="true"]:focus-visible {
  border-color: var(--primary);
  box-shadow: inset 0 -2px 0 var(--primary), 0 0 0 4px rgba(0, 98, 159, 0.14);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(0, 98, 159, 0.28);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 clamp(16px, 5vw, 64px);
  border-bottom: 1px solid rgba(192, 199, 210, 0.72);
  background: rgba(249, 249, 255, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--on-surface);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 24px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  color: var(--on-surface-variant);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.active {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background: var(--surface-container-high);
  color: var(--on-surface);
  box-shadow: var(--shadow-1);
  cursor: pointer;
}

.menu-button span {
  width: 18px;
  height: 2px;
  border-radius: var(--radius-full);
  background: currentColor;
}

.hero {
  position: relative;
  display: grid;
  min-height: min(704px, calc(100svh - 136px));
  align-items: end;
  overflow: hidden;
  isolation: isolate;
}

.hero img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(249, 249, 255, 0.98) 0%, rgba(249, 249, 255, 0.9) 44%, rgba(249, 249, 255, 0.38) 78%, rgba(249, 249, 255, 0.08) 100%),
    linear-gradient(0deg, rgba(0, 98, 160, 0.12), rgba(255, 204, 229, 0.16));
}

.hero-content {
  width: min(var(--content-width), calc(100% - 128px));
  margin: 0 auto;
  padding: 72px 0 48px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 0 0 16px;
  padding: 6px 14px;
  border: 1px solid rgba(122, 83, 104, 0.18);
  border-radius: var(--radius-full);
  background: rgba(255, 204, 229, 0.82);
  color: var(--on-secondary-container);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  color: var(--on-surface);
  font-family: var(--font-display);
  font-size: 57px;
  font-weight: 400;
  line-height: 64px;
}

.hero h1 span {
  color: var(--primary-container);
  font-weight: 500;
}

.hero-copy {
  max-width: 640px;
  margin: 24px 0 32px;
  color: var(--on-surface-variant);
  font-size: 16px;
  line-height: 24px;
}

.profile-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(980px, 100%);
  overflow: hidden;
  border: 1px solid rgba(192, 199, 210, 0.8);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(12px);
}

.profile-strip div {
  min-width: 0;
  padding: 16px 20px;
  border-right: 1px solid rgba(192, 199, 210, 0.72);
}

.profile-strip div:last-child {
  border-right: 0;
}

.profile-strip span {
  display: block;
  color: var(--on-surface-variant);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.profile-strip strong {
  display: block;
  min-height: 32px;
  margin-top: 4px;
  border-bottom: 2px solid rgba(113, 120, 129, 0.34);
  color: var(--on-surface);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 24px;
  overflow-wrap: anywhere;
}

.page-section {
  width: min(var(--content-width), calc(100% - 128px));
  margin: 0 auto;
  padding: 80px 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 32px;
}

.project-index-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  max-width: none;
  gap: var(--space-lg);
}

.section-heading h2,
.assignment-index-page h1,
.assignment-top h1 {
  margin: 0;
  color: var(--on-surface);
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
  line-height: 40px;
}

.intro-grid,
.summary-grid,
.project-fields,
.assignment-grid {
  display: grid;
  gap: var(--space-lg);
}

.intro-grid,
.summary-grid {
  padding: var(--space-lg);
  border: 1px solid rgba(192, 199, 210, 0.72);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.42);
  box-shadow: var(--shadow-1);
}

.intro-grid,
.project-fields,
.assignment-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.field-block {
  min-width: 0;
}

.intro-grid .field-block,
.project-fields .field-block {
  grid-column: span 6;
}

.intro-grid .field-block.wide,
.project-fields .field-block.wide,
.wide {
  grid-column: 1 / -1;
}

.summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.intro-grid .field-block,
.summary-grid .field-block {
  padding: var(--space-md);
  border-radius: var(--radius-lg);
}

.intro-grid .field-block:nth-child(n + 2) {
  border-top: 1px solid rgba(192, 199, 210, 0.58);
}

.summary-grid .field-block + .field-block {
  border-left: 1px solid rgba(192, 199, 210, 0.58);
}

.field-block label {
  display: block;
  margin-bottom: var(--space-sm);
  color: var(--on-surface-variant);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.editable-line {
  min-height: 64px;
  padding: 16px;
  border: 1px solid transparent;
  border-bottom: 2px solid var(--outline-variant);
  border-radius: var(--radius-md) var(--radius-md) var(--radius-sm) var(--radius-sm);
  background: var(--surface-container);
  color: var(--on-surface);
  font-size: 16px;
  line-height: 24px;
  overflow-wrap: anywhere;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.editable-line:hover {
  background: var(--surface-container-high);
}

.editable-line.tall {
  min-height: 144px;
}

.intro-section .editable-line,
.summary-section .editable-line {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.intro-section .editable-line.tall,
.summary-section .editable-line.tall {
  min-height: 0;
}

.intro-section .editable-line:hover,
.summary-section .editable-line:hover {
  background: transparent;
}

.summary-section [contenteditable="true"]:focus-visible {
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 3px rgba(0, 98, 159, 0.14);
}

.assignment-grid .project-card {
  grid-column: span 6;
}

.project-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: var(--space-lg);
  min-height: 184px;
  padding: var(--space-lg);
  border: 1px solid rgba(192, 199, 210, 0.58);
  border-radius: var(--radius-lg);
  background: var(--surface-container-low);
  box-shadow: var(--shadow-1);
}

.assignment-card {
  color: inherit;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.assignment-card:hover,
.assignment-card:focus-visible {
  border-color: rgba(0, 98, 159, 0.34);
  background: var(--surface-container);
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}

.project-number {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--primary-fixed);
  color: var(--on-primary-fixed-variant);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 28px;
}

.project-card:nth-child(1) .project-number {
  background: var(--primary-fixed);
  color: var(--on-primary-fixed-variant);
}

.project-card:nth-child(2) .project-number {
  background: var(--secondary-fixed);
  color: var(--on-secondary-fixed-variant);
}

.project-card:nth-child(3) .project-number {
  background: #d3f5df;
  color: #1f5d37;
}

.project-card:nth-child(4) .project-number {
  background: #e6deff;
  color: #51408f;
}

.project-card:nth-child(5) .project-number {
  background: #c5ecf4;
  color: #00535e;
}

.project-card:nth-child(6) .project-number {
  background: var(--tertiary-fixed);
  color: var(--on-tertiary-fixed-variant);
}

.project-body {
  min-width: 0;
}

.project-body h3 {
  margin: 0 0 20px;
  color: var(--on-surface);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  line-height: 28px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
}

.project-link::after {
  content: "->";
  font-family: var(--font-body);
}

.summary-section {
  border-top: 1px solid var(--outline-variant);
}

.subpage-main {
  min-height: calc(100vh - 72px);
}

.assignment-index-page {
  padding-top: 88px;
}

.assignment-page {
  width: min(var(--wide-content-width), calc(100% - 128px));
  margin: 0 auto;
  padding: 72px 0 88px;
}

.assignment-top {
  max-width: 900px;
  margin-bottom: 32px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin-bottom: 16px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
}

.back-link::before {
  content: "<-";
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--on-primary-fixed-variant);
}

.assignment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background: var(--primary);
  color: var(--on-primary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.button-link::after {
  margin-left: 8px;
  content: "->";
}

.button-link:hover,
.button-link:focus-visible {
  background: var(--primary-container);
  box-shadow: var(--shadow-1);
}

.button-link.secondary {
  background: var(--primary-fixed);
  color: var(--on-primary-fixed-variant);
}

.button-link.secondary:hover,
.button-link.secondary:focus-visible {
  background: var(--primary-fixed-dim);
  border-color: rgba(0, 98, 159, 0.18);
}

.pdf-stage {
  overflow: hidden;
  border: 1px solid rgba(192, 199, 210, 0.72);
  border-radius: var(--radius-xl);
  background: var(--surface-container-lowest);
  box-shadow: var(--shadow-2);
}

.pdf-object {
  display: block;
  width: 100%;
  height: min(86vh, 980px);
  min-height: 680px;
  border: 0;
}

.pdf-placeholder {
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 32px;
  color: var(--on-surface-variant);
  text-align: center;
}

.pdf-placeholder a {
  color: var(--primary);
  font-weight: 700;
}

@media (max-width: 880px) {
  html {
    scroll-padding-top: 84px;
  }

  .menu-button {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 72px;
    right: 16px;
    display: none;
    width: min(320px, calc(100vw - 32px));
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    border: 1px solid rgba(192, 199, 210, 0.72);
    border-radius: var(--radius-xl);
    background: var(--surface-container-high);
    box-shadow: var(--shadow-2);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    border-radius: var(--radius-lg);
  }

  .hero {
    min-height: calc(100svh - 128px);
  }

  .hero-overlay {
    background:
      linear-gradient(180deg, rgba(249, 249, 255, 0.96) 0%, rgba(249, 249, 255, 0.86) 64%, rgba(249, 249, 255, 0.7) 100%),
      linear-gradient(0deg, rgba(0, 98, 160, 0.12), rgba(255, 204, 229, 0.16));
  }

  .hero-content {
    width: min(var(--content-width), calc(100% - 32px));
    padding: 48px 0 40px;
  }

  .hero h1 {
    max-width: 560px;
    font-size: 48px;
    line-height: 56px;
  }

  .profile-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-strip div {
    border-right: 1px solid rgba(192, 199, 210, 0.72);
    border-bottom: 1px solid rgba(192, 199, 210, 0.72);
  }

  .profile-strip div:nth-child(2n) {
    border-right: 0;
  }

  .profile-strip div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .page-section,
  .assignment-page {
    width: min(var(--content-width), calc(100% - 32px));
  }

  .page-section {
    padding: 64px 0;
  }

  .intro-grid,
  .project-fields,
  .assignment-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .intro-grid .field-block,
  .project-fields .field-block,
  .assignment-grid .project-card {
    grid-column: 1 / -1;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid .field-block + .field-block {
    border-top: 1px solid rgba(192, 199, 210, 0.58);
    border-left: 0;
  }

  .project-index-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-card {
    min-height: 168px;
  }

  .assignment-page {
    padding-top: 56px;
  }

  .pdf-object {
    height: 76vh;
    min-height: 560px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
    line-height: 22px;
  }

  .site-header {
    min-height: 64px;
  }

  .site-nav {
    top: 64px;
  }

  .brand span:last-child {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero {
    min-height: auto;
    align-items: start;
  }

  .hero-content {
    padding: 36px 0 32px;
  }

  .eyebrow {
    max-width: 100%;
    min-height: 28px;
    padding: 4px 10px;
    font-size: 12px;
    line-height: 16px;
  }

  .hero h1 {
    font-size: 36px;
    line-height: 44px;
  }

  .hero-copy {
    margin: 18px 0 24px;
    font-size: 15px;
    line-height: 22px;
  }

  .profile-strip div {
    padding: 12px;
  }

  .profile-strip span {
    font-size: 12px;
    line-height: 16px;
  }

  .profile-strip strong {
    min-height: 28px;
    font-size: 0.92rem;
    line-height: 22px;
  }

  .section-heading {
    margin-bottom: 24px;
  }

  .intro-section {
    padding-top: 32px;
  }

  .section-heading h2,
  .assignment-index-page h1,
  .assignment-top h1 {
    font-size: 28px;
    line-height: 36px;
  }

  .project-card {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: var(--space-md);
    min-height: 160px;
    padding: 20px;
  }

  .project-number {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    font-size: 1rem;
  }

  .project-body h3 {
    margin-bottom: 16px;
    font-size: 19px;
    line-height: 26px;
  }

  .assignment-actions,
  .button-link {
    width: 100%;
  }

  .button-link {
    padding-right: 14px;
    padding-left: 14px;
  }

  .pdf-stage {
    border-radius: var(--radius-lg);
  }

  .pdf-object {
    height: 72vh;
    min-height: 460px;
  }
}

@media print {
  .site-header {
    display: none;
  }

  body {
    background: #fff;
    color: #111;
  }

  .hero {
    min-height: auto;
  }

  .hero img,
  .hero-overlay {
    display: none;
  }

  .hero-content,
  .page-section {
    width: 100%;
    padding: 28px 0;
  }

  .profile-strip,
  .project-card,
  .pdf-stage {
    box-shadow: none;
  }

  .project-card {
    break-inside: avoid;
  }
}
