/* Page sections for every page. Tokens and shared components live in main.css. */

/* ================= FLAGSHIP: frame run, one lifted ================= */
.flagship .grid { align-items: start; }
.flag-rail { grid-column: 1 / 5; display: flex; flex-direction: column; gap: 20px; padding-right: 12px; }
.flag-line { font-size: var(--step-body); line-height: 1.45; }
.flag-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 8px; font-size: var(--step-body); }
.flag-run { grid-column: 5 / 13; margin-right: calc(-1 * var(--margin)); min-width: 0; }
.flag-run .run { --run-h: clamp(170px, 24vh, 260px); --lift-h: clamp(300px, 50vh, 500px); padding-right: var(--margin); }
.shutter-wrap .shutter { overflow: hidden; }
.flag-run .lifted video { height: var(--lift-h); width: auto; }
@media (min-width: 901px) {
  .flag-run { margin-right: 0; }
  .flag-run .run { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 10px; overflow: visible; padding: 0; }
  .flag-run .run figure { min-width: 0; }
  .flag-run .run .lifted { grid-column: 1 / -1; }
  .flag-run .lifted video { width: 100%; height: auto; }
  .flag-run .run img { width: 100%; height: auto; aspect-ratio: 2.15; object-position: left top; }
  .flag-run .run figcaption { flex-direction: column; gap: 2px; }
}

.flag-detail { margin-top: 88px; row-gap: 48px; }
.flag-col { grid-column: span 4; display: flex; flex-direction: column; gap: 18px; padding-right: 16px; }
.flag-col p { line-height: 1.5; }
.path { list-style: none; display: grid; gap: 12px; counter-reset: none; }
.path li { display: grid; grid-template-columns: 10px 1fr; column-gap: 14px; }
.path li::before { content: ""; width: 10px; height: 10px; background: var(--accent); margin-top: 0.45em; grid-row: span 2; }
.path li span:last-child { font-size: var(--step-small); }
.points { list-style: none; display: grid; gap: 12px; }
.points li { position: relative; padding-left: 22px; line-height: 1.45; }
.points li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 8px; height: 8px; background: var(--accent); }

@media (max-width: 900px) {
  .flag-rail { grid-column: 1 / -1; padding: 0; margin-bottom: 32px; }
  .flag-run { grid-column: 1 / -1; }
  .flag-col { grid-column: 1 / -1; }
  .flag-detail { margin-top: 56px; row-gap: 40px; }
}
@media (max-width: 640px) {
  .flag-run .run { --run-h: 34vw; --lift-h: 52vw; gap: 4px; }
  .flag-run { margin-right: 0; }
  .flag-run .run { padding-right: 0; }
}

/* ================= MORE PROJECTS: one strip per project ================= */
.work-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
.work-rail { grid-column: 1 / 3; position: sticky; top: calc(var(--nav-h) + 24px); align-self: start; display: grid; gap: 8px; }
.strips { grid-column: 3 / 13; display: grid; gap: 112px; }
.strip { min-width: 0; }
.strip-frames { display: flex; gap: 8px; height: 190px; transition: opacity var(--t-ui) ease; }
.strip-frames .zoom {
  flex: var(--r) 1 0; width: 0; min-width: 0; height: 100%; padding: 0; border: 0; display: block;
  background: var(--surface); cursor: zoom-in; overflow: hidden;
}
.strip-frames .zoom img { width: 100%; height: 100%; object-fit: cover; object-position: left top; transition: transform 500ms var(--ease-soft); }
@media (hover: hover) and (pointer: fine) { .strip-frames .zoom:hover img { transform: scale(1.04); } }
@media (hover: hover) and (pointer: fine) {
  .strips:has(.strip-frames:hover) .strip:not(:has(.strip-frames:hover)) .strip-frames { opacity: 0.4; }
}
.strip-cap {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px;
  padding-top: 14px; font-size: var(--step-small);
}
.strip-cap b { font-weight: 500; font-size: var(--step-body); color: var(--ink); }
.strip-cap span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.strip-body { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 28px; margin-top: 28px; }
.strip-body > p, .strip-body > .strip-text { grid-column: 1 / 6; padding-right: 24px; }
.strip-text { display: grid; gap: 16px; }
.strip-video { margin: 0 0 8px; }
.strip-video .shutter { overflow: hidden; background: var(--surface); aspect-ratio: 16 / 9; }
.strip-video video { display: block; width: 100%; height: 100%; object-fit: cover; }
.strip-body > .points { grid-column: 6 / 11; }
.strip-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 32px; }
.strip-links { display: flex; gap: 24px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .work-rail { grid-column: 1 / -1; position: static; display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 32px; }
  .strips { grid-column: 1 / -1; gap: 80px; }
  .strip-body > p, .strip-body > .strip-text, .strip-body > .points { grid-column: 1 / -1; padding: 0; }
}
@media (max-width: 640px) {
  .strip-frames { height: 120px; overflow-x: auto; scroll-snap-type: x mandatory; margin-right: calc(-1 * var(--margin)); padding-right: var(--margin); scrollbar-width: none; }
  .strip-frames .zoom { flex: none; width: calc(120px * var(--r)); height: 120px; scroll-snap-align: start; }
  .strip-cap { grid-template-columns: 1fr auto; }
  .strip-cap span:nth-child(2) { display: none; }
}

/* ================= AWS SERVICES: two-ended rows ================= */
.svc-intro { grid-column: 1 / 6; position: sticky; top: calc(var(--nav-h) + 32px); align-self: start; display: grid; gap: 24px; padding-right: 24px; }
.svc-line { font-size: var(--step-body); max-width: 40ch; }
.svc-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.svc-filter button {
  min-height: 44px; padding: 0 16px; border: 0; border-radius: 0; cursor: pointer;
  background: var(--surface-2); color: var(--ink); font: 400 var(--step-small)/1 var(--font);
  transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out);
}
.svc-filter button:active { transform: scale(0.97); }
.svc-filter button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 500; }
@media (hover: hover) and (pointer: fine) { .svc-filter button[aria-pressed="false"]:hover { background: #3c3c3a; } }
.svc-count { font-variant-numeric: tabular-nums; }
.svc-count span { font-weight: 500; }
.svc-note { max-width: 44ch; }

.svc-list { grid-column: 7 / 13; display: grid; gap: 44px; }
.svc-group h3 { font-size: var(--step-body); font-weight: 400; color: var(--muted); letter-spacing: 0; margin-bottom: 10px; }
.svc-group ul { list-style: none; }
.svc-group li {
  display: grid; grid-template-columns: 28px 1fr auto; column-gap: 14px; align-items: start;
  padding: 10px 0;
}
.svc-group li img { width: 28px; height: 28px; transition: opacity var(--t-ui) ease, filter var(--t-ui) ease; }
.svc-group li b { display: block; font-weight: 500; transition: color var(--t-ui) ease; }
.svc-group li span { display: block; font-size: var(--step-small); color: var(--muted); margin-top: 2px; }
.svc-group li em { font-style: normal; font-size: var(--step-small); color: var(--muted); text-align: right; white-space: nowrap; padding-top: 3px; }
.svc-group li.is-off img { opacity: 0.3; filter: grayscale(1); }
.svc-group li.is-off b { color: var(--muted); font-weight: 400; }
.svc-group li.is-on em { color: var(--accent-strong); }

@media (max-width: 900px) {
  .svc-intro { grid-column: 1 / -1; position: static; padding: 0; margin-bottom: 48px; }
  .svc-list { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .svc-group li { grid-template-columns: 28px 1fr; min-height: 44px; }
  .svc-group li em { grid-column: 2; text-align: left; white-space: normal; padding-top: 4px; }
}

/* ================= CERTIFICATIONS: recognition as a table ================= */
.cert-head { align-items: end; row-gap: 20px; }
.cert-head h2 { grid-column: 1 / 7; }
.cert-line { grid-column: 1 / 7; grid-row: 2; max-width: 44ch; }
.cert-badges { grid-column: 7 / 13; grid-row: 1 / 3; display: flex; justify-content: flex-end; gap: 20px; list-style: none; }
.cert-badges img { width: 112px; height: 112px; object-fit: contain; transition: transform var(--t-ui) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .cert-badges img:hover { transform: translateY(-4px) scale(1.04); } }
.cert-table-wrap { margin-top: 72px; }
.cert-table th.r, .cert-table td.r { text-align: right; padding-right: 12px; }
.cert-table td { vertical-align: middle; }
.cert-table .yr { width: 9%; font-weight: 500; font-variant-numeric: tabular-nums; }
.cert-table tr.group td { border-top: 28px solid var(--bg); }
.cert-name { display: flex; align-items: center; gap: 14px; }
.cert-name img, .no-badge { width: 40px; height: 40px; flex: none; object-fit: contain; }
.no-badge { display: grid; place-items: center; background: var(--surface-2); font-size: var(--step-small); }
.cert-table td.muted { width: 22%; }

@media (max-width: 900px) {
  .cert-head h2, .cert-line, .cert-badges { grid-column: 1 / -1; grid-row: auto; }
  .cert-badges { justify-content: flex-start; flex-wrap: wrap; gap: 12px; }
  .cert-badges img { width: 80px; height: 80px; }
}
@media (max-width: 720px) {
  .cert-table-wrap { margin-top: 48px; }
  .cert-table thead { display: none; }
  .cert-table, .cert-table tbody { display: block; }
  .cert-table tr { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; padding: 12px; }
  .cert-table tbody tr:nth-child(odd) { background: var(--surface); }
  .cert-table tr.group { margin-top: 28px; }
  .cert-table td, .cert-table tbody tr:nth-child(odd) td { padding: 0; background: none; border: 0 !important; width: auto !important; }
  .cert-table td.yr { grid-column: 1 / -1; font-size: var(--step-lead); }
  .cert-table td.yr:has(.sr-only) { display: none; }
  .cert-table td.yr:not(:has(.sr-only)) { margin-bottom: 10px; }
  .cert-table tbody tr td:nth-child(2) { grid-column: 1; }
  .cert-table tbody tr td:nth-child(3) { grid-column: 1; padding-left: 54px; font-size: var(--step-small); }
  .cert-table tbody tr td.r { grid-column: 2; grid-row: 2 / 4; align-self: center; font-size: var(--step-small); }
}

/* ================= JOURNEY: wide photo, colour tile, facts ================= */
.jr-head { row-gap: 40px; align-items: start; }
.jr-intro { grid-column: 1 / 8; display: grid; gap: 24px; }
.jr-intro .lead { max-width: 44ch; }
.jr-facts { grid-column: 9 / 13; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 28px 20px; padding-top: 8px; }
.jr-facts dt { font-size: var(--step-small); color: var(--muted); }
.jr-facts dd { margin: 4px 0 0; font-size: var(--step-small); line-height: 1.4; }

.jr-tiles { margin-top: 72px; align-items: start; }
.jr-photo { grid-column: 1 / 9; margin: 0; position: relative; }
.jr-photo .shutter { aspect-ratio: 16 / 10; }
.jr-photo img { width: 100%; height: 100%; object-fit: cover; }
.jr-paper {
  position: absolute; top: 0; right: 0; width: 340px;
  background: var(--field); color: var(--field-ink); padding: 20px;
  display: grid; gap: 8px; font-size: var(--step-small); line-height: 1.45;
}
.jr-paper b { font-weight: 500; font-size: var(--step-body); }
.jr-now {
  grid-column: 9 / 13; background: var(--accent); color: var(--accent-ink);
  padding: 28px; display: flex; flex-direction: column; gap: 20px; align-self: stretch; justify-content: flex-end;
}
.jr-now-label { font-size: var(--step-small); font-weight: 500; }
.jr-now-label { margin-bottom: auto; }
.jr-now-text { font-size: var(--step-lead); line-height: 1.3; letter-spacing: -0.01em; }

.jr-earlier { margin-top: 72px; row-gap: 40px; }
.jr-earlier figure { grid-column: span 4; margin: 0; display: grid; gap: 14px; align-content: start; }
.jr-earlier img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface); }
.jr-earlier figcaption { display: grid; gap: 6px; padding-right: 16px; }
.jr-earlier b { font-weight: 500; }
.jr-earlier span { font-size: var(--step-small); color: var(--muted); line-height: 1.45; }

@media (max-width: 1100px) {
  .jr-intro { grid-column: 1 / -1; }
  .jr-facts { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .jr-photo, .jr-now { grid-column: 1 / -1; }
  .jr-photo .shutter { aspect-ratio: 4 / 3; }
  .jr-paper { position: static; width: auto; }
  .jr-now { margin-top: 12px; }
  .jr-facts { grid-template-columns: 1fr 1fr; }
  .jr-earlier figure { grid-column: 1 / -1; }
}
@media (min-width: 560px) and (max-width: 900px) {
  .jr-earlier figure { grid-column: span 6; }
}

/* ================= CONTACT: sentence, portrait, links ================= */
.ct-row { align-items: start; row-gap: 32px; }
.ct-text { grid-column: 1 / 6; display: grid; gap: 20px; }
.ct-text { gap: 28px; }
.ct-sentence { font-size: var(--step-lead); line-height: 1.2; font-weight: 500; letter-spacing: -0.015em; max-width: 22ch; }
.ct-portrait { grid-column: 8 / 10; width: 100%; max-width: 168px; aspect-ratio: 1; object-fit: cover; }
.ct-links { grid-column: 10 / 13; display: grid; gap: 18px; }
.ct-q { font-size: var(--step-body); font-weight: 500; }
.ct-links ul { list-style: none; display: grid; gap: 10px; }

@media (max-width: 900px) {
  .ct-text { grid-column: 1 / -1; }
  .ct-sentence { font-size: clamp(1.5rem, 6vw, 2rem); }
  .ct-portrait { grid-column: 1 / 4; max-width: 120px; }
  .ct-links { grid-column: 4 / 13; }
}
@media (max-width: 480px) {
  .ct-portrait { grid-column: 1 / -1; max-width: 96px; }
  .ct-links { grid-column: 1 / -1; }
}


/* ================= CASE STUDY ================= */

/* hero */
.cs-hero { padding-top: clamp(40px, 6vw, 96px); }
.cs-hero .grid { align-items: start; row-gap: 48px; }
.cs-intro { grid-column: 1 / 6; display: flex; flex-direction: column; gap: 24px; }
.cs-intro h1 { font-size: var(--step-display); line-height: 0.9; letter-spacing: -0.04em; }
.cs-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.cs-facts { margin: 8px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; }
.cs-facts dt { font-size: var(--step-small); color: var(--muted); }
.cs-facts dd { margin: 4px 0 0; }
.cs-note { max-width: 52ch; }
.cs-video { grid-column: 6 / 13; margin: 0; }
.cs-video .shutter { overflow: hidden; }
.cs-video video { width: 100%; height: auto; background: var(--surface); }
.cs-video figcaption { display: flex; justify-content: space-between; gap: 16px; padding-top: 10px; }

/* why + roles */
.cs-why { row-gap: 28px; }
.cs-why h2 { grid-column: 1 / 5; }
.cs-why-text { grid-column: 5 / 12; display: grid; gap: 22px; }
.cs-flow { display: flex; flex-wrap: wrap; gap: 8px 0; font-weight: 500; }
.cs-flow span:not(:last-child)::after { content: "→"; color: var(--accent); margin: 0 12px; }
.cs-roles { margin-top: 96px; display: grid; gap: 24px; }
.cs-roles th[scope="row"] { font-weight: 500; color: var(--ink); font-size: var(--step-body); padding: 14px 16px 14px 12px; width: 18%; vertical-align: top; }

/* screens: three across, two rows */
.cs-screens-title { margin-bottom: 32px; }
.cs-screens { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 12px; }
.cs-screens figure { margin: 0; }
.cs-screens img { width: 100%; aspect-ratio: 2.15; object-fit: cover; object-position: left top; background: var(--surface); transition: transform 600ms var(--ease-soft); }
.cs-screens figure > img { display: block; }
.cs-screens figure { overflow: hidden; }
@media (hover: hover) and (pointer: fine) { .cs-screens figure:hover img { transform: scale(1.03); } }
.cs-screens figcaption { padding-top: 10px; font-size: var(--step-small); }

/* architecture */
.cs-arch-head { row-gap: 20px; align-items: end; }
.cs-arch-head h2 { grid-column: 1 / 6; }
.cs-arch-line { grid-column: 7 / 13; max-width: 52ch; }
.cs-diagram { margin: 56px 0 0; background: #222221; padding: clamp(16px, 3vw, 40px); }
.cs-diagram svg { width: 100%; height: auto; }
.cs-diagram figcaption { margin-top: 16px; }
.cs-together { margin-top: 72px; row-gap: 24px; }
.cs-together h3 { grid-column: 1 / 5; }
.cs-steps { grid-column: 5 / 13; display: grid; gap: 14px; padding-left: 1.4em; }
.cs-steps li::marker { color: var(--accent); font-weight: 500; }
.cs-steps b { font-weight: 500; }
.cs-services { margin-top: 96px; display: grid; gap: 16px; }
.cs-services-line { max-width: 64ch; color: var(--muted); margin-bottom: 16px; }
.svc-table th[scope="row"] { font-weight: 500; color: var(--ink); font-size: var(--step-body); padding: 14px 16px 14px 12px; white-space: nowrap; }
.svc-table td:last-child { color: var(--muted); white-space: nowrap; }
.svc-name { display: inline-flex; align-items: center; gap: 12px; }
.svc-name img { width: 24px; height: 24px; flex: none; }
.table-scroll { overflow-x: auto; }

/* moderation */
.cs-mod { row-gap: 48px; align-items: start; }
.cs-mod-intro { grid-column: 1 / 6; display: grid; gap: 24px; }
.cs-states { grid-column: 7 / 13; display: grid; gap: 16px; }
.cs-states b { font-weight: 500; }
.cs-controls {
  list-style: none; margin-top: 88px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
}
.cs-controls li { background: var(--surface); padding: 24px; display: grid; gap: 8px; align-content: start; }
.cs-controls li:first-child { background: var(--accent); color: var(--accent-ink); grid-row: span 2; align-content: end; }
.cs-controls li:first-child span { color: var(--accent-ink); }
.cs-controls li:last-child { grid-column: span 2; }
.cs-controls b { font-weight: 500; font-size: var(--step-lead); line-height: 1.15; letter-spacing: -0.01em; }
.cs-controls span { color: var(--muted); }

/* decisions */
.cs-dec { row-gap: 20px; align-items: end; margin-bottom: 48px; }
.cs-dec h2 { grid-column: 1 / 7; }
.cs-dec-line { grid-column: 7 / 13; }
.cs-dec-line b { font-weight: 500; }
.dec-table td:first-child { width: 42%; font-weight: 500; }

/* lessons */
.cs-lessons { row-gap: 56px; align-items: start; }
.cs-lessons-main { grid-column: 1 / 8; display: grid; gap: 36px; }
.cs-lesson-list { list-style: none; display: grid; gap: 22px; }
.cs-lesson-list li { font-size: var(--step-lead); line-height: 1.3; letter-spacing: -0.01em; }
.cs-lesson-list b { font-weight: 500; }
.cs-next { grid-column: 9 / 13; background: var(--field); color: var(--field-ink); padding: 28px; display: grid; gap: 18px; }
.cs-next ul { list-style: none; display: grid; gap: 12px; }
.cs-next li { padding-left: 20px; position: relative; }
.cs-next li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 8px; height: 8px; background: var(--field-ink); }

/* close */
.cs-close-band { background: var(--accent); color: var(--accent-ink); padding: clamp(28px, 5vw, 64px); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 32px; }
.cs-close-links { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.cs-close-band .link:hover { color: var(--accent-ink); }

@media (max-width: 1000px) {
  .cs-intro, .cs-video { grid-column: 1 / -1; }
  .cs-why h2, .cs-why-text, .cs-arch-head h2, .cs-arch-line, .cs-together h3, .cs-steps,
  .cs-mod-intro, .cs-states, .cs-dec h2, .cs-dec-line, .cs-lessons-main, .cs-next { grid-column: 1 / -1; }
  .cs-screens { grid-template-columns: 1fr 1fr; }
  .cs-controls { grid-template-columns: 1fr 1fr; }
  .cs-controls li:first-child { grid-row: auto; grid-column: 1 / -1; }
  .cs-controls li:last-child { grid-column: auto; }
}
@media (max-width: 700px) {
  .cs-diagram svg { min-width: 680px; }
  .cs-diagram { overflow-x: auto; margin-right: calc(-1 * var(--margin)); margin-left: calc(-1 * var(--margin)); }
  .cs-screens { grid-template-columns: 1fr; gap: 28px; }
  .cs-controls { grid-template-columns: 1fr; }
  .cs-controls li:last-child { grid-column: auto; }
  .cs-facts { grid-template-columns: 1fr; }
  .cs-roles th[scope="row"] { width: auto; }
  .cs-roles table, .cs-roles tbody, .cs-roles tr, .cs-roles th, .cs-roles td { display: block; }
  .cs-roles thead { display: none; }
  .cs-roles tr { padding: 14px 12px; }
  .cs-roles tbody tr:nth-child(odd) { background: var(--surface); }
  .cs-roles tbody tr:nth-child(odd) td, .cs-roles th[scope="row"], .cs-roles td { background: none; padding: 0; }
  .cs-roles th[scope="row"] { margin-bottom: 4px; }
  .svc-table table, .svc-table, .svc-table tbody, .svc-table tr, .svc-table th, .svc-table td,
  .dec-table, .dec-table tbody, .dec-table tr, .dec-table td { display: block; }
  .svc-table thead, .dec-table thead { display: none; }
  .svc-table tr, .dec-table tr { padding: 14px 12px; }
  .svc-table tbody tr:nth-child(odd), .dec-table tbody tr:nth-child(odd) { background: var(--surface); }
  .svc-table tbody tr td, .svc-table tbody tr th[scope="row"], .dec-table tbody tr td { background: none; padding: 0; width: auto; white-space: normal; }
  .svc-table tbody tr td:nth-child(2) { margin: 8px 0 4px; }
  .svc-table tbody tr td:last-child { font-size: var(--step-small); }
  .dec-table tbody tr td:first-child { margin-bottom: 6px; width: auto; padding: 0; }
  .svc-table tbody tr td:first-child, .svc-table tbody tr th:first-child { padding: 0; }
}


/* ================= SHARED PAGE PARTS ================= */
.page-head, .page-top { padding-top: clamp(48px, 7vw, 112px); }
.page-head .grid { align-items: end; row-gap: 28px; }
.page-head-text { grid-column: 1 / 9; display: grid; gap: 24px; }
.page-head h1, .page-h1 { font-size: clamp(2.75rem, 1rem + 4.6vw, 5.5rem); line-height: 0.92; letter-spacing: -0.04em; }
.page-head .lead { max-width: 46ch; }
.page-head-side { grid-column: 9 / 13; justify-self: end; display: grid; gap: 14px; justify-items: end; text-align: right; }
@media (max-width: 900px) {
  .page-head-text, .page-head-side { grid-column: 1 / -1; justify-self: start; justify-items: start; text-align: left; }
}

/* lightbox */
.lightbox { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: min(1400px, 94vw); max-height: 94vh; overflow: visible; }
.lightbox::backdrop { background: rgba(10, 10, 10, 0.86); }
.lightbox figure { margin: 0; }
.lightbox img { max-width: 100%; max-height: 80vh; width: auto; height: auto; margin: 0 auto; background: var(--surface); }
.lightbox figcaption { padding-top: 12px; }
.lightbox .lb-close { position: absolute; top: -56px; right: 0; }
@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] { animation: lbIn 260ms var(--ease-out); }
}
@keyframes lbIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }

/* ================= HOME: featured project ================= */
.feature-grid { align-items: center; row-gap: 40px; }
.feature-media { grid-column: 1 / 8; margin: 0; }
.feature-media .shutter { overflow: hidden; }
.feature-media video { width: 100%; height: auto; background: var(--surface); }
.feature-text { grid-column: 9 / 13; display: grid; gap: 24px; align-content: center; }
.feature-icons { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 12px; }
.feature-icons li { display: flex; align-items: center; gap: 10px; font-size: var(--step-small); }
.feature-icons img { width: 32px; height: 32px; border-radius: 6px; transition: transform var(--t-ui) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .feature-icons li:hover img { transform: translateY(-3px); } }
.feature-links { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
@media (max-width: 900px) { .feature-media, .feature-text { grid-column: 1 / -1; } }

/* ================= HOME: keep exploring ================= */
.explore h2 { margin-bottom: 24px; }
.explore-list { list-style: none; display: grid; gap: 6px; }
.explore-list a {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr) auto; align-items: center; gap: 24px;
  padding: 26px 20px; text-decoration: none; background: var(--surface);
  transition: background-color var(--t-hover) ease;
}
.explore-name { font-size: var(--step-head); font-weight: 500; letter-spacing: -0.03em; line-height: 1; transition: transform var(--t-ui) var(--ease-out); }
.explore-note { color: var(--muted); max-width: 44ch; }
.explore-list .arrow { font-size: var(--step-lead); transition: transform var(--t-ui) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .explore-list a:hover { background: var(--surface-2); }
  .explore-list a:hover .explore-name { transform: translateX(8px); }
  .explore-list a:hover .arrow { transform: translateX(6px); color: var(--accent-strong); }
}
@media (max-width: 720px) {
  .explore-list a { grid-template-columns: 1fr auto; gap: 8px 16px; padding: 20px 16px; }
  .explore-note { grid-column: 1; grid-row: 2; }
  .explore-list .arrow { grid-column: 2; grid-row: 1 / 3; }
}

/* ================= CERTIFICATIONS: cloud cards ================= */
.cert-gallery { padding-top: 72px; }
.cert-cards { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cert-card {
  background: var(--surface); padding: 32px 24px 28px; display: flex; flex-direction: column; gap: 12px;
  transition: background-color var(--t-hover) ease, transform var(--t-ui) var(--ease-out);
}
.cert-card img { width: 148px; height: 148px; object-fit: contain; margin-bottom: 16px; transition: transform 500ms var(--ease-out); }
.cert-card h3 { font-size: var(--step-body); font-weight: 500; letter-spacing: -0.01em; line-height: 1.25; }
.cert-card .link { margin-top: auto; padding-top: 8px; }
@media (hover: hover) and (pointer: fine) {
  .cert-card:hover { background: var(--surface-2); transform: translateY(-4px); }
  .cert-card:hover img { transform: scale(1.05) rotate(-2deg); }
}
.certs h2 { margin-bottom: 8px; }
@media (max-width: 1100px) { .cert-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) {
  .cert-cards { grid-template-columns: 1fr; }
  .cert-card { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 18px; padding: 20px; }
  .cert-card img { width: 84px; height: 84px; margin: 0; }
  .cert-card h3 { flex: 1 1 160px; }
  .cert-card p, .cert-card .link { flex: 1 1 100%; }
}

/* ================= JOURNEY: milestones ================= */
.tl { list-style: none; margin-top: 56px; display: grid; gap: 64px; }
.tl-year { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
.tl-label { grid-column: 1 / 3; font-size: var(--step-lead); font-weight: 500; font-variant-numeric: tabular-nums; position: sticky; top: calc(var(--nav-h) + 20px); align-self: start; }
.tl-items { grid-column: 3 / 13; list-style: none; display: grid; gap: 4px; }
.tl-item { display: grid; grid-template-columns: 9rem minmax(0, 1fr); column-gap: 24px; row-gap: 4px; padding: 16px; background: var(--surface); }
.tl-kind { grid-row: span 2; font-size: var(--step-small); color: var(--muted); display: flex; align-items: baseline; gap: 10px; }
.tl-kind::before { content: ""; width: 8px; height: 8px; flex: none; background: var(--muted); }
.tl-role .tl-kind::before, .tl-education .tl-kind::before { background: var(--accent); }
.tl-project .tl-kind::before { background: var(--field); }
.tl-item b { font-weight: 500; }
.tl-note { color: var(--muted); line-height: 1.45; }
@media (max-width: 720px) {
  .tl { gap: 44px; }
  .tl-label, .tl-items { grid-column: 1 / -1; }
  .tl-label { position: static; margin-bottom: 14px; }
  .tl-item { grid-template-columns: 1fr; }
  .tl-kind { grid-row: auto; }
}

/* ================= ABOUT ================= */
.about-grid { align-items: start; row-gap: 40px; }
.about-portrait { grid-column: 1 / 5; margin: 0; }
.about-portrait .shutter { overflow: hidden; aspect-ratio: 1; }
.about-portrait img { width: 100%; height: 100%; object-fit: cover; }
@media (hover: hover) and (pointer: fine) {
  .about-portrait .shutter.is-in img { transition: transform 900ms var(--ease-soft); }
  .about-portrait .shutter.is-in:hover img { transform: scale(1.05); }
}
.about-text { grid-column: 6 / 13; display: grid; gap: 20px; align-content: start; }
.about-text > * { max-width: 640px; }
.about-text p:not(.lead) { line-height: 1.6; }

/* casual extras: interests and socials */
.about-extra { display: grid; gap: 14px; margin-top: 20px; }
.about-also { margin-top: 4px; font-size: var(--step-small); color: var(--muted); }
.about-also .link { color: var(--muted); }
.about-sub { font-size: var(--step-small); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.about-likes { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.about-likes li > span { display: block; padding: 8px 14px; background: var(--surface); font-size: var(--step-small); transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-ui) var(--ease-out); }
.about-socials { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.about-socials a {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px;
  padding: 14px 16px; background: var(--surface); color: var(--ink); text-decoration: none;
  transition: background-color var(--t-hover) ease, color var(--t-hover) ease;
}
.about-socials b { font-weight: 500; }
.about-socials span { grid-row: 2; font-size: var(--step-small); color: var(--muted); transition: color var(--t-hover) ease; }
.about-socials .arrow { grid-row: 1 / 3; grid-column: 2; font-style: normal; transition: transform var(--t-ui) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .about-likes li > span:hover { background: var(--accent); color: var(--accent-ink); transform: translateY(-2px); }
  .about-socials a:hover { background: var(--accent); color: var(--accent-ink); }
  .about-socials a:hover span { color: var(--accent-ink); }
  .about-socials a:hover .arrow { transform: translate(3px, -3px); }
  .focus-list b { display: block; transition: transform var(--t-ui) var(--ease-out), color var(--t-hover) ease; }
  .focus-list li:hover b { transform: translateX(6px); color: var(--accent-strong); }
}
.about-socials a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 520px) { .about-socials { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: no-preference) {
  .js .about-highlights li { animation: about-hl-in 900ms var(--ease-expo) both; animation-delay: 700ms; }
  .js .about-highlights li:nth-child(2) { animation-delay: 800ms; }
  .js .about-highlights li:nth-child(3) { animation-delay: 900ms; }
}
@keyframes about-hl-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.about-text .lead { margin-top: 6px; }
.focus-grid { row-gap: 32px; align-items: start; }
.focus-grid h2 { grid-column: 1 / 6; }
.focus-list { grid-column: 7 / 13; list-style: none; display: grid; gap: 4px; }
.focus-list li { background: var(--surface); padding: 20px; display: grid; gap: 4px; }
.focus-list b { font-weight: 500; font-size: var(--step-lead); letter-spacing: -0.01em; line-height: 1.2; }
.focus-list span { color: var(--muted); }
.dir-band { background: var(--accent); color: var(--accent-ink); padding: clamp(28px, 5vw, 64px); display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 32px; align-items: end; }
.dir-band .lead { margin-top: 20px; max-width: 40ch; }
.dir-links { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.dir-band .link:hover { color: var(--accent-ink); }
@media (max-width: 900px) {
  .about-portrait { grid-column: 1 / -1; max-width: 360px; }
  .about-portrait .shutter { max-width: 280px; }
  .about-text, .focus-grid h2, .focus-list { grid-column: 1 / -1; }
  .dir-band { grid-template-columns: 1fr; }
}

/* ================= RESUME ================= */
.cv { display: grid; gap: 88px; }
.cv-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 20px; }
.cv-label { grid-column: 1 / 4; font-size: var(--step-lead); letter-spacing: -0.015em; line-height: 1.15; }
.cv-content { grid-column: 4 / 13; display: grid; gap: 36px; }
.cv-job .points, .cv-job p { max-width: 75ch; }
.cv-job { display: grid; gap: 8px; }
.cv-job h3, .cv-content > h3 { font-size: var(--step-lead); letter-spacing: -0.015em; line-height: 1.15; }
.cv-job .points { margin-top: 10px; }
.cv-list { list-style: none; display: grid; gap: 4px; }
.cv-list li { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 24px; padding: 14px 16px; background: var(--surface); }
.cv-list li b { font-weight: 500; }
.cv-list li span { color: var(--muted); }
.cv-skills { margin: 0; display: grid; gap: 4px; }
.cv-skills div { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 8fr); gap: 24px; padding: 14px 16px; background: var(--surface); }
.cv-skills dt { color: var(--muted); }
.cv-skills dd { margin: 0; }
@media (max-width: 900px) {
  .cv { gap: 64px; }
  .cv-label, .cv-content { grid-column: 1 / -1; }
  .cv-list li, .cv-skills div { grid-template-columns: 1fr; gap: 4px; }
}

/* ================= CONTACT PAGE ================= */
.ctp-grid { align-items: start; row-gap: 48px; }
.ctp-text { grid-column: 1 / 7; display: grid; gap: 24px; align-content: start; }
.ctp-text .lead { max-width: 26ch; font-size: clamp(1.5rem, 1rem + 1.4vw, 2.25rem); line-height: 1.15; font-weight: 500; letter-spacing: -0.02em; }
.ctp-text > p.muted { max-width: 48ch; }
.ctp-methods { list-style: none; display: grid; gap: 4px; margin-top: 16px; }
.ctp-methods li { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 16px; padding: 16px; background: var(--surface); align-items: baseline; transition: background-color var(--t-hover) ease; }
.ctp-methods li span { color: var(--muted); }
.ctp-methods a { overflow-wrap: anywhere; }
@media (hover: hover) and (pointer: fine) { .ctp-methods li:hover { background: var(--surface-2); } }
.ctp-portrait { grid-column: 8 / 13; margin: 0; display: grid; gap: 12px; }
.ctp-portrait .shutter { overflow: hidden; aspect-ratio: 1; }
.ctp-portrait img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px) {
  .ctp-text { grid-column: 1 / -1; }
  .ctp-portrait { grid-column: 1 / -1; max-width: 360px; }
}
@media (max-width: 480px) { .ctp-methods li { grid-template-columns: 1fr; gap: 2px; } }


/* ================= PROJECTS: ticketing API detail ================= */
.tk-detail { margin-top: 64px; display: grid; gap: 64px; }
.tk-arch { margin: 0; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); gap: 24px 32px; align-items: start; }
.tk-arch-zoom { padding: 0; border: 0; background: #ffffff; cursor: zoom-in; display: block; overflow: hidden; }
.tk-arch-zoom img { width: 100%; height: auto; transition: transform 500ms var(--ease-soft); }
@media (hover: hover) and (pointer: fine) { .tk-arch-zoom:hover img { transform: scale(1.02); } }
.tk-arch figcaption { display: grid; gap: 14px; }
.tk-arch figcaption b, .tk-detail .points b, .tk-note b { font-weight: 500; }
.tk-block { display: grid; gap: 18px; }
.tk-table td { vertical-align: top; }
.tk-table td:first-child { font-weight: 500; white-space: nowrap; }
.tk-table th.r, .tk-table td.r { text-align: right; font-variant-numeric: tabular-nums; }
.tk-note { max-width: 78ch; }
.tk-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 32px; }
.tk-cols--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tk-col { display: grid; gap: 18px; align-content: start; }
.tk-links { display: flex; flex-wrap: wrap; gap: 14px 32px; }
@media (max-width: 1100px) { .tk-cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) {
  .tk-arch, .tk-cols, .tk-cols--two { grid-template-columns: 1fr; }
  .tk-detail { gap: 48px; margin-top: 48px; }
}
@media (max-width: 640px) {
  .tk-table { font-size: var(--step-small); }
  .tk-table td, .tk-table th { padding: 10px 8px; }
  .tk-table td:first-child { white-space: normal; }
}
.tk-detail code { white-space: nowrap; }


/* ================= PROJECTS: EC2 detail ================= */
.ec2-diagram { margin: 0; display: grid; gap: 14px; }
.ec2-svg-wrap { background: #222221; padding: clamp(16px, 2.5vw, 32px); }
.ec2-svg-wrap svg { width: 100%; height: auto; display: block; }
.ec2-phases { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; counter-reset: phase; }
.ec2-phases li { background: var(--surface); padding: 20px; display: grid; gap: 8px; align-content: start; counter-increment: phase; }
.ec2-phases b { font-weight: 500; font-size: var(--step-body); }
.ec2-phases b::before { content: "Phase " counter(phase) ": "; color: var(--accent-strong); }
.ec2-phases span { color: var(--muted); line-height: 1.45; }
.ec2-next { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
@media (max-width: 1100px) { .ec2-phases { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) {
  .ec2-svg-wrap { overflow-x: auto; margin-inline: calc(-1 * var(--margin)); }
  .ec2-svg-wrap svg { min-width: 680px; }
  .ec2-phases, .ec2-next { grid-template-columns: 1fr; }
}

/* ================= ABOUT: highlights ================= */
.about-portrait { display: grid; gap: 12px; }
.about-highlights { list-style: none; display: grid; gap: 4px; }
.about-highlights li { display: flex; align-items: center; gap: 16px; padding: 14px 16px; background: var(--surface); transition: background-color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) { .about-highlights li:hover { background: var(--surface-2); } }
.about-highlights b { display: block; font-weight: 500; font-size: var(--step-lead); letter-spacing: -0.015em; line-height: 1.1; }
.about-highlights small { display: block; margin-top: 4px; font-size: var(--step-small); color: var(--muted); }
.hl-badges { display: flex; flex: none; width: 88px; }
.hl-badges img { width: 44px; height: 44px; object-fit: contain; }
.hl-num { flex: none; width: 88px; font-size: var(--step-head); font-weight: 500; line-height: 1; letter-spacing: -0.03em; color: var(--accent-strong); text-align: center; }

/* ================= RESUME: document downloads ================= */
.docs { padding-top: clamp(40px, 5vw, 72px); }
.docs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
@media (max-width: 900px) { .docs-grid { grid-template-columns: 1fr; } }
.doc {
  position: relative; background: var(--surface); padding: 28px 24px 24px;
  display: grid; grid-template-columns: 84px 1fr; grid-template-areas: "sheet text" "actions actions"; gap: 22px 20px;
}
.doc-text { grid-area: text; display: grid; gap: 10px; align-content: start; }
.doc-actions { grid-area: actions; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.doc-sheet {
  grid-area: sheet; width: 84px; height: 108px; padding: 12px 10px; background: var(--field);
  display: flex; flex-direction: column; gap: 6px;
  transform-origin: 50% 100%; transition: transform var(--t-ui) var(--ease-out);
}
.doc-sheet b { display: block; height: 7px; width: 62%; background: var(--field-ink); margin-bottom: 4px; }
.doc-sheet i { display: block; height: 3px; background: var(--field-muted); opacity: 0.55; }
.doc-sheet i:nth-child(3n) { width: 72%; }
.doc-sheet i:nth-child(4n + 1) { width: 88%; }
.doc--resume .doc-sheet { border-top: 6px solid var(--accent); }
.doc--cv .doc-sheet { gap: 4px; }
.doc--cv .doc-sheet i { height: 2px; }
.doc--ats .doc-sheet { background: #ecebe6; }
.doc--ats .doc-sheet b { width: 80%; }
@media (hover: hover) and (pointer: fine) { .doc:hover .doc-sheet { transform: translateY(-4px) rotate(-3deg); } }
.doc.is-sending .doc-sheet { animation: docPeel 700ms var(--ease-out); }
@keyframes docPeel { 0% { transform: none; } 30% { transform: translateY(6px) scaleY(0.92); } 100% { transform: none; } }

.dl-btn { position: relative; overflow: hidden; isolation: isolate; min-width: 200px; justify-content: space-between; }
.dl-fill { position: absolute; inset: 0; z-index: -1; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; }
.dl-btn.is-loading .dl-fill, .dl-btn.is-done .dl-fill { transform: scaleX(1); transition: transform 900ms var(--ease-in-out); }
.dl-btn.is-loading, .dl-btn.is-done { color: var(--bg); }
.dl-btn.is-loading .dl-icon { animation: dlDrop 600ms var(--ease-in-out) infinite; }
.dl-btn.is-done .dl-icon { animation: dlPop 420ms var(--ease-expo); }
.dl-btn.is-done { animation: dlThump 420ms var(--ease-out); }
.dl-label, .dl-icon { display: inline-block; }
@keyframes dlDrop { 0% { transform: translateY(-120%); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(120%); opacity: 0; } }
@keyframes dlPop { from { transform: scale(0) rotate(-45deg); } to { transform: none; } }
@keyframes dlThump { 0% { transform: scale(1); } 35% { transform: scale(1.06); } 100% { transform: scale(1); } }
.dl-bit { position: fixed; z-index: 90; pointer-events: none; }
.dl-ghost { position: fixed; z-index: 89; margin: 0; pointer-events: none; box-shadow: 0 18px 30px rgba(0, 0, 0, 0.35); /* taste-skill-ignore: flying sheet is a transient overlay */ }


/* ================= PROJECTS: live Teolohiya walkthrough in the flagship run ================= */
.flag-run .lifted .tsim { width: 100%; }
.flag-run .run .lifted figcaption.tsim-cap { flex-direction: row; justify-content: space-between; align-items: center; }
@media (max-width: 900px) {
  .flag-run .run .lifted .tsim { width: calc(var(--lift-h) * 1200 / 680); max-width: none; }
}

/* ================= PROJECTS: card grid, each card opens a dialog ================= */
.pj-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; margin-top: 48px; }
.pj-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.pj-filter button {
  min-height: 44px; padding: 0 16px; border: 0; border-radius: 0; cursor: pointer;
  background: var(--surface-2); color: var(--ink); font: 400 var(--step-small)/1 var(--font);
  display: inline-flex; align-items: center; gap: 8px;
  transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out);
}
.pj-filter button span { color: var(--muted); font-variant-numeric: tabular-nums; transition: color var(--t-hover) ease; }
.pj-filter button:active { transform: scale(0.97); }
.pj-filter button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 500; }
.pj-filter button[aria-pressed="true"] span { color: var(--accent-ink); }
@media (hover: hover) and (pointer: fine) { .pj-filter button[aria-pressed="false"]:hover { background: #3c3c3a; } }

.pj-section { padding-top: 40px; }
.pj-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px var(--gap); }
.pj { position: relative; min-width: 0; display: grid; gap: 20px; align-content: start; transition: opacity 500ms var(--ease-out), transform 700ms var(--ease-expo); }
.pj[hidden] { display: none; }
.pj.is-entering { opacity: 0; transform: translateY(20px); }
.pj--feature { grid-column: 1 / -1; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); column-gap: 32px; align-items: end; }

.pj-media { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: var(--surface); }
.pj-media .shutter { height: 100%; overflow: hidden; }
.pj-media video, .pj-media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.pj-media video { transition: transform 900ms var(--ease-soft); }
.pj-badge {
  position: absolute; left: 12px; bottom: 12px; z-index: 1; display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; background: rgba(28, 28, 28, 0.72); backdrop-filter: blur(6px); font-size: var(--step-small);
}
.pj-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* screenshot cards cross-fade through their images, so they move like the video cards */
.pj-slides { position: relative; height: 100%; }
.pj-slides img { position: absolute; inset: 0; }
.pj-slides img:not(:first-child) { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .pj-slides img { opacity: 0; animation: pj-fade 14s var(--ease-in-out) infinite; }
  .pj-slides img:nth-child(2) { animation-delay: 3.5s; }
  .pj-slides img:nth-child(3) { animation-delay: 7s; }
  .pj-slides img:nth-child(4) { animation-delay: 10.5s; }
  .pj-dot { animation: pj-pulse 2s ease-in-out infinite; }
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .pj:hover .pj-media video { transform: scale(1.035); }
}
@keyframes pj-fade {
  0% { opacity: 0; transform: scale(1.04); }
  6%, 25% { opacity: 1; }
  31% { opacity: 0; transform: scale(1); }
  100% { opacity: 0; }
}
@keyframes pj-pulse { 50% { opacity: 0.35; } }

.pj-body { display: grid; gap: 12px; align-content: start; }
.pj-kicker { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--step-small); color: var(--muted); }
.pj-kicker span:first-child { color: var(--accent); font-variant-numeric: tabular-nums; }
.pj-title { font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.25rem); letter-spacing: -0.03em; line-height: 1.05; font-weight: 500; }
.pj--feature .pj-title { font-size: clamp(2rem, 1.2rem + 2.6vw, 3.5rem); }
.pj-open {
  padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; line-height: inherit;
  text-align: left; cursor: pointer; transition: color var(--t-hover) ease;
}
.pj-open::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.pj-open:focus-visible { outline: none; }
.pj:has(.pj-open:focus-visible) { outline: 2px solid var(--accent); outline-offset: 8px; }
.pj-line { color: var(--muted); max-width: 54ch; }
.pj-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pj-tags li { font-size: var(--step-small); padding: 5px 10px; background: var(--surface); }
.pj--feature .pj-tags li:first-child { background: var(--accent); color: var(--accent-ink); font-weight: 500; }
.pj-more { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-size: var(--step-small); color: var(--accent-strong); }
.pj-more .arrow { transition: transform var(--t-ui) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .pj:hover .pj-open { color: var(--accent-strong); }
  .pj:hover .pj-more .arrow { transform: translateX(5px); }
}
/* with scripts the write-up lives in the dialog; without them it shows under the card */
.js .pj-detail { display: none; }
.pjd .pj-detail { display: block; }
.pj-detail { margin-top: 12px; }

@media (max-width: 900px) {
  .pj-grid { grid-template-columns: 1fr; gap: 56px; }
  .pj--feature { grid-template-columns: 1fr; }
}

/* ---------- the dialog ---------- */
.pjd {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: transparent; color: var(--ink); overflow: hidden;
}
.pjd::backdrop { background: rgba(12, 12, 12, 0.8); backdrop-filter: blur(8px); }
.pjd-lock, .pjd-lock body { overflow: hidden; }
.pjd-panel {
  height: 100%; max-width: 1280px; margin: 0 auto; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  background: var(--bg); padding: 0 clamp(16px, 4vw, 56px) 64px;
}
.pjd-top {
  position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px 0; background: linear-gradient(var(--bg) 72%, rgba(28, 28, 28, 0));
}
.pjd-kicker { font-size: var(--step-small); color: var(--muted); }
.pjd-close { min-height: 44px; }
.pjd-hero { aspect-ratio: 16 / 9; background: var(--surface); overflow: hidden; }
.pjd-hero video, .pjd-hero img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pjd-hero.is-image img { object-fit: contain; }
.pjd-head { display: grid; gap: 16px; padding: 40px 0 8px; }
.pjd-title { font-size: clamp(2.25rem, 1rem + 4vw, 4.5rem); line-height: 0.95; letter-spacing: -0.04em; font-weight: 500; }
.pjd-line { max-width: 56ch; color: var(--muted); }
.pjd-body { padding-top: 24px; }
.pjd-body .flag-detail { margin-top: 56px; }
.pjd-body .teo-meta { margin-top: 56px; }
.pjd-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 88px; padding-top: 20px; border-top: 1px solid var(--surface-2); }
.pjd-step {
  min-height: 44px; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer;
  font: 500 var(--step-body)/1.2 var(--font); text-align: left; transition: color var(--t-hover) ease;
}
.pjd-step[data-step="1"] { text-align: right; margin-left: auto; }
@media (hover: hover) and (pointer: fine) { .pjd-step:hover { color: var(--accent-strong); } }
@media (prefers-reduced-motion: no-preference) {
  .pjd[open]::backdrop { animation: pjd-fade 300ms ease-out; }
}
@keyframes pjd-fade { from { opacity: 0; } }
@media (max-width: 640px) {
  .pjd-panel { padding-bottom: 40px; }
  .pjd-head { padding-top: 28px; }
  .pjd-body .strip-frames { margin-right: 0; padding-right: 0; }
}

/* ---------- BayanihanDR: Terraform first ---------- */
.bdr-tf { display: grid; gap: 28px; padding: clamp(20px, 4vw, 48px); background: var(--surface); border-top: 3px solid #7b42bc; }
.bdr-tf-head { display: flex; align-items: center; gap: 16px; }
.bdr-tf-mark { width: 48px; height: 48px; flex: none; }
.bdr-kicker { font-size: var(--step-small); letter-spacing: 0.08em; text-transform: uppercase; color: #b48ce8; margin-bottom: 6px; }
.bdr-tf-lead { max-width: 62ch; font-size: var(--step-lead); line-height: 1.35; }
.bdr-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.bdr-switch > div { display: grid; gap: 10px; align-content: start; padding: 20px; background: var(--bg); }
.bdr-switch > div:last-child { box-shadow: inset 3px 0 0 #7b42bc; }
.bdr-switch code { justify-self: start; }
.bdr-switch b, .bdr-checks b, .bdr-aws b { font-weight: 500; }
.bdr-modules { list-style: none; border-top: 1px solid var(--surface-2); }
.bdr-modules li { display: grid; grid-template-columns: 9em 1fr; gap: 6px 20px; padding: 14px 0; border-bottom: 1px solid var(--surface-2); transition: padding-left var(--t-ui) var(--ease-out); }
.bdr-modules b { font-weight: 500; color: #c9a9f0; }
.bdr-modules b::before { content: "module "; color: var(--muted); font-weight: 400; }
.bdr-modules span { color: var(--muted); }
.bdr-checks { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.bdr-checks li { display: grid; gap: 6px; align-content: start; padding: 18px; background: var(--bg); }
.bdr-checks span { font-size: var(--step-small); color: var(--muted); }
.bdr-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--step-small); color: var(--muted); }
.bdr-flow span { color: #b48ce8; }
.bdr-aws { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.bdr-aws li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; padding: 16px; background: var(--surface); transition: background-color var(--t-hover) ease; }
.bdr-aws div { display: grid; gap: 4px; }
.bdr-aws span { font-size: var(--step-small); color: var(--muted); }
@media (hover: hover) and (pointer: fine) {
  .bdr-aws li:hover { background: var(--surface-2); }
  .bdr-modules li:hover { padding-left: 8px; }
}
@media (max-width: 900px) {
  .bdr-switch, .bdr-checks { grid-template-columns: 1fr; }
  .bdr-aws { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .bdr-aws { grid-template-columns: 1fr; }
  .bdr-modules li { grid-template-columns: 1fr; }
}
