/* Layout: a narrow writing column. One look only: dusk (dark), whatever the device prefers.
   Font tokens (--display, --heading, --body, --h1-*) are set per site from the admin in base.html. */
:root {
  --paper: #121519;
  --ink: #ece5d8;
  --muted: #9a958c;
  --rule: #2a2e33;
  --accent: #e3a43a;
  --teal: #4fc2b6;
  --green: #8ccb6e;
  --orange: #f0923f;
  --rose: #f29bb4;
  --sea: #4fc2b6;
  --milk: #f3ebdc;
  --display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --heading: var(--display);
  --body: "Newsreader", "Iowan Old Style", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --h1-weight: 400;
  --h1-size: 100px;
  --h1-spacing: -0.015em;
  --h1-em-style: italic;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* No blue flash on phones when something is tapped. */
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
/* The cards and cut-out photos behave like part of the page on a phone:
   a long press doesn't select them or offer to copy or save them. */
.event-card, .event-photo, .letter-open, .contact-card, .side-friend, .side-photo, .cutout-photo, .farzam-shot {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.event-card img, .event-photo img, .contact-card img, .side-friend img, .side-photo img { -webkit-user-drag: none; }
/* The email address can still be selected. */
.contact-mail a { -webkit-user-select: text; user-select: text; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.65;
  padding-inline: clamp(16px, 5vw, 64px);
  transition: background-color .6s ease, color .6s ease;
}
img { max-width: 100%; }
a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: .2em; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

.wrap { max-width: 1120px; margin-inline: auto; }

/* Header */
.masthead {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding-block: 2rem 1.5rem;
  border-bottom: 1px solid var(--rule);
}
.name { font-family: var(--heading); font-size: 1.6rem; text-decoration: none; letter-spacing: .01em; }
.brand { display: flex; align-items: baseline; gap: .9rem; }
/* Same look as the nav links on the right. */
.me-link { font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; text-decoration: none; color: var(--muted); }
.me-link:hover, .me-link[aria-current="page"] { color: var(--ink); }
.nav { display: flex; gap: 1.5rem; align-items: baseline; font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

.eyebrow { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); text-decoration: none; }
h1 {
  font-family: var(--display); font-weight: var(--h1-weight);
  font-size: clamp(2.8rem, 8vw, var(--h1-size)); line-height: .95; letter-spacing: var(--h1-spacing);
  margin: 1.25rem 0 1.75rem; text-wrap: balance; overflow-wrap: break-word;
}
h1 em { color: var(--accent); font-style: var(--h1-em-style); }
.lede { max-width: 34ch; font-size: 1.25rem; color: var(--muted); font-weight: 300; margin: 0; }

/* A word wrapped in _underscores_ stands out in full ink colour. */
.squiggle { color: var(--ink); font-weight: 400; }

figure { margin: 0; }
.photo img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; }
figcaption {
  display: flex; justify-content: space-between; gap: 1rem;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; color: var(--muted);
  padding-top: .6rem; font-variant-numeric: tabular-nums;
}

/* Sections */
section { padding-block: clamp(3rem, 7vw, 5rem); border-top: 1px solid var(--rule); }
h2 { font-family: var(--heading); font-weight: 400; font-size: clamp(2rem, 4vw, 2.75rem); margin: 0; line-height: 1.1; }

/* Blog: the front page, a plain small list */
.blog {
  border-top: 0; padding-block: clamp(2.5rem, 6vw, 4rem);
  display: grid; grid-template-columns: minmax(0, 38rem) minmax(0, 21rem); grid-template-rows: auto 1fr;
  justify-content: space-between; column-gap: clamp(2rem, 6vw, 5rem); align-items: start;
}
.blog-title, .blog-list { grid-column: 1; }

/* The welcome photo, with typography set over it */
.welcome { grid-column: 2; grid-row: 1 / span 2; position: relative; margin: 0; border-radius: 1.2rem; overflow: hidden; box-shadow: 0 24px 50px -28px rgba(0, 0, 0, .7); }
.welcome img { display: block; width: 100%; height: auto; }
.welcome figcaption {
  position: absolute; inset: 0; display: flex; flex-direction: column; padding: 1.6rem 1.4rem; gap: .4rem;
  font: inherit; letter-spacing: 0; color: #fff; text-align: left;
  background: linear-gradient(to bottom, rgba(8, 10, 12, .72), rgba(8, 10, 12, 0) 34%, rgba(8, 10, 12, 0) 58%, rgba(8, 10, 12, .8));
}
.welcome-hi { font-family: var(--display); font-style: italic; font-size: clamp(2.2rem, 3.6vw, 2.9rem); line-height: 1; text-shadow: 0 2px 14px rgba(0, 0, 0, .5); }
.welcome-sub { font-family: "Caveat", "Segoe Print", cursive; font-size: 1.5rem; color: #d9f5b5; transform: rotate(-3deg); transform-origin: left; margin-left: .3rem; }
.welcome-motto {
  margin-top: auto; font-family: var(--display); font-size: 1.25rem; line-height: 1.3; text-wrap: balance;
  padding-left: .8rem; border-left: 2px solid #8ccb6e; text-shadow: 0 1px 10px rgba(0, 0, 0, .6);
}
@media (max-width: 860px) {
  .blog { grid-template-columns: minmax(0, 1fr); }
  .welcome { grid-column: 1; grid-row: auto; order: -1; max-width: 22rem; justify-self: center; margin-bottom: 2.5rem; }
}
.blog-title { font-size: 1.6rem; line-height: 1.2; margin: 0 0 1.5rem; }
.blog-list { list-style: none; margin: 0; padding: 0; }
.blog-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-block: .55rem; border-bottom: 1px solid var(--rule); }
.blog-list a { text-decoration: none; }
.blog-list a:hover { color: var(--accent); }
.blog-list time { flex: none; font-family: var(--mono); font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); font-style: italic; }

/* Reading column (home excerpt and essay pages) */
.reading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 38rem) minmax(0, 1fr); }
.reading > * { grid-column: 2; min-width: 0; }
.reading blockquote { margin: 0; }
.prose p { margin: 0 0 1.2em; }
.prose:not(.plain) p:first-of-type::first-letter {
  font-family: var(--heading); float: left; font-size: 4.4em; line-height: .8; padding: .08em .1em 0 0; color: var(--accent);
}
.sign { font-family: var(--heading); font-style: italic; font-size: 1.4rem; color: var(--muted); }
.more { font-family: var(--mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Essay page */
.article-head { padding-block: clamp(3rem, 8vw, 5.5rem) 2.5rem; }
.article-head h1 { font-size: clamp(2.4rem, 6vw, calc(var(--h1-size) * .72)); margin-block: 1rem 1.25rem; }
.article-head .lede { max-width: 46ch; }
.cover { margin-bottom: 3rem; }
.cover img { aspect-ratio: auto; max-height: 80vh; object-fit: cover; }
.article-body { padding-block: 0 4rem; border-top: 0; }
.pager { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; }
.pager a { text-decoration: none; display: flex; flex-direction: column; gap: .4rem; }
.pager .next { text-align: end; }
.pager strong { font-family: var(--heading); font-weight: 400; font-size: 1.5rem; line-height: 1.2; }

/* "Be a Spark" in the nav: a gold word that keeps glowing */
.nav a.spark-link {
  color: #ffd98a;
  background: linear-gradient(100deg, #ffd98a 0%, #fff6dc 45%, #ffb347 55%, #ffd98a 100%) 0 0 / 220% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: spark-shimmer 3.2s linear infinite, spark-glow 2.4s ease-in-out infinite;
}
@keyframes spark-shimmer { to { background-position: -220% 0; } }
@keyframes spark-glow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(255, 200, 90, .45)); }
  50% { filter: drop-shadow(0 0 9px rgba(255, 200, 90, .95)); }
}

/* Gallery: photos only, big, one under another on pure black */
.page-gallery { --paper: #000; --rule: #1b1b1b; --muted: #8a8a8a; background: #000; }
.photo-wall { display: grid; gap: clamp(3rem, 10vh, 7rem); padding-block: clamp(2rem, 6vw, 4rem) clamp(3rem, 8vw, 5rem); }
.wall-photo { margin: 0; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.wall-photo img { display: block; margin-inline: auto; width: auto; height: auto; max-width: 100%; max-height: 92vh; -webkit-user-drag: none; }
@media (max-width: 700px) {
  /* Edge to edge on phones. */
  .photo-wall { margin-inline: calc(-1 * clamp(16px, 5vw, 64px)); gap: 2.5rem; }
  .wall-photo img { max-height: none; }
}

/* Be a Spark page: all black, big glowing lines, one after another */
.page-spark { --paper: #000; --rule: #1b1b1b; --muted: #8a8a8a; background: #000; }
.spark { max-width: 46rem; margin: 0 auto; padding-block: clamp(4rem, 12vw, 8rem) clamp(3rem, 8vw, 5rem); text-align: center; display: grid; gap: clamp(2.6rem, 7vw, 4.5rem); }
.spark-title {
  margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(3.4rem, 11vw, 7.5rem); line-height: .95; color: #fff;
  text-shadow: 0 0 12px rgba(255, 255, 255, .55), 0 0 36px rgba(255, 210, 120, .45), 0 0 80px rgba(255, 170, 60, .35);
}
.spark-line {
  margin: 0; font-family: var(--display); font-size: clamp(1.55rem, 3.6vw, 2.35rem); line-height: 1.3; color: #fdfaf2; text-wrap: balance;
  text-shadow: 0 0 10px rgba(255, 255, 255, .35), 0 0 30px rgba(255, 220, 150, .18);
}
.spark-gold { color: #ffd27a; text-shadow: 0 0 12px rgba(255, 196, 90, .75), 0 0 34px rgba(255, 160, 40, .45); }
.spark-contact {
  justify-self: center; text-decoration: none; padding: .55rem 1.4rem; border-radius: 999px;
  border: 1px solid rgba(255, 210, 122, .55); font-size: clamp(1.2rem, 2.6vw, 1.5rem); color: #ffd27a;
  box-shadow: 0 0 24px rgba(255, 190, 80, .25), inset 0 0 14px rgba(255, 190, 80, .12);
}
.spark-contact:hover { background: rgba(255, 210, 122, .1); box-shadow: 0 0 36px rgba(255, 190, 80, .45); }

/* "You feel lost?" link at the end of every page */
.to-top {
  display: block; width: fit-content; margin: 1rem auto 2.5rem; padding: .6rem 1.1rem;
  font-family: var(--mono); font-size: .75rem; letter-spacing: .06em; text-decoration: none; text-align: center;
  color: var(--muted); border: 1px solid var(--rule); border-radius: 999px;
}
.to-top:hover, .to-top:focus-visible { color: var(--accent); border-color: var(--accent); }
.to-top span { display: inline-block; margin-left: .3rem; color: var(--accent); }

footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  padding-block: 2rem 3rem; border-top: 1px solid var(--rule);
  font-family: var(--mono); font-size: .72rem; color: var(--muted); letter-spacing: .06em;
}

@media (max-width: 760px) {
  .pager { grid-template-columns: minmax(0, 1fr); }
  .nav { gap: 1rem; flex-wrap: wrap; }
  .pager .next { text-align: start; }
}
/* ---- Work Life page (hand-written, not in the admin) ---- */
/* Friendship reuses these blocks; this swaps their teal for green. */
.friendship { --teal: var(--green); }
.me { --teal: var(--orange); }
.work-hero { padding-block: clamp(3rem, 8vw, 6rem) clamp(2rem, 5vw, 3.5rem); }
.work-title { color: var(--teal); margin-bottom: 1.25rem; }
.work-hero .lede { max-width: 40ch; }

/* Wedding card on the Friendship hero */
.work-hero.has-event { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.event-card {
  position: relative; display: grid; justify-items: center; gap: .35rem;
  width: 17rem; padding: 1.3rem 1.25rem 1.1rem; cursor: pointer; text-align: center;
  font: inherit; color: var(--ink);
  background:
    radial-gradient(circle at 15% 12%, color-mix(in srgb, var(--rose) 28%, transparent) 0 18%, transparent 19%),
    radial-gradient(circle at 88% 85%, color-mix(in srgb, var(--rose) 22%, transparent) 0 14%, transparent 15%),
    color-mix(in srgb, var(--rose) 10%, var(--paper));
  border: 1.5px dashed color-mix(in srgb, var(--rose) 70%, transparent);
  border-radius: 1.4rem; transform: rotate(2deg);
  box-shadow: 0 12px 30px -16px color-mix(in srgb, var(--rose) 70%, transparent);
  transition: transform .35s cubic-bezier(.3, 1.6, .5, 1);
}
.event-card:hover { transform: rotate(0deg) translateY(-4px) scale(1.02); }
.event-card.pop { animation: card-pop .45s cubic-bezier(.3, 1.6, .5, 1); }
.event-heart { width: 2.1rem; fill: var(--rose); animation: heartbeat 1.6s ease-in-out infinite; transform-origin: center; }
.event-names { font-family: var(--heading); font-style: italic; font-size: 1.85rem; line-height: 1.05; color: var(--rose); }
.event-names .amp { font-size: .8em; opacity: .75; }
.event-sub { font-size: .95rem; color: var(--muted); }
.event-date { font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; margin-top: .2rem; }
.countdown { display: flex; gap: .4rem; margin-top: .55rem; }
.countdown > span {
  display: grid; min-width: 3.1rem; padding: .35rem .2rem .3rem; border-radius: .7rem;
  background: color-mix(in srgb, var(--rose) 16%, var(--paper));
  font-family: var(--mono); font-size: .55rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.countdown b { font-family: var(--heading); font-weight: 400; font-size: 1.45rem; line-height: 1.1; color: var(--ink); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.countdown .married { font-family: var(--heading); font-style: italic; font-size: 1.5rem; color: var(--rose); }
.event-hint { font-family: var(--mono); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: .35rem; opacity: .8; }
.love-bit {
  position: fixed; z-index: 50; pointer-events: none; line-height: 1;
  transform: translate(-50%, -50%); animation: love-fly 1.2s cubic-bezier(.15, .7, .4, 1) forwards;
}
@keyframes love-fly {
  0% { transform: translate(-50%, -50%) scale(.3); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 60px)) rotate(var(--rot)) scale(1); opacity: 0; }
}
/* A friend standing in the right-hand margin, with a hand-written note pointing at him */
.reading.has-side .side-friend { grid-column: 3; grid-row: 1 / span 4; align-self: start; justify-self: start; width: calc(100% - 1.5rem); max-width: 15rem; margin: 0 0 0 1.5rem; }
.side-note { display: block; padding: 0; letter-spacing: 0; font-family: "Caveat", "Segoe Print", cursive; font-size: 1.3rem; line-height: 1.15; color: var(--muted); margin-left: .2rem; transform: rotate(-3deg); }
.side-note b { display: block; font-size: 1.65rem; font-weight: 700; color: var(--teal); }
.side-arrow { display: block; width: 4.25rem; height: auto; margin: .3rem 0 .6rem 1.4rem; overflow: visible; }
.side-arrow path { fill: none; stroke: var(--teal); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 7 6; }
.side-arrow .head { stroke-dasharray: none; }
.side-friend img { display: block; width: 78%; height: auto; margin-left: auto; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .3)); }
.reading.has-side .side-photo { grid-column: 1; grid-row: 3 / span 2; align-self: start; justify-self: end; width: calc(100% - 1.5rem); max-width: 16rem; margin: -1.5rem 1.5rem 0 0; text-align: center; }
.side-photo .side-note { transform: rotate(-4deg); margin: 0 0 .2rem; }
.side-photo img { display: block; width: 100%; height: auto; transform: rotate(-3deg); filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .3)); }
@media (max-width: 1000px) {
  .reading.has-side .side-friend { grid-column: 2; grid-row: auto; justify-self: center; width: 100%; max-width: 15rem; margin: 2rem 0 0; }
  .reading.has-side .side-photo { grid-column: 2; grid-row: auto; justify-self: center; width: 100%; max-width: 17rem; margin: 2rem 0 0; }
}

@keyframes heartbeat { 0%, 40%, 100% { transform: scale(1); } 20% { transform: scale(1.18); } 30% { transform: scale(.95); } }
@keyframes card-pop { 0% { transform: rotate(2deg) scale(1); } 40% { transform: rotate(-2deg) scale(1.07); } 100% { transform: rotate(0deg) scale(1.02); } }
/* "Write a letter" button under the card, and the letter window */
.letter-open {
  display: block; margin: 1rem auto 0; padding: .55rem 1rem; cursor: pointer;
  font: inherit; font-size: .9rem; color: var(--ink);
  background: color-mix(in srgb, var(--rose) 14%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--rose) 45%, transparent); border-radius: 999px;
  transition: transform .25s cubic-bezier(.3, 1.6, .5, 1), background .2s ease;
}
.letter-open b { color: var(--rose); font-weight: 600; }
.letter-count { margin: .55rem 0 0; text-align: center; font-size: .8rem; color: var(--muted); }
.letter-count b { color: var(--rose); font-weight: 600; font-size: 1.05em; }
.letter-open:hover { transform: translateY(-2px) rotate(-1deg); background: color-mix(in srgb, var(--rose) 24%, var(--paper)); }
.letter-box {
  width: min(32rem, calc(100% - 2rem)); padding: 0; border: 1px solid var(--rule); border-radius: 1.4rem;
  color: var(--ink); background: color-mix(in srgb, var(--rose) 7%, var(--paper));
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .6);
}
.letter-box::backdrop { background: rgba(10, 10, 14, .55); backdrop-filter: blur(3px); }
.letter-box form, .letter-done { display: grid; gap: .9rem; padding: 1.8rem 1.6rem 1.5rem; }
.letter-heart { width: 1.8rem; fill: var(--rose); justify-self: center; }
.letter-box h2 { font-family: var(--heading); font-weight: 400; font-style: italic; font-size: 1.7rem; line-height: 1.15; text-align: center; color: var(--rose); margin: 0; }
.letter-intro { margin: -.3rem 0 .2rem; text-align: center; color: var(--muted); font-size: .95rem; }
.letter-field { display: grid; gap: .35rem; font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.letter-field input, .letter-field textarea {
  font: inherit; font-family: var(--body); font-size: 1rem; letter-spacing: 0; text-transform: none; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: .8rem; padding: .65rem .8rem; resize: vertical;
}
.letter-field input:focus, .letter-field textarea:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rose) 22%, transparent); }
.letter-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.letter-error { margin: 0; font-size: .9rem; color: var(--rose); }
.letter-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: .2rem; }
.letter-send, .letter-cancel { font: inherit; font-size: .9rem; cursor: pointer; border-radius: 999px; padding: .55rem 1.1rem; }
.letter-send { color: var(--paper); background: var(--rose); border: 1px solid var(--rose); justify-self: center; }
.letter-send:hover { filter: brightness(1.08); }
.letter-send:disabled { opacity: .7; cursor: wait; }
.letter-cancel { color: var(--muted); background: none; border: 1px solid var(--rule); }
.letter-cancel:hover { color: var(--ink); }
.letter-done { text-align: center; justify-items: center; }
.letter-done[hidden], .letter-box form[hidden] { display: none; }
.letter-done-icon { font-size: 2.6rem; line-height: 1; }
.letter-done p { margin: 0; color: var(--muted); }

/* A small cut-out photo in the left-hand margin of a text block, fading out at the bottom */
.reading > .cutout-photo { grid-column: 1; grid-row: 1; align-self: start; justify-self: end; width: calc(100% - 1.5rem); max-width: 12rem; margin: .3rem 1.5rem 0 0; }
.cutout-photo img {
  display: block; width: 100%; height: auto; transform: rotate(-3deg);
  -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent); mask-image: linear-gradient(to bottom, #000 80%, transparent);
}
@media (max-width: 1000px) { .reading > .cutout-photo { grid-column: 2; grid-row: auto; justify-self: center; width: 100%; max-width: 13rem; margin: 1.5rem 0 0; } }

/* A small photo to the left of the card, with a looping arrow pointing at it */
.event-side { position: relative; }
.event-photo {
  position: absolute; top: 50%; right: calc(100% + 5.5rem); width: 12rem; margin: 0;
  padding: .3rem .3rem .9rem; background: #f6f1e7; border-radius: .25rem;
  transform: translateY(-58%) rotate(-5deg); box-shadow: 0 12px 26px -12px rgba(0, 0, 0, .55);
}
.event-photo { z-index: 2; transition: transform .35s cubic-bezier(.3, 1.4, .5, 1), box-shadow .35s ease; }
.event-photo:hover { transform: translateY(-58%) rotate(0deg) scale(1.5); box-shadow: 0 22px 40px -16px rgba(0, 0, 0, .6); }
.event-photo img { display: block; width: 100%; height: auto; border-radius: .1rem; }
.event-arrow { position: absolute; top: 50%; right: calc(100% + .2rem); width: 6rem; transform: translateY(-75%); overflow: visible; }
.event-arrow path { fill: none; stroke: var(--rose); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 6 5; }
.event-arrow .head { stroke-dasharray: none; }
@media (max-width: 1180px) {
  /* Not enough room beside the title: the photo sits under the card instead. */
  .event-side { display: grid; justify-items: center; gap: .6rem; }
  .event-photo { position: static; order: 2; transform: rotate(-3deg); }
  .event-photo:hover { transform: rotate(0deg) scale(1.5); }
  .event-arrow { display: none; }
}
@media (max-width: 760px) {
  .work-hero.has-event { grid-template-columns: minmax(0, 1fr); }
  .event-side { justify-self: center; }
}
@media (prefers-reduced-motion: reduce) { .event-heart, .event-card.pop { animation: none; } }

/* Contact card on the Me hero */
.work-hero.has-contact { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.contact-card {
  position: relative; width: 15.5rem; padding: .9rem .95rem .85rem; text-align: center;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, #ffd166 16%, transparent) 0 3rem, transparent 3.1rem),
    radial-gradient(circle at 0% 100%, color-mix(in srgb, var(--rose) 16%, transparent) 0 2.6rem, transparent 2.7rem),
    color-mix(in srgb, var(--orange) 10%, var(--paper));
  /* A speech bubble: soft corners, one sharp corner pointing back at "Me". Neutral edge, no colour. */
  border: 1px solid var(--rule);
  border-radius: 1.4rem 1.4rem 1.4rem .3rem; transform: rotate(-1deg);
  box-shadow: 0 16px 36px -22px rgba(0, 0, 0, .45);
  transition: transform .35s cubic-bezier(.3, 1.6, .5, 1);
}
.contact-card:hover { transform: rotate(0deg) translateY(-4px); }
.contact-wave {
  position: absolute; top: -.8rem; right: .9rem; font-size: 1.4rem; line-height: 1;
  transform-origin: 70% 80%; animation: wave 2.6s ease-in-out infinite;
}
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(16deg); }
  20%, 40% { transform: rotate(-8deg); }
}
.work .contact-title { font-family: 'Caveat', cursive; font-weight: 700; font-size: 1.35rem; line-height: 1.05; color: var(--orange); margin: 0 0 .3rem; }
.contact-sub { font-size: .78rem; line-height: 1.4; color: var(--muted); margin: 0 0 .65rem; }
.contact-tg { display: flex; align-items: center; gap: .7rem; text-align: left; }
.contact-qr {
  flex: none; display: block; width: 4.6rem; padding: .32rem; background: #fff; border-radius: .6rem;
  box-shadow: 0 6px 18px -10px rgba(0, 0, 0, .5); transform: rotate(2deg); transition: transform .3s cubic-bezier(.3, 1.6, .5, 1);
}
.contact-qr:hover { transform: rotate(0deg) scale(1.05); }
.contact-qr img { display: block; width: 100%; height: auto; }
.contact-how { font-size: .76rem; line-height: 1.35; margin: 0; }
.contact-how a { color: var(--orange); text-underline-offset: .2em; }
.contact-or { display: flex; align-items: center; gap: .5rem; margin: .4rem 0 .2rem; font-family: 'Caveat', cursive; font-size: 1.05rem; color: var(--muted); }
.contact-or::before, .contact-or::after { content: ""; flex: 1; border-top: 1px dashed var(--rule); }
.contact-mail { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.contact-mail a {
  font-family: var(--mono); font-size: .66rem; text-decoration: none; color: var(--ink);
  background: color-mix(in srgb, var(--orange) 16%, var(--paper)); padding: .25rem .5rem; border-radius: 999px;
}
.contact-mail a:hover { background: var(--orange); color: var(--paper); }
.contact-copy {
  font-family: var(--mono); font-size: .56rem; letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
  color: var(--orange); background: none; border: 1px solid color-mix(in srgb, var(--orange) 55%, transparent); border-radius: 999px; padding: .2rem .45rem;
}
.contact-copy:hover { border-color: var(--orange); }
.contact-copy.done { color: var(--green); border-color: var(--green); }
@media (max-width: 760px) {
  .work-hero.has-contact { grid-template-columns: minmax(0, 1fr); }
  .contact-card { justify-self: center; width: min(100%, 15.5rem); }
  .contact-tg { flex-direction: column; text-align: center; }
}
.work h2 { margin-block: .6rem 1.25rem; text-wrap: balance; }
.work .person-text p { margin: 0 0 1.1em; max-width: 60ch; }

.person {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 6vw, 5rem); align-items: start;
}
.person-flip { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); }
.person-flip .ph-frame { order: 2; }
.person-text { min-width: 0; }
.work { position: relative; }
.mask-links { position: absolute; inset: 0 auto auto 0; pointer-events: none; overflow: visible; z-index: 1; }
.mask-links path { fill: none; stroke: var(--orange); stroke-width: 1.5; stroke-dasharray: 6 6; stroke-linecap: round; }
.where { position: relative; margin: clamp(2rem, 5vw, 3rem) 0 0; width: min(24rem, 80%); transform: rotate(-1.5deg); }
.where img { display: block; width: 100%; height: auto; border-radius: .6rem; box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .6); }
.where svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.where-say, .where-here { font-family: "Caveat", "Segoe Print", cursive; font-weight: 700; fill: #ffb062; stroke: #0b1424; stroke-width: 8; paint-order: stroke; stroke-linejoin: round; }
.where-say { font-size: 62px; }
.where-here { font-size: 84px; fill: #fff; }
.where-arrow { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.reading.has-qmarks .qmarks { grid-column: 1; grid-row: 1 / span 3; }
.qmarks { position: relative; align-self: stretch; min-height: 16rem; font-family: var(--heading); color: var(--milk); line-height: .8; pointer-events: none; }
.qmarks span { position: absolute; }
.qmarks span:nth-child(1) { font-size: clamp(8rem, 13vw, 13rem); right: 22%; top: -1rem; transform: rotate(-12deg); }
.qmarks span:nth-child(2) { font-size: clamp(4rem, 6vw, 6rem); right: 58%; top: 42%; transform: rotate(14deg); opacity: .75; }
.qmarks span:nth-child(3) { font-size: clamp(5rem, 8vw, 8rem); right: 12%; top: 58%; transform: rotate(6deg); opacity: .9; }
@media (max-width: 1000px) { .qmarks { display: none; } }
.link-orange { color: var(--orange); text-decoration-color: color-mix(in srgb, var(--orange) 50%, transparent); }
.link-orange:hover { text-decoration-color: var(--orange); }
.link-green { color: var(--green); text-decoration-color: color-mix(in srgb, var(--green) 50%, transparent); }
.link-green:hover { text-decoration-color: var(--green); }
.reading > .pull-pair { grid-column: 2 / 4; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(1.5rem, 3vw, 2.5rem); align-items: center; margin-block: 1.5rem 2rem; }
.pull-pair .pull { margin: 0; }
.pull-pair img { display: block; width: 100%; height: auto; border-radius: .4rem; }
@media (max-width: 1000px) { .reading > .pull-pair { grid-column: 2; grid-template-columns: minmax(0, 1fr); } }
.place { font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--sea); margin-top: .6rem; }
.mask-line {
  font-family: var(--heading); font-style: italic; font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  line-height: 1.15; color: var(--orange); margin-top: clamp(2rem, 5vw, 4rem) !important;
}
.pull {
  font-family: var(--heading); font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.2;
  color: var(--ink); border-inline-start: 2px solid var(--teal); padding-inline-start: 1.25rem;
}

.ph-frame { margin: 0; }
.person-side { min-width: 0; }

/* Friendship: one of Farzam's photos, as a print under his portrait */
.farzam-shot { width: min(15rem, 78%); margin: clamp(2rem, 5vw, 3.5rem) auto 0; text-align: center; }
.farzam-shot a { display: block; padding: .45rem .45rem 1.6rem; background: #f6f1e7; border-radius: .2rem; transform: rotate(3deg); box-shadow: 0 18px 30px rgba(0, 0, 0, .35); transition: transform .35s cubic-bezier(.3, 1.4, .5, 1); }
.farzam-shot a:hover { transform: rotate(0deg) scale(1.04); }
.farzam-shot img { display: block; width: 100%; height: auto; -webkit-user-drag: none; }
.farzam-shot .side-note { margin: 1rem 0 0; transform: rotate(-2deg); }

/* Tiles */
.tiles { display: grid; gap: 2.5rem; }
.tile-fig { margin: 0; }

/* Photos of the people */
.person-photo { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 20%; }
.person-photo-tall { aspect-ratio: 3 / 4; }
.person-photo-full { aspect-ratio: 900 / 1599; object-position: 50% 50%; }

/* Two images side by side (Friendship: demons and angels) */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(.4rem, 1.5vw, 1rem); margin: 0; padding-block: 0 clamp(1.5rem, 4vw, 2.5rem); }
.duo img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }

/* A chapter: a clear break inside a page, with its own big title */
.chapter { border-top: 2px solid var(--teal); padding-block: clamp(3.5rem, 9vw, 6.5rem) clamp(3rem, 7vw, 5rem); display: grid; gap: clamp(2rem, 5vw, 3rem); }
.chapter-head { text-align: center; }
.work .chapter-title {
  font-family: var(--display); font-weight: var(--h1-weight); color: var(--teal);
  font-size: clamp(2.6rem, 7vw, calc(var(--h1-size) * .8)); line-height: 1; letter-spacing: var(--h1-spacing);
  margin: .9rem 0 0; text-wrap: balance;
}

/* Photos that keep their own shape: one row, each photo sized by its aspect ratio so all share a height */
.gallery { display: grid; gap: clamp(.4rem, 1.5vw, 1rem); }
.gallery img { display: block; width: 100%; height: auto; }
.gallery-row { display: flex; gap: clamp(.4rem, 1.5vw, 1rem); }
.gallery-row img { flex: calc(var(--ar)) 1 0; min-width: 0; aspect-ratio: var(--ar); object-fit: cover; }
.gallery-sm { width: 100%; max-width: 52rem; margin-inline: auto; }

/* Three tall tile photos side by side */
.triptych { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(.4rem, 1.5vw, 1rem); }
.triptych img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 5; object-fit: cover; }
.outro { padding-bottom: clamp(4rem, 8vw, 6rem); }
/* The clay pot sits beside the "how is it done" paragraph */
.pot { float: right; width: min(42%, 15rem); margin: -.5rem 0 1rem 1.5rem; shape-outside: ellipse(50% 50%); }
.pot img { display: block; width: 100%; height: auto; filter: drop-shadow(0 18px 22px rgba(23, 34, 44, .18)); }
.outro .org { clear: both; }

/* Who-does-what tree: root on top, one branch per team, people below.
   It sits in the wide grid track so the five branches have room side by side. */
.org { grid-column: 1 / -1; margin: 1rem 0 3rem; --line: color-mix(in srgb, var(--teal) 55%, var(--rule)); --gap: 1.75rem; }
.org figcaption { display: block; padding: 0; margin-bottom: 1.5rem; text-align: center; }
.org ul { list-style: none; margin: 0; padding: 0; }
.org-root, .org-node {
  display: flex; flex-direction: column; align-items: center; gap: .15rem; text-align: center;
  width: fit-content; margin-inline: auto; padding: .7rem 1.25rem; border: 1px solid var(--line); border-radius: 6px; background: var(--paper);
}
.org-root { position: relative; }
.org-root::after { content: ""; position: absolute; top: 100%; left: 50%; height: var(--gap); border-left: 1px solid var(--line); }
.org-role { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.org-name { font-family: var(--heading); font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.1; }
.org-node { font-family: var(--heading); font-size: clamp(1rem, 1.6vw, 1.25rem); line-height: 1.2; max-width: 12rem; padding-inline: .9rem; }

.org-branches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: var(--gap) !important; }
.org-branch { position: relative; padding: var(--gap) .5rem 0; min-width: 0; }
/* Horizontal bar split into two halves per branch, plus the drop to each node */
.org-branch::before, .org-branch::after { content: ""; position: absolute; top: 0; width: 50%; height: var(--gap); border-top: 1px solid var(--line); }
.org-branch::before { right: 50%; }
.org-branch::after { left: 50%; border-left: 1px solid var(--line); }
.org-branch:first-child::before, .org-branch:last-child::after { border-top: 0; }

.org-people { position: relative; display: flex; flex-direction: column; align-items: center; gap: .45rem; padding-top: 1.1rem !important; }
.org-people::before { content: ""; position: absolute; top: 0; left: 50%; height: 1.1rem; border-left: 1px dashed var(--line); }
.org-people li {
  font-family: var(--heading); font-size: 1.15rem; line-height: 1;
  padding: .4rem .9rem .45rem; border: 1px solid var(--rule); border-radius: 99px;
}

/* World map: dotted land, one teal point per country team */
.world { grid-column: 2; width: 100%; max-width: 34rem; margin: 1rem auto 1.5rem; }
.world-map { display: block; width: 100%; height: auto; overflow: visible; }
.world-map .land { stroke: color-mix(in srgb, var(--muted) 55%, transparent); stroke-width: 1.05; stroke-linecap: round; fill: none; }
.hub-dot { fill: var(--teal); }
.hub-halo { fill: var(--teal); opacity: .16; transform-box: fill-box; transform-origin: center; animation: hub-pulse 4s ease-out infinite; animation-delay: var(--d, 0s); }
@keyframes hub-pulse { 0% { transform: scale(.5); opacity: .35; } 70%, 100% { transform: scale(1.6); opacity: 0; } }

@media (max-width: 640px) {
  /* Stack the branches down a single rail on the left */
  .org figcaption { text-align: start; }
  .org-root, .org-node { margin-inline: 0; align-items: flex-start; text-align: start; }
  .org-root::after { left: 1.25rem; }
  .org-branches { grid-template-columns: minmax(0, 1fr); margin-left: 1.25rem !important; border-left: 1px solid var(--line); }
  .org-branch { padding: var(--gap) 0 0 1.25rem; }
  .org-branch::after { display: none; }
  .org-branch::before, .org-branch:first-child::before {
    right: auto; left: 0; top: calc(var(--gap) + 1.2rem); width: 1.25rem; height: 0; border-top: 1px solid var(--line);
  }
  .org-branch:last-child { background: linear-gradient(var(--paper), var(--paper)) 0 calc(var(--gap) + 1.25rem) / 1px 100% no-repeat; margin-left: -1px; padding-left: calc(1.25rem + 1px); }
  .org-people { flex-direction: row; flex-wrap: wrap; align-items: center; padding-left: 0; }
  .org-people::before { display: none; }
}
.work-next {
  display: flex; flex-direction: column; gap: .3rem; margin-top: 1.5rem; padding-top: 1.5rem;
  border-top: 1px solid var(--rule); text-decoration: none; color: var(--muted);
}
.work-next span { font-family: var(--heading); font-size: clamp(1.5rem, 3vw, 2rem); color: var(--teal); line-height: 1.2; }
/* The link to Work Life keeps Work Life's teal, even on green Friendship. */
.work-next.to-work span { color: var(--sea); }
/* And the link to Friendship keeps Friendship's green, even on orange Me. */
.work-next.to-friendship span { color: var(--green); }
.work-next:hover span { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }

@media (max-width: 760px) {
  .person, .person-flip { grid-template-columns: minmax(0, 1fr); }
  .person-flip .ph-frame { order: 0; }
  .person-photo { aspect-ratio: 4 / 3; }
  .mask-links { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *:not(.love-bit):not(.contact-wave):not(.event-photo):not(.spark-link), *::before, *::after { animation: none !important; transition: none !important; }
}
