/* ==========================================================================
   meet.allanemmanuelumali.com
   Black and white like the printed card. The photo and the research
   illustration carry the life of the page; everything else stays quiet.
   ========================================================================== */

:root {
  --ink: #000000;          /* page background, same black as the card */
  --paper: #ffffff;        /* primary text */
  --body: #e4e4e4;         /* long-form text */
  --ash: #a6a6a6;          /* secondary text (8.9:1 on black) */
  --stone: #8c8c8c;        /* tertiary text (6.1:1 on black) */
  --line: #262626;         /* hairlines */
  --lift: #111111;         /* raised surfaces */
  --lift-2: #1a1a1a;       /* hover on raised surfaces */

  --serif: "Playfair Display", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --kana: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "Noto Sans CJK JP", sans-serif;

  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --bar: 3.25rem;          /* mobile section bar height */

  color-scheme: dark;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  height: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar) + 1rem + env(safe-area-inset-top, 0px));
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Paints the area under a phone's status bar to match the section bar */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: rgba(0, 0, 0, 0.88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

img, svg, canvas { max-width: 100%; display: block; }
a { color: inherit; }
p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 0.9rem;
  background: var(--paper);
  color: var(--ink);
  border-radius: 6px;
  z-index: 30;
}
.skip-link:focus { top: calc(env(safe-area-inset-top, 0px) + 0.75rem); }

.soon-tag {
  margin-left: 0.4rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: var(--lift-2);
  color: var(--ash);
  font-size: 0.7rem;
  font-weight: 500;
  vertical-align: 0.1em;
}

/* --------------------------------------------------------------------------
   Mobile section bar (hidden on wide screens)
   -------------------------------------------------------------------------- */
.mobile-bar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: var(--bar);
  padding: 0 0 0 var(--gutter);
  background: rgba(0, 0, 0, 0.88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.monogram {
  flex: none;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.mobile-nav {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-right: var(--gutter);
  mask-image: linear-gradient(90deg, transparent 0, #000 0.75rem, #000 calc(100% - 1.5rem), transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 0.75rem, #000 calc(100% - 1.5rem), transparent);
}
.mobile-nav::-webkit-scrollbar { display: none; }

.mobile-nav a {
  flex: none;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--ash);
  text-decoration: none;
  white-space: nowrap;
}
.mobile-nav a:first-child { margin-left: 0.6rem; }
.mobile-nav a.is-current {
  background: var(--paper);
  color: var(--ink);
}
.mobile-nav .soon-tag { display: none; }

/* --------------------------------------------------------------------------
   Layout: one column on phones, two columns on wide screens
   -------------------------------------------------------------------------- */
.layout {
  max-width: 76rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.sidebar { padding-top: 2rem; }

.content { min-width: 0; }

@media (min-width: 64rem) {
  html { scroll-padding-top: 2.5rem; }
  .mobile-bar { display: none; }

  .layout {
    display: grid;
    grid-template-columns: minmax(18rem, 22rem) minmax(0, 42rem);
    justify-content: space-between;
    column-gap: 4rem;
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    scrollbar-width: none;
    padding: 3.5rem 0 2.5rem;
    display: flex;
    flex-direction: column;
  }
  .sidebar::-webkit-scrollbar { display: none; }

  .content { padding-top: 3.5rem; }
}

/* --------------------------------------------------------------------------
   Identity
   -------------------------------------------------------------------------- */
.avatar {
  width: 6.5rem;
  height: 6.5rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--lift);
}

.name {
  margin: 1.25rem 0 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 8vw, 2.4rem);
  line-height: 1.1;
  letter-spacing: 0.005em;
}

.kana {
  margin-top: 0.5rem;
  font-family: var(--kana);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: var(--ash);
}

.tagline {
  margin-top: 0.85rem;
  font-size: 1.05rem;
  font-weight: 500;
}

.status {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-top: 1rem;
  font-size: 0.925rem;
  color: var(--body);
}

.status-dot {
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--paper);
  transform: translateY(-0.1rem);
}

/* --------------------------------------------------------------------------
   Quick links (the "link tree")
   -------------------------------------------------------------------------- */
.quick { margin-top: 1.75rem; }

.quick ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

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

.quick a {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "label mark" "hint mark";
  align-items: center;
  column-gap: 1rem;
  min-height: 3.9rem;
  padding: 0.75rem 1.1rem;
  text-decoration: none;
  cursor: pointer;
}
.quick a:hover { background: var(--lift); }

.quick-label { grid-area: label; font-weight: 500; }
.quick-hint {
  grid-area: hint;
  font-size: 0.85rem;
  color: var(--ash);
  overflow-wrap: anywhere;
}
.quick-mark { grid-area: mark; color: var(--ash); }

@media (min-width: 64rem) {
  .avatar { width: 5.5rem; height: 5.5rem; }
  .name { margin-top: 1rem; font-size: 2.05rem; }
  .quick { margin-top: 1.5rem; }
  .quick a { min-height: 0; padding: 0.55rem 0.95rem; }
  .quick-label { font-size: 0.95rem; }
  .quick-hint { font-size: 0.8rem; }
}

/* --------------------------------------------------------------------------
   Section menu (desktop sidebar)
   -------------------------------------------------------------------------- */
.toc { display: none; }

@media (min-width: 64rem) {
  .toc {
    display: flex;
    flex-direction: column;
    margin-top: 1.5rem;
    padding-left: 0.1rem;
  }
  .toc a {
    position: relative;
    padding: 0.24rem 0 0.24rem 1.25rem;
    font-size: 0.9rem;
    color: var(--stone);
    text-decoration: none;
  }
  .toc a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 0.6rem;
    height: 1px;
    background: var(--line);
    transition: width 0.2s ease, background-color 0.2s ease;
  }
  .toc a:hover { color: var(--paper); }
  .toc a.is-current { color: var(--paper); }
  .toc a.is-current::before { width: 0.9rem; background: var(--paper); }
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section {
  margin-top: 3.5rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--line);
}

.section h2 {
  margin: 0 0 1.1rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.55rem, 5vw, 1.85rem);
  line-height: 1.2;
}

.section > p { color: var(--body); max-width: 36em; }
.section > p + p { margin-top: 0.9rem; }

.section > .section-lead {
  margin-top: -0.4rem;
  margin-bottom: 1.25rem;
  font-size: 0.925rem;
  color: var(--ash);
}

@media (min-width: 64rem) {
  .featured { margin-top: 0; padding-top: 0; border-top: 0; }
}

/* --------------------------------------------------------------------------
   Featured talk and the intersection illustration (the page's signature)
   -------------------------------------------------------------------------- */
.viz {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--lift);
}

.viz-svg { width: 100%; height: auto; }

.viz-svg .road { fill: #1c1c1c; }
.viz-svg .box { fill: #1c1c1c; }
.viz-svg .lane { stroke: #3d3d3d; stroke-width: 1.2; stroke-dasharray: 6 6; }
.viz-svg .stop { stroke: #4a4a4a; stroke-width: 2; }
.viz-svg .car { fill: var(--paper); }
.viz-svg .car-flagged { fill: none; stroke: var(--paper); stroke-width: 1.4; }
.viz-svg .trail { fill: none; stroke: rgba(255, 255, 255, 0.28); stroke-width: 2; stroke-linecap: round; }
.viz-svg .cross { stroke: var(--paper); stroke-width: 1.6; stroke-linecap: round; }

.viz figcaption {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--line);
}

.viz-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.25rem;
  font-size: 0.875rem;
  color: var(--ash);
}
.viz-counts b {
  margin-left: 0.3rem;
  color: var(--paper);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.viz-note { font-size: 0.8rem; color: var(--stone); }

.section > .featured-paper {
  margin-top: 1.25rem;
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.45;
  color: var(--paper);
}

.section > .featured-when {
  margin-top: 0.5rem;
  font-size: 0.925rem;
  color: var(--ash);
}

.featured-links { margin-top: 0.75rem; font-size: 0.925rem; }
.featured-links a { text-underline-offset: 3px; }

/* --------------------------------------------------------------------------
   Research
   -------------------------------------------------------------------------- */
.pubs { list-style: none; margin: 0; padding: 0; }

.pub {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1.1rem;
  align-items: start;
}
.pub + .pub {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.pub-art {
  aspect-ratio: 3 / 2;
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--lift);
}
.pub-art svg { width: 100%; height: 100%; }
.pub-art .road { fill: #262626; }
.pub-art .track { fill: none; stroke: var(--paper); stroke-width: 2.2; stroke-linecap: round; }
.pub-art .track-faint { stroke: #555555; }
.pub-art .cone { fill: none; stroke: #555555; stroke-width: 1.2; stroke-dasharray: 3 3; }
.pub-art .cam { fill: var(--paper); }
.pub-art .shelf { stroke: #555555; stroke-width: 2; }
.pub-art .item { fill: #3a3a3a; }
.pub-art .item-picked { fill: none; stroke: var(--paper); stroke-width: 1.6; }

.pub-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.4;
}
.pub-meta { margin-top: 0.45rem; font-size: 0.875rem; color: var(--ash); }
.pub-meta strong { color: var(--paper); font-weight: 500; }
.pub-status {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--ash);
}
.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 0.6rem;
  font-size: 0.9rem;
}
.pub-links a { text-underline-offset: 3px; }

@media (max-width: 30rem) {
  .pub { grid-template-columns: 1fr; gap: 0.75rem; }
  .pub-art { width: 7rem; }
}

/* --------------------------------------------------------------------------
   Projects
   -------------------------------------------------------------------------- */
.projects {
  display: grid;
  gap: 1rem;
}

@media (min-width: 40rem) {
  .projects { grid-template-columns: 1fr 1fr; }
}

.project {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.project h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.3;
}

.project > p {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--body);
}

/* How it works: a small left-to-right flow */
.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.35rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.75rem;
}
.flow li { display: flex; align-items: center; }
.flow span {
  padding: 0.2rem 0.55rem;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  color: var(--paper);
}
.flow li + li::before {
  content: "→";
  margin-right: 0.35rem;
  color: var(--stone);
}

.project .angle {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--body);
}
.project .angle span {
  display: block;
  margin-bottom: 0.1rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
}

.project .tags {
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.8rem;
  color: var(--stone);
}

@media (min-width: 40rem) {
  .project-wide { grid-column: 1 / -1; }
}

/* A project linked from "Grounded in" gets a brief outline so the eye finds it */
.project:target { border-color: var(--paper); }

/* --------------------------------------------------------------------------
   Japanese self-introduction. Uses the visitor's own Japanese system font.
   -------------------------------------------------------------------------- */
.ja { --ja: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, "Meiryo", "Noto Sans CJK JP", sans-serif; }
.ja h2 { font-family: var(--ja); font-weight: 600; font-size: clamp(1.35rem, 4.6vw, 1.6rem); }
.ja > p {
  font-family: var(--ja);
  line-height: 1.95;
  letter-spacing: 0.02em;
  line-break: strict;
}

/* --------------------------------------------------------------------------
   Where my work meets research
   -------------------------------------------------------------------------- */
.directions { display: grid; gap: 1rem; }
@media (min-width: 40rem) { .directions { grid-template-columns: 1fr 1fr; } }

.direction {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--lift);
}
.direction-area {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ash);
}
.direction h3 {
  margin: 0.45rem 0 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.3;
}
.direction > p:not(.direction-area):not(.grounded) {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--body);
}
.grounded {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  font-size: 0.75rem;
}
.grounded-label { color: var(--stone); margin-right: 0.15rem; }
.grounded a {
  padding: 0.2rem 0.55rem;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  color: var(--paper);
  text-decoration: none;
}
.grounded a:hover { border-color: var(--paper); }
.direction-cta {
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Experience
   -------------------------------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.timeline li:first-child { padding-top: 0; }
.timeline li:last-child { border-bottom: 0; }
.when { font-size: 0.85rem; color: var(--ash); padding-top: 0.1rem; }
.what { font-weight: 500; }
.where { font-size: 0.9rem; color: var(--ash); }
.detail { margin-top: 0.4rem; font-size: 0.9rem; color: var(--body); }

@media (max-width: 30rem) {
  .timeline li { grid-template-columns: 1fr; gap: 0.25rem; }
}

/* --------------------------------------------------------------------------
   Tools
   -------------------------------------------------------------------------- */
.tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tools li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.9rem;
}
.tools img { width: 1.35rem; height: 1.35rem; flex: none; }
.tool-letter {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  font: inherit;
  font-size: 0.925rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.button-solid { border: 1px solid var(--paper); background: var(--paper); color: var(--ink); }
.button-solid:hover { background: #e6e6e6; }
.button-solid:disabled { opacity: 0.6; cursor: progress; }
.button-quiet { border: 1px solid var(--line); background: transparent; color: var(--paper); }
.button-quiet:hover { background: var(--lift); }

/* --------------------------------------------------------------------------
   Resume and CV: two audience cards (native <details>)
   -------------------------------------------------------------------------- */
.cv-cards { display: grid; gap: 1rem; }

.cv-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--ink);
  transition: border-color 0.2s ease;
}
.cv-card:hover, .cv-card[open] { border-color: #3a3a3a; }

.cv-card > summary {
  position: relative;
  display: grid;
  gap: 0.35rem;
  padding: 1.25rem 3.5rem 1.25rem 1.25rem;
  list-style: none;
  cursor: pointer;
  border-radius: 14px;
}
.cv-card > summary::-webkit-details-marker { display: none; }
.cv-card > summary:hover { background: var(--lift); }
.cv-card[open] > summary { border-bottom: 1px solid var(--line); border-radius: 14px 14px 0 0; }

.cv-for {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ash);
}
.cv-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.25;
}
.cv-pages {
  margin-left: 0.4rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--stone);
  vertical-align: 0.15em;
}

.cv-hooks {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.6rem;
}
@media (min-width: 40rem) {
  .cv-hooks { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
}
.hook { display: grid; gap: 0.1rem; align-content: start; }
.hook b {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.2;
  font-variant-numeric: lining-nums tabular-nums;
}
.hook span { font-size: 0.8rem; line-height: 1.4; color: var(--ash); }

/* Plus sign that turns into a minus when the card is open */
.cv-toggle {
  position: absolute;
  top: 1.3rem;
  right: 1.25rem;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid #3a3a3a;
  border-radius: 50%;
}
.cv-toggle::before, .cv-toggle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.65rem;
  height: 1.5px;
  background: var(--paper);
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease;
}
.cv-toggle::after { transform: translate(-50%, -50%) rotate(90deg); }
.cv-card[open] .cv-toggle::after { transform: translate(-50%, -50%) rotate(0deg); }

.cv-body { padding: 1.25rem; }

.cv-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.cv-slot {
  margin-top: 1.25rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--lift);
}
.cv-slot.is-loading { opacity: 0.6; }
.cv-state { color: var(--ash); font-size: 0.925rem; }
.cv-state a { color: var(--paper); text-underline-offset: 3px; }
.cv-state-error { margin-top: 0.75rem; color: var(--body); }

.cv-close { margin-top: 1.25rem; }

.cv-more {
  margin-top: 1.25rem;
  font-size: 0.925rem;
  color: var(--ash);
}
.cv-more a { color: var(--paper); text-underline-offset: 3px; }

/* --------------------------------------------------------------------------
   Small "read more" links at the end of a section
   -------------------------------------------------------------------------- */
.section > .section-more {
  margin-top: 1.25rem;
  font-size: 0.925rem;
}
.section-more a { color: var(--paper); text-underline-offset: 3px; }

/* --------------------------------------------------------------------------
   Collaboration form
   -------------------------------------------------------------------------- */
.form { display: grid; gap: 1.1rem; margin-top: 1.5rem; }

.field-row { display: grid; gap: 1.1rem; }
@media (min-width: 40rem) { .field-row { grid-template-columns: 1fr 1fr; } }

.field { display: grid; gap: 0.4rem; }
.field label { font-size: 0.875rem; font-weight: 500; }
.optional { margin-left: 0.35rem; font-weight: 400; color: var(--stone); }

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #5c5c5c;          /* 3:1 against the field background */
  border-radius: 8px;
  background: var(--lift);
  color: var(--paper);
  font: inherit;
  font-size: 1rem;              /* 16px stops iOS from zooming in */
}
.field textarea { resize: vertical; line-height: 1.5; }
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23a6a6a6' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.95rem center;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--paper); }
.field input::placeholder, .field textarea::placeholder { color: var(--stone); }
.field [aria-invalid="true"] { border-color: #ff8a8a; }

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form .button-solid { justify-self: start; min-width: 10rem; }

.form-status { min-height: 1.5rem; font-size: 0.925rem; color: var(--ash); }
.form-status.is-error { color: #ff8a8a; }
.form-status.is-success { color: var(--paper); }

.ai-slot { margin-top: 1.25rem; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  margin-top: 4rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--line);
}
.footer-email {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 4.6vw, 1.35rem);
  overflow-wrap: anywhere;
}
.footer-email a { text-underline-offset: 4px; }
.copy {
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ash);
  font-family: var(--sans);
  font-size: 0.8rem;
  cursor: pointer;
}
.copy:hover { color: var(--paper); }
.footer-note { margin-top: 1rem; font-size: 0.8rem; color: var(--stone); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .toc a::before, .cv-card, .cv-toggle::before, .cv-toggle::after { transition: none; }
}

/* Shorter laptop screens: drop the link hints so the whole sidebar menu fits */
@media (min-width: 64rem) and (max-height: 56rem) {
  .quick-hint { display: none; }
  .quick a { padding: 0.6rem 0.95rem; }
}
