/* ==========================================================================
   Samrin Saleem — personal site styles
   Palette: blue-grey frame, cream card, ink/indigo/coral/teal accents.
   Fonts: DM Sans (everything), Fraunces italic (highlights only).
   Pages are generated by cms/lib/render.js; class names here must match it.
   ========================================================================== */

:root {
  --frame: #cfd9e4;
  --card: #f8f6f1;
  --ink: #16213a;
  --accent: #3b4cc0;
  --accent-light: #8a9af0;
  --accent-2: #e2725b;
  --accent-2-light: #f6c3b5;
  --accent-3: #1f6f78;
  --muted: #5c6578;
  --muted-dark: #343d52;
  --hairline: rgba(22, 33, 58, 0.12);
  --paper: #efe9da;
}

/* --------------------------------- Reset --------------------------------- */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--frame);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

p {
  font-size: 16px;
  line-height: 1.65;
}

li {
  font-size: 15px;
  line-height: 1.6;
}

em,
i {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1.06em;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

ul,
ol {
  padding: 0;
  margin: 0;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

::selection {
  background: rgba(59, 76, 192, 0.18);
  color: var(--ink);
}

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

/* ------------------------------- Layout ---------------------------------- */

.frame {
  padding: 40px;
  min-height: 100vh;
}

.card {
  position: relative;
  background: var(--card);
  border-radius: 28px;
  min-height: calc(100vh - 80px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* -------------------------------- Top bar --------------------------------- */

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 28px 40px;
  border-bottom: 1px solid var(--hairline);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  flex-shrink: 0;
}

.brand-mark {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.brand span {
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.01em;
  line-height: 1;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 22px;
  flex: 1;
}

.nav a,
.socials a {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink);
  opacity: 0.7;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: opacity 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nav a:hover,
.socials a:hover {
  opacity: 1;
  color: var(--accent);
}

.nav a[aria-current="page"] {
  opacity: 1;
  border-bottom-color: var(--ink);
}

.socials {
  display: flex;
  gap: 16px;
  flex-shrink: 0;
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 9px 16px;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  cursor: pointer;
}

.menu-toggle i {
  display: block;
  width: 14px;
  height: 8px;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  font-size: 0;
}

/* -------------------------------- Hero ------------------------------------ */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: clamp(620px, calc(100vh - 80px - 90px), 940px);
  padding: 40px 40px 56px;
}

.connectome {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero-text {
  position: relative;
  z-index: 2;
  max-width: min(660px, 100%);
}

.eyebrow {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.18em;
  font-weight: 500;
  color: var(--muted);
  margin: 0 0 14px;
}

.eyebrow a:hover {
  color: var(--accent);
}

.display,
.display-md,
.display-lg {
  font-weight: 500;
  font-optical-sizing: auto;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.display {
  font-size: clamp(64px, 9vw, 150px);
  line-height: 0.98;
}

.display-line {
  display: block;
}

.display-indent {
  margin-left: 1.2em;
}

.hero-role {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(20px, 2vw, 28px);
  color: var(--accent);
  margin: 18px 0 0;
  max-width: 34ch;
  line-height: 1.25;
}

/* -------------------------------- Pills ------------------------------------ */

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.pill:hover {
  background: var(--ink);
  color: var(--card);
}

.pill-solid {
  background: var(--ink);
  color: var(--card);
}

.pill-solid:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--card);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* ------------------------------- Sections ---------------------------------- */

.section {
  position: relative;
  padding: 96px 40px;
  border-top: 1px solid var(--hairline);
}

.display-md {
  font-size: clamp(34px, 4.6vw, 64px);
  line-height: 1.05;
  max-width: 22ch;
  margin: 18px 0 0;
}

.display-lg {
  font-size: clamp(44px, 7vw, 110px);
  line-height: 1.05;
  margin: 18px 0 0;
}

.display-md em,
.display-lg em,
.display em {
  font-family: 'Fraunces', serif;
  font-style: italic;
  color: var(--accent);
  font-weight: 300;
  font-size: 1.06em;
}

/* Text blocks generated from the CMS markup */

.prose p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted-dark);
  margin: 0 0 18px;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose ul {
  list-style: none;
  margin: 0 0 18px;
}

.prose li {
  position: relative;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted-dark);
  padding-left: 18px;
  margin-bottom: 8px;
}

.prose li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
}

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

/* Links written into the text: always visibly underlined, like the reference. */
.prose a,
.display-md a,
.display-lg a,
.contact-lead a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent-2);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.prose a:hover,
.display-md a:hover,
.display-lg a:hover,
.contact-lead a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ------------------------------ Page head & blocks -------------------------- */

[hidden] {
  display: none !important;
}

.page-head {
  padding: 72px 40px 24px;
}

.page-head .display-md {
  margin-bottom: 0;
}

.block {
  position: relative;
  padding: 56px 40px;
  border-top: 1px solid var(--hairline);
  scroll-margin-top: 16px;
}

.block-title {
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 28px;
  color: var(--ink);
}

.block > .prose,
.fold-body > .prose {
  max-width: 70ch;
}

.block-prose.style-lead {
  border-top: 0;
  padding-top: 24px;
}

.style-lead .prose {
  max-width: 62ch;
}

.style-lead .prose p {
  font-size: 19px;
}

.block-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.soon,
.soon-inline {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.soon {
  margin-top: 18px;
}

/* Hero text on the home page */

.hero-intro {
  max-width: 58ch;
  margin-top: 24px;
}

.hero-intro p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted-dark);
  margin: 0 0 12px;
}

.hero-cta {
  margin-top: 24px;
}

/* Plain bulleted lists */

.plain-list {
  list-style: none;
  max-width: 70ch;
}

.plain-list li {
  position: relative;
  font-size: 17px;
  line-height: 1.55;
  color: var(--muted-dark);
  padding-left: 20px;
  margin-bottom: 10px;
}

.plain-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
}

.plain-list.compact li {
  font-size: 15px;
  margin-bottom: 6px;
}

.block-list .plain-list {
  columns: 2 320px;
  column-gap: 48px;
  max-width: none;
}

.block-list .plain-list li {
  break-inside: avoid;
}

/* Selected work cards */

.work-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.work-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.55);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.work-card:hover {
  transform: translateY(-3px);
  border-color: rgba(22, 33, 58, 0.3);
}

.work-thumb {
  aspect-ratio: 16 / 9;
  background: var(--paper);
}

.work-thumb img,
.feed-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-placeholder,
.feed-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 24% 30%, rgba(59, 76, 192, 0.22) 0 7%, transparent 8%),
    radial-gradient(circle at 70% 62%, rgba(226, 114, 91, 0.3) 0 9%, transparent 10%),
    radial-gradient(circle at 46% 78%, rgba(31, 111, 120, 0.25) 0 6%, transparent 7%),
    linear-gradient(135deg, rgba(59, 76, 192, 0.07), rgba(226, 114, 91, 0.1));
}

.work-body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.work-body h3 {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.work-body h3 a::after {
  content: '';
  position: absolute;
  inset: 0;
}

.work-body p {
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted-dark);
}

.work-body .work-tags {
  margin-top: auto;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.block-cards .block-links {
  margin-top: 32px;
}

/* Numbered research interests */

.interests {
  list-style: none;
  max-width: 76ch;
}

.interests li {
  padding: 26px 0;
  border-top: 1px solid var(--hairline);
}

.interests li:first-child {
  border-top: 0;
  padding-top: 0;
}

.interests h3 {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.interests .num {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  color: var(--accent-2);
  margin-right: 4px;
}

/* Expandable blocks */

.fold summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}

.fold summary::-webkit-details-marker {
  display: none;
}

.fold summary .block-title {
  margin: 0;
}

.fold summary::after {
  content: '+';
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  transition: background 0.2s ease, color 0.2s ease;
}

.fold[open] summary::after {
  content: '−';
}

.fold summary:hover::after {
  background: var(--ink);
  color: var(--card);
}

.fold-body {
  margin-top: 28px;
}

/* Entries: projects and writing */

.entry-group {
  margin-top: 44px;
}

.entry-group:first-of-type {
  margin-top: 8px;
}

.group-title {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(22px, 2.4vw, 28px);
  color: var(--accent);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}

.entry {
  padding: 28px 0;
  border-bottom: 1px solid var(--hairline);
  scroll-margin-top: 24px;
  max-width: 78ch;
  overflow-wrap: anywhere;
}

.entry-title {
  font-size: clamp(21px, 2.2vw, 25px);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--ink);
}

.entry-context {
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.05em;
  color: var(--accent-3);
  font-weight: 500;
  margin-top: 8px;
}

.entry-text {
  margin-top: 14px;
}

.entry-text p {
  font-size: 16px;
}

.entry-figure {
  margin: 16px 0 4px;
  max-width: 420px;
}

.entry-figure img {
  border-radius: 8px;
  border: 1px solid var(--hairline);
}

.entry-results {
  margin-top: 18px;
  padding: 16px 20px;
  background: rgba(59, 76, 192, 0.05);
  border-radius: 12px;
}

.entry-results h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin: 0 0 8px;
}

.entry-results ul {
  list-style: none;
}

.entry-results li {
  font-size: 15px;
  color: var(--muted-dark);
  margin: 2px 0;
}

.entry-results p {
  font-size: 15px;
  margin-top: 10px;
  color: var(--muted-dark);
}

.entry-note {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted-dark);
  margin-top: 14px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 10px;
  margin-top: 16px;
}

.tag-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tags li {
  font-size: 12.5px;
  line-height: 1.3;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(31, 111, 120, 0.1);
  color: var(--accent-3);
}

.entry-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 16px;
}

.entry-links a {
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--accent-2);
  text-underline-offset: 3px;
}

.entry-links a:hover {
  color: var(--accent);
}

.fulltext {
  margin-top: 16px;
}

.fulltext summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--accent-2);
  text-underline-offset: 3px;
}

.fulltext .prose {
  margin-top: 16px;
}

.entry:target,
.feed-card:target {
  background: linear-gradient(90deg, rgba(226, 114, 91, 0.1), transparent 70%);
  box-shadow: -16px 0 0 rgba(226, 114, 91, 0.1);
}

/* Filters */

.filters {
  display: grid;
  gap: 14px;
  margin: 0 0 28px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-right: 6px;
}

.chip {
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.chip:hover {
  border-color: var(--ink);
}

.chip.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--card);
}

.filter-tags summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-dark);
  text-decoration: underline;
  text-decoration-color: var(--accent-2);
  text-underline-offset: 3px;
}

.filter-tags .filter-row {
  margin-top: 12px;
}

.filter-empty {
  color: var(--muted);
  font-size: 15px;
}

/* Featured In feed */

.feed-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}

.feed-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.55);
  scroll-margin-top: 24px;
}

.feed-thumb {
  aspect-ratio: 16 / 9;
  background: var(--paper);
}

.feed-body {
  padding: 20px 22px 24px;
  overflow-wrap: anywhere;
}

.feed-media {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-2);
  margin-bottom: 8px;
}

.feed-body .entry-text p {
  font-size: 15px;
}

/* Grouped lists, skills and the coursework table */

.mini-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 36px 48px;
}

.mini-group:has(.table-wrap) {
  grid-column: 1 / -1;
}

.mini-group h3 {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips li {
  font-size: 14px;
  line-height: 1.3;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted-dark);
}

.table-wrap {
  overflow-x: auto;
}

.course-table {
  border-collapse: collapse;
  width: 100%;
  max-width: 760px;
  font-size: 15px;
}

.course-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 0 16px 10px 0;
  border-bottom: 1px solid var(--ink);
}

.course-table td {
  padding: 10px 16px 10px 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--muted-dark);
}

/* Leadership and CV cards */

.roles,
.downloads {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.roles li,
.download-card {
  padding: 24px;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
}

.roles h3,
.download-card h3 {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.role-line {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-3);
  margin-top: 8px;
}

.roles .prose,
.download-card p {
  margin-top: 12px;
}

.roles .prose p,
.download-card p {
  font-size: 15px;
  color: var(--muted-dark);
}

.download-card .pill {
  margin-top: 18px;
}

.download-card .soon {
  margin-top: 12px;
}

/* Personal interests: looser, more playful than the rest of the page */

.block-prose.style-playful {
  margin: 24px;
  padding: 56px 40px 64px;
  border: 0;
  border-radius: 28px;
  background: linear-gradient(135deg, #fbe5dc 0%, #f3e6f4 55%, #e3e9fb 100%);
}

.style-playful .block-title {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(36px, 5vw, 64px);
  color: var(--accent-2);
  letter-spacing: -0.02em;
}

.style-playful > .prose {
  max-width: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 22px;
  align-items: start;
}

.style-playful .prose p {
  margin: 0;
  padding: 24px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(22, 33, 58, 0.08);
  transform: rotate(-1.2deg);
}

.style-playful .prose p:nth-child(2) {
  transform: rotate(1deg) translateY(14px);
}

.style-playful .prose p:nth-child(3) {
  transform: rotate(-0.6deg);
}

.gallery {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 40px;
}

.gallery li {
  width: min(240px, 100%);
  padding: 10px 10px 14px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(22, 33, 58, 0.14);
  transform: rotate(-2deg);
}

.gallery li:nth-child(even) {
  transform: rotate(1.6deg);
}

.gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

/* Contact */

.contact-list {
  list-style: none;
  display: grid;
  gap: 16px;
}

.contact-list li {
  font-size: clamp(18px, 2vw, 22px);
  overflow-wrap: anywhere;
}

.contact-label {
  font-weight: 500;
  margin-right: 6px;
}

.contact-list a {
  text-decoration: underline;
  text-decoration-color: var(--accent-2);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

.contact-list a:hover {
  color: var(--accent);
}


/* -------------------------------- Footer ---------------------------------------- */

.footer {
  margin: 0 40px;
  padding: 24px 0 32px;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.footer a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent-2);
  text-underline-offset: 3px;
}

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

.glyph {
  font-size: 0.85em;
}

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

  .work-card {
    transition: none;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1000px) {
  .socials {
    display: none;
  }

}

@media (max-width: 820px) {
  .frame {
    padding: 16px;
  }

  .card {
    min-height: calc(100vh - 32px);
  }

  .topbar {
    padding: 18px 20px;
    flex-wrap: wrap;
    gap: 0;
  }

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

  .nav {
    display: none;
    flex: 0 0 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 14px 0 6px;
  }

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

  .nav a {
    padding: 9px 0;
    font-size: 12px;
  }

  .hero {
    padding: 20px;
    min-height: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .connectome {
    position: relative;
    inset: auto;
    width: calc(100% + 40px);
    height: 46vh;
    margin: 0 -20px;
  }

  .hero-text {
    max-width: none;
  }

  .hero-intro p {
    font-size: 17px;
  }

  .display {
    font-size: clamp(40px, 12vw, 72px);
  }

  .page-head {
    padding: 48px 20px 16px;
  }

  .block {
    padding: 40px 20px;
  }

  .block-prose.style-lead {
    padding-top: 16px;
  }

  .block-prose.style-playful {
    margin: 12px;
    padding: 40px 20px 48px;
  }

  .style-playful .prose p:nth-child(2) {
    transform: rotate(1deg);
  }

  .block-list .plain-list {
    columns: 1;
  }

  .fold summary::after {
    width: 32px;
    height: 32px;
  }

  .footer {
    margin: 0 20px;
    flex-direction: column;
    gap: 8px;
  }
}
