@import url("./site-palette.css");

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, var(--accent-soft), transparent 24%),
    radial-gradient(circle at 82% 12%, var(--page-warm-glow), transparent 18%),
    linear-gradient(180deg, var(--page-bg-start) 0%, var(--page-bg-end) 100%);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

body[data-page="landing"] {
  min-height: 100vh;
  background: #0f1729;
  color: #f4f8ff;
  overflow-x: hidden;
}

body[data-page="portfolio"],
body[data-page="cv"] {
  min-height: 100vh;
  background: #0f1729;
  color: #f4f8ff;
  overflow-x: hidden;
}

body.portfolio-lightbox-open {
  overflow: hidden;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

.shell {
  min-height: 100vh;
}

.identity-home {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: 4.5rem 1.5rem 3.5rem;
  background:
    linear-gradient(180deg, rgba(15, 23, 41, 0.98) 0%, rgba(23, 34, 56, 0.98) 100%);
}

.particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.9;
}

.identity-home::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(180deg, rgba(15, 23, 41, 0.16), rgba(15, 23, 41, 0.48));
}

.identity-hero {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1120px, 100%);
  justify-items: center;
  text-align: center;
}

.identity-name {
  margin: 0;
  color: #fbfcff;
  font-size: 5.8rem;
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: 0;
}

.identity-role {
  margin: 0.7rem 0 0;
  color: #f4f8ff;
  font-size: 2.15rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
}

.identity-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
  margin-top: 1.85rem;
}

.identity-icon-link {
  display: inline-flex;
  width: 3.35rem;
  height: 3.35rem;
  align-items: center;
  justify-content: center;
  gap: 0;
  overflow: hidden;
  padding: 0;
  border: 2px solid rgba(244, 248, 255, 0.92);
  border-radius: 999px;
  color: #f4f8ff;
  text-decoration: none;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease,
    width 220ms ease;
}

.identity-icon-link:hover,
.identity-icon-link:focus-visible {
  width: 9.4rem;
  gap: 0.6rem;
  padding: 0 0.78rem;
  border-color: #88a9d8;
  background: rgba(136, 169, 216, 0.16);
  color: #ffffff;
  transform: translateY(-2px);
  outline: none;
}

.identity-icon-link svg {
  flex: 0 0 auto;
  width: 1.72rem;
  height: 1.72rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.identity-icon-link span {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  font-size: 0.98rem;
  font-weight: 500;
  transition:
    max-width 220ms ease,
    opacity 160ms ease;
}

.identity-icon-link:hover span,
.identity-icon-link:focus-visible span {
  max-width: 6rem;
  opacity: 1;
}

.portfolio-text-link:hover,
.portfolio-text-link:focus-visible {
  color: #b8ccee;
  outline: none;
}

.identity-copy {
  display: grid;
  gap: 0.85rem;
  width: min(1060px, 100%);
  margin-top: 3.1rem;
}

.identity-copy p {
  margin: 0;
  color: rgba(244, 248, 255, 0.96);
  font-size: 1.03rem;
  line-height: 1.55;
}

.portfolio-link-section {
  display: grid;
  gap: 0.55rem;
  justify-items: center;
  width: min(620px, 100%);
  margin-top: 2.15rem;
}

.portfolio-link-label {
  margin: 0;
  color: #88a9d8;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.portfolio-link-section h2 {
  margin: 0;
  color: rgba(244, 248, 255, 0.92);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0;
}

.portfolio-text-link {
  color: #f4f8ff;
  font-size: 1.02rem;
  font-weight: 700;
  text-decoration: none;
}

.portfolio-text-link::after {
  content: " ->";
}

.dark-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(15, 23, 41, 0.98) 0%, rgba(23, 34, 56, 0.98) 100%);
}

.dark-page::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 50% 0%, rgba(136, 169, 216, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(15, 23, 41, 0.08), rgba(15, 23, 41, 0.52));
}

.dark-page .particle-canvas {
  position: fixed;
}

.dark-page-content {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 4rem;
}

.dark-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 5.2rem;
}

.dark-nav-brand,
.dark-nav-links a,
.dark-nav-icon,
.dark-button {
  color: #f4f8ff;
  text-decoration: none;
}

.dark-nav-brand {
  font-size: 1.12rem;
  font-weight: 700;
}

.dark-nav-links,
.dark-icon-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
}

.dark-nav-links {
  width: 100%;
}

.dark-nav-icon {
  display: inline-grid;
  width: 2.85rem;
  height: 2.85rem;
  place-items: center;
  border: 2px solid rgba(244, 248, 255, 0.86);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.dark-nav-icon:hover,
.dark-nav-icon:focus-visible,
.dark-button:hover,
.dark-button:focus-visible,
.carousel-button:hover,
.carousel-button:focus-visible,
.carousel-dot:hover,
.carousel-dot:focus-visible {
  border-color: #88a9d8;
  background: rgba(136, 169, 216, 0.16);
  outline: none;
  transform: translateY(-2px);
}

.dark-nav-icon svg,
.dark-button svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.dark-hero {
  display: grid;
  justify-items: center;
  padding: 4.25rem 0 3.2rem;
  text-align: center;
}

.dark-kicker {
  margin: 0;
  color: #88a9d8;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dark-hero h1 {
  width: min(980px, 100%);
  margin: 0.75rem auto 0;
  color: #fbfcff;
  font-size: 4.8rem;
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: 0;
}

.dark-hero p:not(.dark-kicker),
.carousel-heading p:not(.dark-kicker),
.cv-summary p,
.cv-entry li,
.cv-compact-list li,
.cv-publication,
.cv-skill-item p,
.cv-contact-value {
  color: rgba(244, 248, 255, 0.82);
  line-height: 1.65;
}

.dark-hero > p:not(.dark-kicker) {
  width: min(790px, 100%);
  margin: 1rem auto 0;
  font-size: 1.08rem;
}

.dark-panel {
  border: 1px solid rgba(244, 248, 255, 0.12);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
}

.carousel-heading h2,
.project-slide h3,
.cv-entry-title {
  margin: 0;
  color: #fbfcff;
  letter-spacing: 0;
}

.carousel-heading h2 {
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.1;
}

.carousel-section {
  display: grid;
  gap: 1.35rem;
  margin-top: 2.6rem;
}

.carousel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(244, 248, 255, 0.1);
}

.carousel-heading > div:first-child {
  display: grid;
  gap: 0.6rem;
  width: min(780px, 100%);
}

.carousel-heading p {
  margin: 0;
}

.carousel-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.carousel-button {
  display: inline-grid;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  border: 1px solid rgba(244, 248, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: #f4f8ff;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.carousel-button svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.project-carousel {
  --project-slide-height: 390px;

  display: flex;
  align-items: stretch;
  gap: 1.2rem;
  height: calc(var(--project-slide-height) + 0.9rem);
  overflow-x: auto;
  margin-inline: -0.35rem;
  padding: 0.2rem 0.35rem 0.7rem;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  transition: height 180ms ease;
}

.project-carousel::-webkit-scrollbar {
  display: none;
}

.project-carousel:focus-visible {
  outline: 2px solid rgba(136, 169, 216, 0.9);
  outline-offset: 0.35rem;
}

.project-slide {
  display: grid;
  flex: 0 0 100%;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 0.68fr);
  gap: clamp(1.1rem, 2.6vw, 2rem);
  height: var(--project-slide-height);
  min-height: 0;
  padding: clamp(1.1rem, 2.3vw, 1.7rem);
  border: 1px solid rgba(244, 248, 255, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035) 62%),
    rgba(15, 23, 41, 0.48);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.18);
  scroll-snap-align: center;
}

.project-slide-text-only {
  grid-template-columns: 1fr;
  min-height: 0;
}

.project-slide-text-only .skill-list {
  margin-top: 1.2rem;
}

.project-slide-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.project-slide-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  margin: 0;
  color: #88a9d8;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.project-slide h3 {
  margin-top: 0.85rem;
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  font-weight: 500;
  line-height: 1.04;
}

.project-slide p:not(.project-slide-meta) {
  margin: 0.9rem 0 0;
  color: rgba(244, 248, 255, 0.83);
  line-height: 1.65;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1.2rem;
}

.skill-list span {
  padding: 0.44rem 0.62rem;
  border: 1px solid rgba(136, 169, 216, 0.22);
  border-radius: 999px;
  background: rgba(136, 169, 216, 0.085);
  color: rgba(244, 248, 255, 0.9);
  font-size: 0.78rem;
}

.project-media {
  display: grid;
  grid-template-columns: 1fr 0.72fr;
  grid-template-rows: 1fr 1fr;
  gap: 0.72rem;
  min-height: 0;
}

.project-media figure {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  margin: 0;
  border: 1px solid rgba(244, 248, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.project-media figure:first-child {
  grid-row: 1 / -1;
}

.project-media figure:nth-child(2):last-child {
  grid-row: 1 / -1;
}

.project-media figure:only-child {
  grid-column: 1 / -1;
}

.project-media-side-by-side {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: 1fr;
}

.project-media-side-by-side figure:first-child,
.project-media-side-by-side figure:nth-child(2):last-child {
  grid-row: auto;
}

.project-media-stacked {
  grid-template-columns: 1fr;
  grid-template-rows: none;
  grid-auto-rows: minmax(0, 1fr);
}

.project-media-stacked figure:first-child,
.project-media-stacked figure:nth-child(2):last-child {
  grid-row: auto;
}

.project-media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 9.5rem;
  padding: 0.4rem;
  object-fit: contain;
}

.project-image-button {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: zoom-in;
}

.project-image-button::after {
  position: absolute;
  inset: 0.4rem;
  border: 1px solid transparent;
  border-radius: 6px;
  pointer-events: none;
  content: "";
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.project-image-button:hover::after,
.project-image-button:focus-visible::after {
  border-color: rgba(136, 169, 216, 0.78);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 41, 0.64);
}

.project-image-button:focus-visible {
  outline: 2px solid rgba(136, 169, 216, 0.9);
  outline-offset: -0.35rem;
}

.project-image-button img {
  transition: transform 180ms ease;
}

.project-image-button:hover img,
.project-image-button:focus-visible img {
  transform: scale(1.015);
}

.project-media figcaption {
  margin: 0;
  padding: 0.62rem 0.7rem;
  border-top: 1px solid rgba(244, 248, 255, 0.09);
  background: rgba(15, 23, 41, 0.64);
  color: rgba(244, 248, 255, 0.76);
  font-size: 0.74rem;
  line-height: 1.45;
}

.portfolio-lightbox {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 3vw, 2rem);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 180ms ease,
    visibility 180ms ease;
}

.portfolio-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.portfolio-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 12%, rgba(136, 169, 216, 0.18), transparent 34%),
    rgba(6, 10, 19, 0.88);
  backdrop-filter: blur(12px);
}

.portfolio-lightbox-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.85rem;
  width: min(1180px, 100%);
  max-height: calc(100vh - 2rem);
  padding: clamp(0.7rem, 1.6vw, 1rem);
  border: 1px solid rgba(244, 248, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.045) 62%),
    rgba(15, 23, 41, 0.9);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.portfolio-lightbox-frame {
  display: grid;
  min-height: 0;
  place-items: center;
}

.portfolio-lightbox-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(74vh, 820px);
  border-radius: 6px;
  object-fit: contain;
}

.portfolio-lightbox-caption {
  max-width: 920px;
  margin: 0 auto;
  color: rgba(244, 248, 255, 0.82);
  font-size: 0.86rem;
  line-height: 1.5;
  text-align: center;
}

.portfolio-lightbox-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  z-index: 2;
  display: inline-grid;
  width: 2.65rem;
  height: 2.65rem;
  place-items: center;
  border: 1px solid rgba(244, 248, 255, 0.26);
  border-radius: 999px;
  background: rgba(15, 23, 41, 0.74);
  color: #f4f8ff;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.portfolio-lightbox-close:hover,
.portfolio-lightbox-close:focus-visible {
  border-color: #88a9d8;
  background: rgba(136, 169, 216, 0.2);
  outline: none;
  transform: translateY(-2px);
}

.portfolio-lightbox-close svg {
  width: 1.18rem;
  height: 1.18rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.carousel-dots {
  display: grid;
  grid-auto-columns: minmax(2.2rem, 1fr);
  grid-auto-flow: column;
  gap: 0.35rem;
  width: min(420px, 100%);
  justify-self: center;
}

.carousel-dot {
  height: 0.26rem;
  border: 0;
  border-radius: 999px;
  background: rgba(244, 248, 255, 0.2);
  cursor: pointer;
  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

.carousel-dot.is-active {
  background: #88a9d8;
}

.dark-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.85rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(244, 248, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.92rem;
  font-weight: 700;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.cv-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 1rem;
  align-items: stretch;
  padding: 3.5rem 0 2.2rem;
}

.cv-hero-grid .cv-dark-hero {
  align-content: center;
  justify-items: start;
  padding: 0;
  text-align: left;
}

.cv-hero-grid .cv-dark-hero h1 {
  margin-right: 0;
  margin-left: 0;
}

.cv-hero-grid .cv-dark-hero > p:not(.dark-kicker) {
  margin-right: 0;
  margin-left: 0;
}

.cv-hero-grid .cv-summary-panel {
  align-content: center;
}

.cv-credentials {
  display: grid;
  gap: 0.35rem;
  margin-top: 1rem;
}

.cv-credentials p {
  margin: 0;
  color: rgba(244, 248, 255, 0.75);
}

.cv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: flex-start;
  margin-top: 1.4rem;
}

.cv-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: 1rem;
  align-items: start;
  margin-top: 1rem;
}

.cv-main-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(270px, 0.75fr);
}

.dark-panel {
  padding: 1.25rem;
}

.cv-main-stack,
.cv-sidebar-stack,
.cv-section,
.cv-summary,
.cv-contact-list,
.cv-skill-list {
  display: grid;
  gap: 1rem;
}

.cv-summary {
  gap: 0.62rem;
}

.cv-summary p {
  margin: 0;
}

.cv-entry {
  display: grid;
  gap: 0.55rem;
}

.cv-entry + .cv-entry {
  padding-top: 1rem;
  border-top: 1px solid rgba(244, 248, 255, 0.12);
}

#cv-experience .cv-entry + .cv-entry {
  margin-top: 1.15rem;
  padding-top: 1.35rem;
}

#cv-education .cv-entry + .cv-entry {
  margin-top: 1.15rem;
  padding-top: 1.35rem;
}

.cv-entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.cv-entry-title {
  font-size: 1.08rem;
  font-weight: 700;
}

.cv-entry-date,
.cv-entry-subhead,
.cv-contact-label {
  color: rgba(244, 248, 255, 0.62);
}

.cv-entry-subhead {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.cv-entry ul,
.cv-compact-list {
  margin: 0;
  padding-left: 1.1rem;
}

.cv-entry li strong {
  color: #fbfcff;
  font-weight: 600;
  letter-spacing: 0;
}

.cv-contact-item,
.cv-skill-item {
  display: grid;
  gap: 0.25rem;
}

.cv-contact-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.cv-contact-value a {
  color: #f4f8ff;
  text-decoration: none;
}

.cv-skill-item strong,
.cv-publication strong,
.cv-entry-subhead strong {
  color: #fbfcff;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--topbar-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
}

.brand,
.topbar-links a {
  color: var(--topbar-link);
  text-decoration: none;
}

.brand {
  font-family: "Iowan Old Style", "Baskerville", serif;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.topbar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.topbar-links a {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.masthead {
  padding: 4rem 1.5rem 3rem;
  background:
    radial-gradient(circle at top center, rgba(255, 255, 255, 0.08), transparent 20%),
    linear-gradient(180deg, #0f1729 0%, #172238 100%);
  color: #f4f8ff;
  text-align: center;
}

.masthead-kicker,
.eyebrow,
.panel-title,
.section-label {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
}

.masthead h1 {
  width: min(960px, 100%);
  margin: 1rem auto 1.2rem;
  font-size: clamp(2.4rem, 5vw, 5rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  font-family: "Iowan Old Style", "Baskerville", serif;
  font-weight: 600;
}

.masthead-summary {
  width: min(760px, 100%);
  margin: 0 auto;
  color: rgba(232, 239, 255, 0.76);
  font-size: 1.03rem;
  line-height: 1.85;
}

.masthead-actions,
.masthead-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.masthead-actions {
  margin-top: 1.6rem;
}

.masthead-tags {
  margin-top: 1.35rem;
}

.masthead-tags span,
.tag-row span {
  padding: 0.62rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(244, 248, 255, 0.86);
  font-size: 0.84rem;
  letter-spacing: 0.01em;
}

.page {
  width: min(1240px, calc(100% - 2rem));
  margin: 1.35rem auto 0;
  padding-bottom: 3.75rem;
}

.home-page {
  display: grid;
  gap: 1.35rem;
}

.home-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.metric-card,
.section-card,
.overview-copy,
.overview-panel,
.narrative,
.evidence,
.project-card,
.mini-card,
.contact-card,
.side-callout,
.note-card {
  border: 1px solid var(--card-border);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.metric-card {
  padding: 1.1rem 1.25rem;
}

.metric-card span,
.metrics span {
  display: block;
  margin-bottom: 0.18rem;
  color: var(--navy);
  font-size: 1.7rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  font-family: "Iowan Old Style", "Baskerville", serif;
}

.metric-card p,
.metrics p {
  margin: 0;
  color: #66789a;
  line-height: 1.35;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.69rem;
}

.section-card {
  padding: 1.7rem;
}

.section-heading {
  display: grid;
  gap: 0.7rem;
  margin-bottom: 1.25rem;
}

.section-heading h2,
.overview-copy h2 {
  margin: 0;
  font-size: clamp(1.85rem, 3.4vw, 3.25rem);
  line-height: 1;
  letter-spacing: -0.045em;
  font-family: "Iowan Old Style", "Baskerville", serif;
  font-weight: 600;
}

.section-summary,
.lead,
.project-card p,
.mini-card p,
.contact-card p,
.note-card p {
  color: var(--muted);
  line-height: 1.8;
}

.home-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 1rem;
}

.prose-stack,
.stacked-cards,
.mini-grid {
  display: grid;
  gap: 1rem;
}

.prose-stack p,
.narrative p {
  margin: 0 0 1.2rem;
  color: #22304a;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.project-card,
.mini-card,
.contact-card,
.side-callout,
.note-card {
  padding: 1.25rem;
}

.project-card h3,
.mini-card h3,
.contact-card h3,
.side-callout h3,
.chapter h3 {
  margin: 0.45rem 0 0.7rem;
  font-size: 1.35rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-family: "Iowan Old Style", "Baskerville", serif;
  font-weight: 600;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1rem 0 1.1rem;
}

.tag-row span {
  border-color: rgba(24, 33, 49, 0.08);
  background: rgba(255, 255, 255, 0.75);
  color: #445067;
}

.side-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 1rem;
}

.contact-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.column-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(310px, 0.72fr);
  gap: 1.5rem;
  align-items: start;
}

.left-column,
.right-column {
  display: grid;
  gap: 1.4rem;
  align-content: start;
}

.overview-copy {
  padding: 2.15rem 2.2rem 2.3rem;
}

.overview-panel {
  padding: 1.35rem;
  background:
    linear-gradient(180deg, rgba(225, 234, 246, 0.92), rgba(247, 249, 252, 0.98));
  box-shadow:
    0 22px 55px rgba(18, 29, 56, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.panel-block {
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
}

.panel-block:first-child {
  padding-top: 0;
  border-top: 0;
}

.panel-block p:last-child {
  margin: 0.42rem 0 0;
  color: #586783;
  line-height: 1.72;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.metrics div {
  padding: 0.85rem;
  border: 1px solid rgba(136, 169, 216, 0.2);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 249, 255, 0.92));
}

.panel-links {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.narrative,
.evidence {
  padding: 1.7rem;
}

.narrative {
  font-size: 1.03rem;
  line-height: 1.9;
}

.chapter + .chapter {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}

.chapter ul,
.narrative ul {
  margin: 0.1rem 0 0;
  padding-left: 1.1rem;
  color: #22304a;
}

.chapter li,
.narrative li {
  margin: 0 0 0.65rem;
  line-height: 1.8;
}

.section-label {
  margin-bottom: 1rem;
}

blockquote {
  margin: 1.7rem 0 0;
  padding: 1rem 1.2rem;
  border-left: 2px solid rgba(200, 161, 106, 0.72);
  background: linear-gradient(90deg, rgba(200, 161, 106, 0.12), transparent 78%);
  color: #4c4034;
  font-family: "Iowan Old Style", "Baskerville", serif;
  font-size: 1.12rem;
  font-style: italic;
  line-height: 1.68;
}

.evidence {
  display: grid;
  gap: 1rem;
}

#evidence-cards {
  display: grid;
  gap: 1rem;
}

.figure-card {
  margin: 0;
  padding: 0.9rem;
  border: 1px solid rgba(24, 33, 49, 0.07);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(246, 248, 250, 0.98));
}

.figure-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
}

.figure-card figcaption {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.note-card p:last-child,
.mini-card p:last-child,
.project-card p:last-child,
.contact-card p:last-child {
  margin-bottom: 0;
}

.text-link,
.action-button {
  text-decoration: none;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.8rem;
  color: #324566;
  font-size: 0.94rem;
  font-weight: 600;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.78rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.action-button.primary {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
  color: #f4f8ff;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.action-button.secondary {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(244, 248, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.action-button.compact {
  width: fit-content;
  margin-top: 1rem;
}

.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition:
    opacity 700ms ease,
    transform 700ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1060px) {
  .project-carousel {
    --project-slide-height: 720px;
  }

  .project-grid,
  .contact-row,
  .home-metrics,
  .metrics {
    grid-template-columns: 1fr;
  }

  .home-split,
  .side-grid,
  .column-grid {
    grid-template-columns: 1fr;
  }

  .project-slide,
  .cv-hero-grid,
  .cv-layout,
  .cv-main-layout {
    grid-template-columns: 1fr;
  }

  .cv-hero-grid {
    padding: 2.6rem 0 1.2rem;
  }

  .project-slide {
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .identity-home {
    align-items: start;
    padding: 5rem 1rem 2.3rem;
  }

  .identity-name {
    font-size: 3.35rem;
  }

  .identity-role {
    font-size: 1.35rem;
  }

  .identity-icon-link {
    width: 3rem;
    min-width: 0;
    height: 3rem;
  }

  .identity-icon-link span {
    max-width: 0;
    opacity: 0;
    font-size: 0.9rem;
  }

  .identity-copy {
    margin-top: 2.4rem;
  }

  .identity-copy p {
    font-size: 0.96rem;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .masthead {
    padding-top: 3.2rem;
  }

  .section-card,
  .narrative,
  .evidence,
  .overview-copy,
  .overview-panel {
    padding: 1.2rem;
    border-radius: 22px;
  }

  .page {
    width: min(100% - 1rem, 1240px);
  }

  .topbar-links {
    gap: 0.75rem;
  }

  .dark-page-content {
    width: min(100% - 1rem, 1180px);
    padding-bottom: 2.4rem;
  }

  .dark-nav {
    align-items: center;
  }

  .dark-nav-brand {
    font-size: 0.98rem;
  }

  .dark-nav-links {
    gap: 0.45rem;
  }

  .dark-nav-icon {
    width: 2.55rem;
    height: 2.55rem;
  }

  .dark-hero {
    padding: 2.6rem 0 2rem;
  }

  .dark-hero h1 {
    font-size: 3.1rem;
  }

  .dark-hero > p:not(.dark-kicker) {
    font-size: 0.98rem;
  }

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

  .carousel-controls {
    align-self: end;
  }

  .project-slide {
    overflow-y: auto;
    padding: 1rem;
  }

  .project-slide h3 {
    font-size: 1.55rem;
  }

  .project-media {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .project-media figure:first-child,
  .project-media figure:nth-child(2):last-child {
    grid-row: auto;
  }

  .project-media img {
    height: auto;
    min-height: 0;
  }

  .cv-entry-head {
    align-items: start;
    flex-direction: column;
    gap: 0.25rem;
  }
}
