/* ============================================
   SAGAR SHRESTHA v7 — the desk
   Warm paper, a compact illustrated desk whose objects lift on hover,
   hand-lettered labels, a quiet serif bio and a signature.
   ============================================ */

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

:root {
  --bg: #F8F3EC;
  --bg-dim: #EAE7E0;
  --frame: rgba(195, 184, 157, 0.28);
  --text: #5E5A54;         /* bio text */
  --ink: #2F2C28;          /* strong text, labels */
  --link: #2F2C28;
  --muted: #6E6962;
  --card: #FFFFFF;
  --card-text: #3F3B36;
  --line: #E7E1D6;
  --paper-line: #D9DFF9;
  --accent: #B5462F;       /* small highlights only */
  --shadow: 0 0 30px rgba(0, 0, 0, 0.18);
  --sun: #D2CEC4;

  --hand: 'Caveat Brush', 'Comic Sans MS', cursive;
  --serif: 'Merriweather', Georgia, serif;
  --sans: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --glide: cubic-bezier(0.22, 1, 0.36, 1);      /* ease-out-quint: fast start, long soft landing */
  --settle: cubic-bezier(0.4, 0, 0.2, 1);       /* for things going away */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html.night {
  --bg: #141312;        /* near-black with a slight warm tint to match the paper */
  --bg-dim: #0D0C0B;
  --frame: #2B2926;
  --text: #D4CFC7;      /* 12:1 on the background */
  --ink: #FFFFFF;
  --link: #FFFFFF;
  --muted: #A39D94;     /* 6.9:1 */
  --sun: #FFFFFF;
  color-scheme: dark;
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  transition: background-color .5s var(--glide);
  -webkit-font-smoothing: antialiased;
}
body.modal-open { background: var(--bg-dim); overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 2000; background: var(--card); color: var(--ink); padding: 8px 14px; border-radius: 5px; }
.skip-link:focus { top: 16px; }

/* The thin tinted frame around the window */
.frame {
  position: fixed; inset: 0; z-index: 1500; pointer-events: none;
  border: 5px solid var(--frame);
}

/* ---------- Day / night toggle ---------- */
.daynight {
  position: fixed;
  top: calc(15px + env(safe-area-inset-top, 0px));
  right: 15px;
  z-index: 1400;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  opacity: .75;
  transition: opacity .2s;
  overflow: hidden;
}
.daynight:hover { opacity: 1; }
.daynight__sun {
  position: relative; width: 16px; height: 16px; border-radius: 50%;
  background: var(--sun);
  transition: transform .3s var(--ease), background-color .3s;
  box-shadow:
    0 -12px 0 -6px var(--sun), 0 12px 0 -6px var(--sun), 12px 0 0 -6px var(--sun), -12px 0 0 -6px var(--sun),
    8.5px 8.5px 0 -6px var(--sun), -8.5px -8.5px 0 -6px var(--sun), 8.5px -8.5px 0 -6px var(--sun), -8.5px 8.5px 0 -6px var(--sun);
}
.daynight__moon {
  position: absolute; inset: 0; border-radius: 50%;
  background: var(--bg);
  transform: translate(0, -17px);
  transition: transform .3s var(--ease), background-color .3s;
}
.night .daynight__sun { transform: rotate(55deg); box-shadow: none; }
.night .daynight__moon { transform: translate(0, -7px); }

/* ---------- Page ---------- */
.page {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(56px, 9vh, 96px) 20px 24px;
}

/* ---------- The desk ---------- */
.desk {
  position: relative;
  width: min(100%, 700px);
  aspect-ratio: 16 / 9;
  transition: transform .6s var(--glide);
  transform-origin: 50% 60%;
}
.modal-open .desk { transform: scale(0.97); }
.desk__base { width: 100%; height: 100%; }
.night .desk__base, .night .obj img { filter: brightness(0.88) saturate(0.9); }

.obj {
  position: absolute;
  display: block;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
/* Soft contact shadow that fades in under a lifted object (opacity only, so it stays smooth) */
.obj::after {
  content: "";
  position: absolute;
  left: 14%; right: 14%; bottom: -3%;
  height: 12%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.22) 0%, rgba(0, 0, 0, 0) 70%);
  opacity: 0;
  z-index: -1;
  pointer-events: none;
  transition: opacity .5s var(--glide);
}
.obj:hover::after, .obj:focus-visible::after, .obj.is-peek::after { opacity: 1; }
.obj img {
  width: 100%;
  height: 100%;
  transform-origin: 50% 100%;
  transform: translate3d(0, 0, 0) scale(1);
  backface-visibility: hidden;
  transition: transform .55s var(--glide);
  will-change: transform;
}
.obj:hover, .obj:focus-visible, .obj.is-peek { z-index: 5; }
.obj:hover img, .obj:focus-visible img, .obj.is-peek img {
  transform: translate3d(0, -3%, 0) scale(1.035);
}
.obj:active img { transform: translate3d(0, -1.5%, 0) scale(1.02); transition-duration: .2s; }
.obj:focus-visible { outline-offset: 6px; }

/* positions measured on the 1024 × 576 artwork */
.obj--board  { left:  7.617%; top:  6.25%;  width: 34.766%; height: 46.181%; }
.obj--map    { left: 65.43%;  top:  7.292%; width: 28.516%; height: 45.139%; }
.obj--books  { left:  5.078%; top: 54.861%; width: 20.312%; height: 29.861%; }
.obj--mug    { left: 29.59%;  top: 65.278%; width: 10.645%; height: 19.444%; }
.obj--laptop { left: 49.121%; top: 49.653%; width: 27.051%; height: 31.944%; z-index: 3; }

/* Hand-lettered labels
   Each label sits in empty space beside its object and points at it with a small caret,
   so it is never read as belonging to a neighbour. Placement is set per object below. */
.tip {
  --dx: -50%; --dy: 0%;          /* resting offset */
  --fx: 0px;  --fy: 6px;         /* extra offset while hidden (drifts in from here) */
  position: absolute;
  z-index: 6;
  font-family: var(--hand);
  font-size: clamp(15px, 1.9vw, 19px);
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
  padding: 5px 11px 6px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.10), 0 4px 12px rgba(0, 0, 0, 0.08);
  opacity: 0;
  pointer-events: none;
  transform: translate(calc(var(--dx) + var(--fx)), calc(var(--dy) + var(--fy)));
  transition: opacity .3s var(--glide), transform .5s var(--glide);
}
/* caret */
.tip::after {
  content: "";
  position: absolute;
  width: 9px; height: 9px;
  background: inherit;
  transform: rotate(45deg);
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.06);
}
.tip--down::after  { left: var(--cx, 50%); bottom: -4px; margin-left: -4.5px; }
.tip--up::after    { left: 50%; top: -4px; margin-left: -4.5px; box-shadow: -1px -1px 2px rgba(0,0,0,.05); }
.tip--right::after { right: -4px; top: 50%; margin-top: -4.5px; box-shadow: 1px -1px 2px rgba(0,0,0,.05); }
.tip--left::after  { left: -4px; top: 50%; margin-top: -4.5px; box-shadow: -1px 1px 2px rgba(0,0,0,.05); }

.tip--down  { bottom: calc(100% + 10px); --fy: 6px; }
.tip--up    { top: calc(100% + 10px);    --fy: -6px; }
.tip--right { right: calc(100% + 12px); top: 50%; --dx: 0%; --dy: -50%; --fx: 6px; --fy: 0px; }
.tip--left  { left: calc(100% + 12px);  top: 50%; --dx: 0%; --dy: -50%; --fx: -6px; --fy: 0px; }

/* per object (positions measured on the 1024 × 576 artwork) */
.obj--board  .tip { left: 55.6%; }                        /* over the Editorial Insights poster */
.obj--map    .tip { left: 50%; }
.obj--books  .tip { left: 50%; }                          /* below, on the desk */
.obj--mug    .tip { left: 50%; }                          /* below, on the desk */
.obj--laptop .tip { left: 50%; }                          /* below, on the desk */

.obj:hover .tip, .obj:focus-visible .tip, .obj.is-peek .tip {
  opacity: 1;
  --fx: 0px; --fy: 0px;
}


.hint {
  font-family: var(--hand);
  font-size: 18px;
  color: var(--muted);
  margin-top: 6px;
  display: none;
}
@media (hover: none) { .hint { display: block; } .tip { display: none; } }

/* ---------- Bio ---------- */
.bio {
  max-width: 600px;
  margin-top: clamp(20px, 4vh, 40px);
  text-align: center;
}
.bio p {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(15px, 1.35vw, 16px);
  line-height: 1.8;
  color: var(--text);
  text-wrap: pretty;
}
.bio p a {
  font-weight: 700;
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  border-bottom-color: color-mix(in srgb, currentColor 30%, transparent);
  transition: border-color .2s;
}
.bio p a:hover { border-bottom-color: currentColor; }
.bio__signature {
  width: 150px;
  margin: 18px auto 0;
  opacity: .85;
  mix-blend-mode: multiply;
}
.night .bio__signature { mix-blend-mode: normal; filter: invert(1) brightness(1.6); opacity: .8; }

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 20px;
  margin-top: 20px;
}
.links a {
  font-family: var(--hand);
  font-size: 19px;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 2px;
  transition: color .2s;
}
.links a:hover { color: var(--ink); }

/* ---------- Footer ---------- */
.foot {
  padding: 16px 24px calc(24px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.foot p { max-width: 640px; margin: 0 auto; }
.foot__meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-top: 8px !important; }
.foot__meta a, .linklike { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; font-size: 12px; }
.foot__meta a:hover, .linklike:hover { color: var(--ink); }

/* ---------- Modals (pop out of the object) ---------- */
.modal-bg {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0, 0, 0, 0.15);
  cursor: zoom-out;
  opacity: 0;
  transition: opacity .45s var(--glide);
}
.modal-bg.is-on { opacity: 1; }
.night .modal-bg { background: rgba(0, 0, 0, 0.45); }

.modal {
  position: fixed;
  z-index: 901;
  left: 50%;
  top: 50%;
  width: min(560px, calc(100vw - 32px));
  max-height: min(82vh, 760px);
  max-height: min(82dvh, 760px);
  display: flex;
  flex-direction: column;
  background: var(--card);
  color: var(--card-text);
  border-radius: 5px;
  box-shadow: var(--shadow);
  overflow: hidden;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6);
  /* closing: quick and quiet */
  transition: transform .28s var(--settle), opacity .22s var(--settle);
  will-change: transform, opacity;
  backface-visibility: hidden;
}
.modal.is-open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  /* opening: grows out of the object and settles gently */
  transition: transform .5s var(--glide), opacity .3s var(--glide);
}
.modal[hidden] { display: none; }

.modal__head {
  position: relative;
  flex: none;
  padding: 20px 64px 16px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.modal__head h2 { font-family: var(--hand); font-weight: 400; font-size: 30px; line-height: 1.15; color: #2F2C28; outline: none; }
.modal__close {
  position: absolute; top: 50%; right: 14px;
  transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 24px; line-height: 1; color: #6E6962;
  display: grid; place-items: center;
  transition: background-color .2s, color .2s;
}
.modal__close:hover { background: #F4EFE7; color: #2F2C28; }

/* One type system inside every card:
   Open Sans for everything you scan, Merriweather only for the opening line,
   Caveat Brush only for the card title. */
.modal__body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px clamp(20px, 5vw, 32px) 32px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: #4A4640;
}
.modal__body ul, .modal__body ol { list-style: none; margin: 0; padding: 0; }
.modal__body p { margin: 0; }
.modal a { color: #2F2C28; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.modal a:hover { color: var(--accent); }

.lead {
  font-family: var(--serif); font-weight: 300;
  font-size: 15px; line-height: 1.75;
  color: #3F3B36;
  margin-bottom: 24px !important;
}
.sub {
  font-family: var(--sans);
  font-size: 12px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: #6E6962;
  margin: 28px 0 0;
}
.modal__body > .sub:first-child, .person + .sub { margin-top: 0; }
.small { font-size: 13px; line-height: 1.55; color: #6E6962; }
.modal__body > .small:last-child { margin-top: 16px; }

/* Rows: the shared list pattern for every card */
.areas, .matters, .timeline, .projects, .posts, .pubs { margin-top: 10px; border-top: 1px solid var(--line); }
.areas > div, .matters > li, .timeline > li, .projects > li, .posts > li, .pubs > li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.row-title, .areas dt, .matters strong, .timeline strong, .projects h3, .posts .post__title, .pubs strong {
  display: block;
  font-size: 15px; font-weight: 600; line-height: 1.45;
  color: #2F2C28;
}
.row-meta, .areas dd, .matters span, .timeline .org, .projects p, .posts .post__brief {
  display: block;
  font-size: 14px; line-height: 1.6;
  color: #5E5A54;
  margin-top: 2px;
}
.row-note, .timeline .note, .projects .stack, .posts .post__date {
  display: block;
  font-size: 13px; line-height: 1.55;
  color: #6E6962;
  margin-top: 6px;
}

/* Journey */
.person { display: flex; gap: 16px; align-items: center; margin-bottom: 28px; }
.person img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; object-position: center 25%; flex: none; }
.person__name { font-family: var(--serif); font-weight: 700; font-size: 17px; line-height: 1.3; color: #2F2C28; margin-bottom: 4px !important; }
.timeline > li { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 16px; }
.timeline .when {
  font-size: 13px; font-weight: 600; line-height: 1.45;
  padding-top: 1px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Projects */
.projects .head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.projects h3 { display: inline; }
.tag { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; line-height: 1; padding: 4px 7px; border-radius: 3px; background: #F1ECE4; color: #5E5A54; }
.tag--live { background: #E6F4EA; color: #1F6B45; }
.projects p { margin-top: 4px; }

.posts .post > a { text-decoration: none; display: block; }
.posts a:hover .post__title { text-decoration: underline; text-underline-offset: 3px; }

/* Contact */
.notice { font-size: 13px; line-height: 1.55; color: #5E5A54; background: #FBF7EF; border-left: 3px solid #D8C9A8; padding: 12px 14px; margin-bottom: 24px !important; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: #3F3B36; margin-bottom: 6px; }
.field input[type="text"], .field input[type="email"], .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  font: inherit; font-size: 16px; color: #2F2C28;
  background: #fff; border: 1px solid #CFC7B9; border-radius: 5px;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: none; border-color: #2F2C28; box-shadow: 0 0 0 3px rgba(181, 70, 47, .25); }
.field [aria-invalid="true"] { border-color: #B42318; }
.field__error { font-size: 13px; color: #B42318; margin-top: 3px; }
.field--check { display: flex; gap: 10px; align-items: flex-start; }
.field--check input { width: 18px; height: 18px; margin-top: 3px; flex: none; accent-color: #2F2C28; }
.field--check { margin: 4px 0 20px; }
.field--check label { font-size: 13px; font-weight: 400; line-height: 1.55; color: #5E5A54; margin: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.status:empty { display: none; }
.status { font-size: 14px; padding: 10px 12px; border-radius: 5px; margin-top: 12px; }
.status.is-success { background: #E6F4EA; color: #1F6B45; }
.status.is-error { background: #FDECEA; color: #9B1C12; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 20px;
  border-radius: 5px;
  background: #2F2C28; color: #fff;
  font-weight: 600; font-size: 15px;
  transition: background-color .2s, transform .1s;
}
.btn:hover { background: #45413B; }
.btn:active { transform: scale(.98); }
.btn--wide { width: 100%; }
.btn--ghost { background: transparent; color: #2F2C28; box-shadow: inset 0 0 0 1px #CFC7B9; }
.btn--ghost:hover { background: #F4EFE7; }

.prose h3 { font-size: 14px; font-weight: 600; color: #2F2C28; margin-top: 20px; }
.prose h3:first-of-type { margin-top: 16px; }
.prose p { margin-top: 4px; font-size: 14px; }

/* ---------- Bar Council disclaimer ----------
   Shown on every visit. Styled like the site's own pop-out cards:
   same white card, 5px corners, hand-lettered title, same buttons,
   docked near the bottom and as wide as the desk. */
.disclaimer {
  position: fixed; inset: 0; z-index: 1600;
  display: none; align-items: flex-end; justify-content: center;
  padding: 0 16px calc(20px + env(safe-area-inset-bottom, 0px));
  background: rgba(0, 0, 0, 0.15);
}
.night .disclaimer { background: rgba(0, 0, 0, 0.45); }
.needs-consent .disclaimer, .disclaimer.is-open { display: flex; }
.needs-consent .desk, .disclaimer.is-open ~ * .desk { transform: scale(0.97); }

.disclaimer__card {
  width: min(700px, 100%);
  background: var(--card);
  color: var(--card-text);
  border-radius: 5px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: disclaimer-in .5s var(--glide) both;
}
@keyframes disclaimer-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.disclaimer__card h2 {
  font-family: var(--serif); font-weight: 700;
  font-size: 21px; line-height: 1.3;
  letter-spacing: 0.01em;
  color: #2F2C28;
  text-align: center;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--line);
  margin: 0;
}
.disclaimer__card h2:focus { outline: none; }
.disclaimer__inner { max-width: none; margin: 0; }
.disclaimer__text {
  max-height: min(26vh, 190px);
  overflow-y: auto;
  padding: 18px clamp(20px, 4vw, 32px) 4px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  color: #4A4640;
  scrollbar-width: thin;
  scrollbar-color: #CFC7B9 transparent;
}
.disclaimer__text:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.disclaimer__text ul { list-style: disc; padding-left: 18px; margin-top: 8px; display: grid; gap: 6px; }
.disclaimer__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px clamp(20px, 4vw, 32px) 20px;
  border-top: 1px solid var(--line);
  margin-top: 14px;
}
.disclaimer__actions .btn { width: 100%; }
@media (max-width: 520px) {
  .disclaimer { padding: 0 10px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .disclaimer__text { max-height: 32vh; }
}

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  .timeline > li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .person img { width: 64px; height: 64px; }
  .page { padding-top: 64px; }
  .row { grid-template-columns: 1fr; }
  .modal { max-height: 86dvh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}


/* Experience: one block per role */
.role { padding: 16px 0 18px; border-top: 1px solid var(--line); }
.sub + .role { margin-top: 10px; }
.role + .role { margin-top: 0; }
.role:last-of-type, .role:has(+ .sub) { border-bottom: 1px solid var(--line); }
.role__title { font-size: 15px; font-weight: 600; line-height: 1.45; color: #2F2C28; }
.role__was { font-weight: 400; color: #6E6962; font-size: 13px; }
.role__org { font-size: 14px; line-height: 1.5; color: #4A4640; margin-top: 2px !important; }
.role__dates { font-size: 13px; line-height: 1.5; color: var(--accent); font-weight: 600; margin-top: 4px !important; font-variant-numeric: tabular-nums; }
.role__points { margin-top: 10px !important; display: grid; gap: 6px; }
.role__points li { position: relative; padding-left: 16px; font-size: 14px; line-height: 1.6; color: #5E5A54; }
.role__points li::before { content: ""; position: absolute; left: 2px; top: .72em; width: 6px; height: 1px; background: #B8AFA3; }

/* =========================================================
   Journey & Experience: wider, clearer cards
   ========================================================= */
.modal--wide { width: min(760px, calc(100vw - 32px)); }
.modal--wide .modal__body { padding: 28px clamp(20px, 5vw, 44px) 36px; }

/* Section headings: readable serif, not tiny caps */
.modal--wide .sub {
  font-family: var(--serif);
  font-size: 17px; font-weight: 700;
  letter-spacing: 0; text-transform: none;
  color: #2F2C28;
  margin: 36px 0 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #2F2C28;
}
.modal--wide .person + .sub, .modal--wide .lead + .sub { margin-top: 8px; }
.modal--wide .lead { font-size: 16px; margin-bottom: 28px !important; }

/* ---------- Journey ---------- */
.modal--wide .person { gap: 20px; margin-bottom: 32px; padding: 18px 20px; background: #FAF7F2; border-radius: 8px; }
.modal--wide .person img { width: 88px; height: 88px; }
.modal--wide .person__name { font-size: 20px; }
.modal--wide .person .small { font-size: 14px; line-height: 1.6; color: #5E5A54; }

.rail { border-top: 0; margin-top: 18px; }
.rail > li {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 0 20px;
  padding: 0;
  border-bottom: 0;
}
.rail > li > div {
  position: relative;
  padding: 0 0 22px 24px;
  border-left: 1px solid #DDD5C8;
}
.rail > li:last-child > div { padding-bottom: 4px; }
.rail > li > div::before {           /* timeline dot */
  content: "";
  position: absolute;
  left: -6px; top: 5px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #B8AFA3;
}
.rail > li.is-now > div::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(181, 70, 47, 0.14); }
.rail .when { text-align: right; padding-top: 2px; color: #6E6962; }
.rail > li.is-now .when { color: var(--accent); }
.rail strong { font-size: 16px; }
.rail .org { font-size: 14.5px; color: #4A4640; }

/* Certifications: compact two-column grid */
.certs { margin-top: 18px; border-top: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 32px; }
.certs > li { display: flex; flex-direction: column; padding: 0 0 0 14px; border-bottom: 0; border-left: 2px solid #E7E1D6; }
.certs > li > div { display: contents; }
.certs strong { font-size: 14px; font-weight: 600; line-height: 1.45; order: 1; }
.certs .org { font-size: 13px; color: #5E5A54; order: 2; margin-top: 2px; }
.certs .when { order: 3; font-size: 12.5px; font-weight: 600; color: var(--accent); margin-top: 4px; }

/* ---------- Experience ---------- */
.modal--wide .role {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "meta title" "meta points";
  gap: 0 28px;
  padding: 22px 0 24px;
  border-top: 0;
  border-bottom: 1px solid #E7E1D6;
}
.modal--wide .sub + .role { margin-top: 0; }
.modal--wide .role:last-of-type, .modal--wide .role:has(+ .sub) { border-bottom: 1px solid #E7E1D6; }
.modal--wide .role__head { display: contents; }
.modal--wide .role__title { grid-area: title; font-size: 16px; }
.modal--wide .role__meta { grid-area: meta; }
.modal--wide .role__org { font-size: 14px; font-weight: 600; color: #2F2C28; margin: 0 !important; line-height: 1.45; }
.modal--wide .role__dates { font-size: 13px; margin-top: 6px !important; }
.modal--wide .role__points { grid-area: points; margin-top: 10px !important; gap: 8px; align-content: start; }
.modal--wide .role__points li { font-size: 14.5px; color: #4A4640; padding-left: 18px; }
.modal--wide .role__points li::before { top: .78em; width: 8px; background: var(--accent); opacity: .7; }

/* Selected matters: two side-by-side panels */
.modal--wide .matters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; border-top: 0; }
.modal--wide .matters > li { padding: 16px 18px; border: 0; background: #FAF7F2; border-radius: 8px; }
.modal--wide .matters strong { font-size: 15px; }
.modal--wide .matters span { font-size: 14px; color: #4A4640; margin-top: 4px; }
.modal--wide .modal__body > .small:last-child { margin-top: 18px; }

@media (max-width: 640px) {
  .modal--wide .person { padding: 14px; }
  .modal--wide .person img { width: 64px; height: 64px; }
  .rail > li { grid-template-columns: minmax(0, 1fr); }
  .rail .when { text-align: left; padding: 0 0 4px 24px; border-left: 1px solid #DDD5C8; }
  .certs, .modal--wide .matters { grid-template-columns: minmax(0, 1fr); }
  .modal--wide .role { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "title" "meta" "points"; }
  .modal--wide .role__org { font-weight: 400; color: #4A4640; margin-top: 2px !important; }
}

/* ---------- Phone & accessibility refinements ---------- */
/* Scrollable card bodies can be focused for keyboard scrolling; keep the ring subtle */
.modal__body:focus { outline: none; }
.modal__body:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }

/* Day/night toggle stays below open cards and the disclaimer */
.modal-open .daynight, .needs-consent .daynight { opacity: 0; pointer-events: none; }

/* Bigger tap areas without changing the look */
.obj--mug::before { content: ""; position: absolute; inset: -8px -6px; }   /* mug is small on phones */
.links a { min-height: 44px; display: inline-flex; align-items: center; }
.foot__meta a, .foot__meta .linklike { display: inline-flex; align-items: center; min-height: 32px; padding: 0 2px; }

@media (max-width: 600px) {
  /* Journey header: photo above the text, so the text gets the full width */
  .modal--wide .person { flex-direction: column; align-items: flex-start; gap: 12px; }
  .modal--wide .person img { width: 72px; height: 72px; }
  .foot__meta { gap: 0 14px; }
}

/* Bio links that read as normal text (no bold), still underlined so they stay findable */
.bio p a.plain { font-weight: inherit; color: inherit; }
.bio p a.plain:hover { color: var(--ink); }

/* Navy button (disclaimer Accept) — white on #1E3A5F is 11:1 contrast */
.btn--navy { background: #1E3A5F; color: #fff; }
.btn--navy:hover { background: #284B78; }
