/* Yongluan Ye — portfolio */
:root {
  --ink: #1a2a32;
  --ink-soft: #3d525c;
  --mist: #e8eef1;
  --paper: #f7f9fa;
  --teal: #2a6f6b;
  --teal-deep: #1e5350;
  --teal-soft: #d4e8e6;
  --sand: #c4a574;
  --white: #ffffff;
  --line: rgba(26, 42, 50, 0.12);
  --shadow: 0 18px 40px rgba(26, 42, 50, 0.08);
  --radius: 4px;
  --font-display: "Source Serif 4", "Palatino Linotype", Palatino, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --max: 1100px;
  --nav-h: 4.25rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(ellipse 90% 60% at 10% -10%, rgba(42, 111, 107, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 50% at 95% 5%, rgba(196, 165, 116, 0.16), transparent 50%),
    linear-gradient(180deg, #f0f5f6 0%, var(--paper) 40%, #eef3f4 100%);
  min-height: 100vh;
}

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

a {
  color: var(--teal-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--teal);
}

h1,
h2,
h3,
.brand {
  font-family: var(--font-display);
  font-weight: 550;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  margin: 0 0 0.75rem;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin: 0 0 0.75rem;
}

h3 {
  font-size: 1.25rem;
  margin: 0 0 0.4rem;
}

p {
  margin: 0 0 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* —— Nav —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(247, 249, 250, 0.88);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--nav-h);
}

.brand {
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  color: var(--teal-deep);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  padding: 0.45rem 0.7rem;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: var(--radius);
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav-list a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  color: var(--teal-deep);
}

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

/* —— Layout —— */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: 4.5rem 0;
}

.section--tight {
  padding: 3rem 0;
}

.section-kicker {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 38rem;
}

/* —— Hero —— */
.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 3.5rem 0 4rem;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(26, 42, 50, 0.72) 0%, rgba(30, 83, 80, 0.55) 48%, rgba(26, 42, 50, 0.35) 100%),
    radial-gradient(circle at 70% 40%, rgba(196, 165, 116, 0.25), transparent 45%),
    url("../assets/images/hero-atmosphere.svg") center / cover no-repeat;
  z-index: 0;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 5rem;
  background: linear-gradient(transparent, var(--paper));
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 2;
  color: var(--white);
  max-width: 36rem;
  animation: rise 0.9s ease-out both;
}

.hero .brand-mark {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 4.4rem);
  font-weight: 550;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 1rem;
  color: var(--white);
}

.hero .roles {
  font-size: 1rem;
  letter-spacing: 0.04em;
  opacity: 0.9;
  margin: 0 0 1.25rem;
  font-weight: 400;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.92;
  max-width: 32rem;
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.25rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn--primary {
  background: var(--teal);
  color: var(--white);
}

.btn--primary:hover {
  background: var(--teal-deep);
  color: var(--white);
}

.btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.55);
  color: var(--white);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.btn--outline {
  background: transparent;
  border-color: var(--teal);
  color: var(--teal-deep);
}

.btn--outline:hover {
  background: var(--teal-soft);
  color: var(--teal-deep);
}

/* —— Page hero (inner pages) —— */
.page-hero {
  padding: 3.25rem 0 2rem;
  animation: rise 0.7s ease-out both;
}

.page-hero h1 {
  margin-bottom: 0.5rem;
}

.page-hero--split .wrap {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 800px) {
  .page-hero--split .wrap {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 2.75rem;
  }
}

.page-hero-media {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--mist);
  box-shadow: var(--shadow);
  animation: fade-up 0.8s ease-out both;
}

.page-hero-media img {
  width: 100%;
  height: 100%;
  max-height: 280px;
  object-fit: cover;
  display: block;
}

.page-hero-media--tall img {
  max-height: 340px;
  object-position: center top;
}

.page-hero-media--full {
  max-width: 260px;
  margin-left: auto;
}

.page-hero-media--full img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: center;
}

.page-hero-media--captioned {
  display: flex;
  flex-direction: column;
}

.page-hero-media--captioned img {
  max-height: 220px;
}

.page-hero-media--captioned figcaption {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--ink-soft);
  padding: 0.7rem 0.85rem;
  background: rgba(255, 255, 255, 0.85);
  border-top: 1px solid var(--line);
}

.page-hero-media--graphic {
  box-shadow: none;
  background: transparent;
  border: none;
}

.page-hero-media--graphic img {
  max-height: 260px;
  object-fit: contain;
}

/* Full-width atmospheric band (optional elsewhere) */
.media-band {
  margin: 0 0 0.5rem;
  padding: 0 1.25rem;
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
}

.media-band figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.media-band img {
  width: 100%;
  max-height: min(280px, 36vw);
  object-fit: cover;
  display: block;
}

.media-band figcaption {
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding: 0.65rem 0 0;
}

.portrait-frame {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--mist);
}

.portrait-frame img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
}

/* About: text-first, compact visuals */
.about-intro {
  padding-top: 2.25rem;
  padding-bottom: 3rem;
  animation: rise 0.7s ease-out both;
}

.about-compact {
  display: grid;
  gap: 1.75rem;
  align-items: start;
}

@media (min-width: 800px) {
  .about-compact {
    grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
    gap: 2.5rem;
  }
}

.about-visuals {
  display: grid;
  gap: 0.85rem;
}

@media (max-width: 799px) {
  .about-visuals {
    max-width: 180px;
  }
}

.portrait-frame--compact {
  max-width: 220px;
}

.portrait-frame--compact img {
  aspect-ratio: 3 / 4;
}

.about-accent {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--mist);
}

.about-accent img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
}

.about-accent figcaption {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--ink-soft);
  padding: 0.45rem 0.55rem 0.55rem;
}

.about-copy h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin-bottom: 0.5rem;
}

.about-copy .lead {
  margin-bottom: 1.1rem;
}

.about-copy .prose p {
  margin-bottom: 0.85rem;
}

.about-glance {
  margin-top: 1.5rem;
}

.about-glance h2 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}

.about-glance-action {
  margin-top: 1.1rem;
  margin-bottom: 0;
}

.about-layout {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}

@media (min-width: 860px) {
  .about-layout {
    grid-template-columns: 0.85fr 1.15fr;
    gap: 3rem;
  }
}

.section-rule {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1.5rem;
}

.section-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* —— In-page jump links —— */
.jump-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.15rem;
  margin: 0 0 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.jump-nav-label {
  margin-right: 0.35rem;
  font-weight: 600;
  color: var(--ink);
}

.jump-nav a {
  color: var(--teal-deep);
  text-decoration: none;
  padding: 0.15rem 0.35rem;
}

.jump-nav a:hover,
.jump-nav a:focus-visible {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.jump-nav-sep {
  color: var(--line);
  user-select: none;
}

[id^="year-"],
#local,
#training,
#international {
  scroll-margin-top: calc(var(--nav-h) + 0.75rem);
}

/* —— Content blocks —— */
.prose {
  max-width: 42rem;
}

.prose--wide {
  max-width: 48rem;
}

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

.split {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}

@media (min-width: 800px) {
  .split {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3.5rem;
  }
}

.split--reverse > :first-child {
  order: 2;
}

@media (min-width: 800px) {
  .split--reverse > :first-child {
    order: 0;
  }
}

.panel {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
  padding: 1.5rem 1.6rem;
  border-radius: var(--radius);
}

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

.meta-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.meta-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.meta-list .label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal);
  font-weight: 600;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
}

.chip {
  font-size: 0.85rem;
  padding: 0.35rem 0.7rem;
  background: var(--teal-soft);
  color: var(--teal-deep);
  border-radius: var(--radius);
}

/* —— Timeline / entries —— */
.entry {
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
  animation: fade-up 0.6s ease-out both;
}

.entry:first-of-type {
  padding-top: 0;
}

.entry:last-child {
  border-bottom: none;
}

.entry--with-media {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 1rem;
  align-items: start;
}

@media (min-width: 640px) {
  .entry--with-media {
    grid-template-columns: 14rem 1fr;
    gap: 1.35rem;
  }
}

@media (min-width: 900px) {
  .entry--with-media {
    grid-template-columns: 16rem 1fr;
    gap: 1.5rem;
  }
}

.entry-thumb-trigger {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  border-radius: var(--radius);
}

.entry-thumb-trigger:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.entry-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--mist);
  display: block;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.entry-thumb-trigger:hover .entry-thumb {
  border-color: rgba(42, 111, 107, 0.45);
  box-shadow: 0 6px 18px rgba(26, 42, 50, 0.1);
}

/* —— Image lightbox —— */
.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}

.lightbox::backdrop {
  background: rgba(16, 28, 34, 0.78);
}

.lightbox-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 1.5rem;
  box-sizing: border-box;
  cursor: zoom-out;
}

.lightbox-img {
  display: block;
  max-width: min(94vw, 1080px);
  max-height: 86vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  cursor: default;
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 999px;
  background: rgba(247, 249, 250, 0.95);
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  background: var(--white);
  color: var(--teal-deep);
}

.lightbox-close:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

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

.entry-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 0.35rem;
}

.entry-org {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

.entry-abstract {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

.entry-dates {
  font-size: 0.9rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.entry ul {
  margin: 0.5rem 0 0;
  padding-left: 1.15rem;
  color: var(--ink-soft);
}

.entry li {
  margin-bottom: 0.35rem;
}

.entry cite,
.citation {
  font-style: normal;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.citation a {
  word-break: break-word;
}

/* —— Work grid (portfolio index) —— */
.work-grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 2rem;
}

@media (min-width: 640px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .work-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.work-link {
  display: block;
  padding: 1.5rem 1.4rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  height: 100%;
  transition: border-color 0.2s ease, transform 0.25s ease, box-shadow 0.25s ease;
  animation: fade-up 0.65s ease-out both;
}

.work-link:hover {
  border-color: var(--teal);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
}

.work-link h3 {
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.work-link p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0;
}

.work-link .arrow {
  display: inline-block;
  margin-top: 0.85rem;
  color: var(--teal);
  font-weight: 600;
  font-size: 0.9rem;
}

.work-link:nth-child(2) { animation-delay: 0.08s; }
.work-link:nth-child(3) { animation-delay: 0.16s; }
.work-link:nth-child(4) { animation-delay: 0.24s; }
.work-link:nth-child(5) { animation-delay: 0.32s; }
.work-link:nth-child(6) { animation-delay: 0.4s; }

/* —— Creative project list (title-first) —— */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 46rem;
  margin: 0;
}

.project-row,
a.project-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  background: var(--white);
  border: 1px solid rgba(26, 42, 50, 0.16);
  border-radius: 6px;
  text-decoration: none !important;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

a.project-row:hover,
a.project-row:focus-visible {
  border-color: var(--teal);
  background: rgba(212, 232, 230, 0.35);
  box-shadow: 0 8px 24px rgba(26, 42, 50, 0.06);
  color: inherit;
  text-decoration: none !important;
}

a.project-row:hover .project-row__cta,
a.project-row:focus-visible .project-row__cta {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.project-row__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.project-row__type {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--teal);
}

.project-row__title {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.25;
  font-weight: 550;
}

.project-row__desc {
  margin: 0.15rem 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.45;
}

.project-row__cta {
  margin-top: 0.45rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--teal-deep);
}

.project-row__thumb {
  width: 9rem;
  height: 9rem;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  flex-shrink: 0;
  background: var(--mist);
}

@media (min-width: 640px) {
  .project-row__thumb {
    width: 11rem;
    height: 11rem;
  }

  .project-row,
  a.project-row {
    padding: 1.15rem 1.25rem;
    gap: 1.25rem;
  }

  .project-row__title {
    font-size: 1.3rem;
  }
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}

.embed-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--mist);
  margin: 1.25rem 0;
}

.embed-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.project-video {
  display: block;
  width: 100%;
  max-height: 70vh;
  background: #0f1c22;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin: 1.25rem 0;
}

.project-figure {
  margin: 1.25rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}

.project-figure img {
  width: 100%;
  display: block;
}

.project-figure figcaption {
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.75);
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--teal-deep);
}

.back-link:hover {
  color: var(--teal);
}

.doc-card {
  display: grid;
  gap: 1.25rem;
  margin: 1.5rem 0 0;
  padding: 1.15rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  align-items: center;
}

@media (min-width: 640px) {
  .doc-card {
    grid-template-columns: minmax(140px, 220px) 1fr;
    gap: 1.5rem;
    padding: 1.35rem;
  }
}

.doc-card__thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.doc-card__label {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--teal);
}

.doc-card__body h3 {
  margin: 0 0 0.45rem;
  font-size: 1.2rem;
}

.doc-card__body p {
  margin: 0 0 0.85rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.doc-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0 !important;
}

.refs {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.refs h2 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}

/* —— Connect —— */
.social-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  max-width: 22rem;
}

.social-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.social-list a:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal-deep);
}

/* —— Connect / contact form —— */
.connect-layout {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}

@media (min-width: 860px) {
  .connect-layout {
    grid-template-columns: 1.35fr 0.85fr;
    gap: 3rem;
  }
}

.connect-form-heading {
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
}

.connect-form-intro {
  color: var(--ink-soft);
  max-width: 36rem;
  margin-bottom: 1.5rem;
}

.connect-aside h2 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.15rem;
  max-width: 36rem;
  position: relative;
}

.form-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  width: 100%;
}

.form-row label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.form-row input,
.form-row textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 0;
  font: inherit;
  line-height: 1.4;
  color: var(--ink);
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
}

.form-row input:focus,
.form-row textarea:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
  border-color: var(--teal);
}

.form-row textarea {
  resize: vertical;
  min-height: 8.5rem;
}

/* Honeypot: must stay invisible; bots that fill it get filtered */
.form-honey {
  display: none !important;
}

.contact-form .btn {
  align-self: flex-start;
}

.form-status {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  max-width: 36rem;
}

.form-status--success {
  background: var(--teal-soft);
  color: var(--teal-deep);
  border: 1px solid rgba(42, 111, 107, 0.25);
}

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.5rem;
  margin-top: 2rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-nav a {
  text-decoration: none;
  color: var(--ink-soft);
}

.footer-nav a:hover {
  color: var(--teal-deep);
}

/* —— 404 —— */
.error-page {
  padding-top: 4rem;
  padding-bottom: 5rem;
  min-height: 50vh;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
}

/* —— Animations —— */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* —— Mobile nav —— */
@media (max-width: 820px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(247, 249, 250, 0.98);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.25rem 1rem;
  }

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

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

  .nav-list a {
    display: block;
    padding: 0.75rem 0;
  }

  .site-header {
    position: sticky;
  }

  .nav-inner {
    position: relative;
  }
}
