/* ==========================================================
   Gladys L. De Chavez: Editorial Corporate Minimalism
   ========================================================== */

:root {
  --navy: #171F29;
  --slate: #252F3A;
  --ivory: #F3EFE8;
  --stone: #D9D0C4;
  --taupe: #A58F78;
  --taupe-deep: #7A6551;   /* taupe for text on light backgrounds (4.8:1) */
  --ink-muted: #4A5663;    /* muted text on light backgrounds */
  --on-dark-muted: #B9B1A6;/* muted text on dark backgrounds */
  --line-dark: rgba(217, 208, 196, .22);
  --line-light: rgba(23, 31, 41, .16);

  --serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --header-h: 76px;
  --maxw: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section-y: clamp(4.5rem, 9vw, 8rem);
  --focus: var(--taupe);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--navy);
  background: var(--navy);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.sec-ivory, .sec-stone, .dialog { --focus: var(--taupe-deep); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ivory); color: var(--navy); padding: .6rem 1rem; border-radius: 4px;
}
.skip-link:focus { top: 1rem; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Type ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.005em; }
h1 { font-size: clamp(2.3rem, 4.5vw, 4rem); line-height: 1.06; }
h2 { font-size: clamp(2rem, 3.6vw, 3.1rem); line-height: 1.1; }
h3 { font-size: 1.5rem; line-height: 1.2; }
.muted { color: var(--ink-muted); }
.small { font-size: .9rem; }
.sec-navy .muted, .sec-slate .muted { color: var(--on-dark-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .85rem 1.7rem; border-radius: 999px; border: 1px solid transparent;
  font-weight: 500; font-size: .95rem; line-height: 1.2; text-decoration: none;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn-sm { padding: .55rem 1.2rem; font-size: .875rem; }
.btn-solid { background: var(--taupe); color: var(--navy); }
.btn-solid:hover { background: var(--stone); }
.btn-outline { border-color: var(--taupe); color: var(--ivory); background: transparent; }
.btn-outline:hover { background: var(--taupe); color: var(--navy); }
.btn-solid-dark { background: var(--navy); color: var(--ivory); }
.btn-solid-dark:hover { background: var(--slate); }
.btn-link {
  background: none; border: 0; padding: .4rem 0; font-weight: 500; font-size: .95rem;
  color: var(--ivory); text-decoration: underline; text-decoration-color: var(--taupe);
  text-underline-offset: .35em; text-decoration-thickness: 1px;
}
.btn-link:hover { text-decoration-color: var(--ivory); }
.btn-link.dark { color: var(--navy); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: var(--navy); color: var(--ivory);
  border-bottom: 1px solid var(--line-dark);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.brand { display: flex; align-items: center; gap: 1.1rem; text-decoration: none; }
.mono { font-family: var(--serif); font-size: 1.7rem; letter-spacing: .04em; line-height: 1; color: var(--taupe); }
.brand-name {
  font-family: var(--serif); font-size: 1.15rem; padding-left: 1.1rem;
  border-left: 1px solid var(--line-dark); line-height: 1.4;
}
.site-nav { display: flex; align-items: center; gap: 2.25rem; }
.site-nav ul { display: flex; gap: 2rem; }
.site-nav a { text-decoration: none; font-size: .95rem; padding: .35rem 0; border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-nav a:hover { border-color: var(--line-dark); }
.site-nav a[aria-current="true"] { border-color: var(--taupe); }

.nav-toggle { display: none; width: 44px; height: 44px; background: none; border: 0; padding: 0; position: relative; }
.nav-toggle .bars, .nav-toggle .bars::before {
  content: ""; position: absolute; left: 11px; right: 11px; height: 1.5px; background: var(--ivory);
  transition: transform .2s, top .2s;
}
.nav-toggle .bars { top: 21px; }
.nav-toggle .bars::before { top: -6px; left: 0; right: 0; }
.nav-toggle[aria-expanded="true"] .bars { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars::before { top: 0; transform: rotate(-90deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: var(--ivory);
  min-height: clamp(560px, calc(100vh - var(--header-h) - 120px), 740px);
  display: flex; align-items: center;
  background:
    radial-gradient(60% 90% at 80% 55%, rgba(37, 47, 58, .9), rgba(23, 31, 41, 0) 70%),
    var(--navy);
}
.hero-grid { position: relative; z-index: 2; }
.hero-copy { max-width: 44rem; padding-block: 3rem; }
.kicker { color: var(--taupe); font-size: .95rem; letter-spacing: .02em; margin-bottom: 1.4rem; }
.hero h1 { margin-bottom: 1.6rem; }
.lead { color: #E4DED3; max-width: 32rem; margin-bottom: 2.2rem; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1.6rem; }

.hero-art {
  position: absolute; z-index: 1; bottom: 0; right: clamp(0px, 3vw, 56px);
  height: 100%; aspect-ratio: 1; pointer-events: none;
}
.hero-art img {
  width: 100%; height: 100%; object-fit: cover; object-position: center bottom;
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, #000 30%, #000 90%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 16%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0, #000 30%, #000 90%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 16%);
  mask-composite: intersect;
}
.arc {
  position: absolute; z-index: -1; width: 88%; aspect-ratio: 1; right: -2%; bottom: -26%;
  border-radius: 50%;
  background: linear-gradient(210deg, rgba(165, 143, 120, .34), rgba(165, 143, 120, 0) 62%);
}

/* One orchestrated entrance */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-copy > :nth-child(2) { animation-delay: .08s; }
  .hero-copy > :nth-child(3) { animation-delay: .16s; }
  .hero-copy > :nth-child(4) { animation-delay: .24s; }
  .hero-art img { animation: fade 1s ease both; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } }
  @keyframes fade { from { opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- Ribbon ---------- */
.ribbon { background: var(--slate); color: var(--ivory); border-top: 1px solid var(--line-dark); }
.ribbon-list { display: grid; grid-template-columns: repeat(4, 1fr); padding-inline: var(--gutter); }
.ribbon-list li + li { border-left: 1px solid var(--line-dark); }
.ribbon-list a {
  display: flex; flex-direction: column; align-items: center; gap: .7rem;
  padding: 1.7rem 1rem; text-align: center; text-decoration: none; font-family: var(--serif); font-size: 1.1rem; line-height: 1.3;
}
.ribbon-list a:hover span { text-decoration: underline; text-decoration-color: var(--taupe); text-underline-offset: .3em; }
.icon { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.ribbon .icon { color: var(--taupe); }

/* ---------- Sections ---------- */
.section { padding-block: var(--section-y); }
.sec-ivory { background: var(--ivory); color: var(--navy); }
.sec-stone { background: var(--stone); color: var(--navy); }
.sec-navy { background: var(--navy); color: var(--ivory); }
.sec-slate { background: var(--slate); color: var(--ivory); }

.split { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(2rem, 7vw, 6rem); align-items: start; }
.split-head { position: sticky; top: calc(var(--header-h) + 2rem); }
.split-head h2 { margin-bottom: 1.1rem; }
.split-head p { max-width: 24rem; }

/* Services */
.service { display: grid; grid-template-columns: 44px 1fr; gap: 1.5rem; padding-block: 2rem; border-top: 1px solid var(--line-light); }
.service:last-child { border-bottom: 1px solid var(--line-light); }
.service .icon { color: var(--taupe-deep); margin-top: .2rem; }
.service h3 { margin-bottom: .5rem; }
.service p { color: var(--ink-muted); max-width: 36rem; }

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2rem, 7vw, 6rem); align-items: center; }
.about-grid.no-photo { grid-template-columns: minmax(0, 46rem); }
.about-copy h2 { margin-bottom: 1.6rem; max-width: 22ch; }
.about-copy > p { color: #E4DED3; max-width: 38rem; margin-bottom: 1.1rem; }
.values { margin-top: 2.4rem; display: grid; gap: 0; max-width: 38rem; }
.values div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding-block: 1rem; border-top: 1px solid var(--line-dark); }
.values div:last-child { border-bottom: 1px solid var(--line-dark); }
.values dt { font-family: var(--serif); font-size: 1.25rem; color: var(--taupe); }
.values dd { color: #E4DED3; }
.about-photo img { width: 100%; height: auto; border-radius: 3px; }
.about-photo figcaption { margin-top: .8rem; font-size: .9rem; color: var(--on-dark-muted); }

/* Work */
.work-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 2.5rem; }
.work-head h2 { margin-bottom: 1rem; }
.work-head p { max-width: 38rem; }
.gallery-controls { display: flex; gap: .6rem; flex-shrink: 0; }
.round-btn { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--navy); background: transparent; display: grid; place-items: center; }
.round-btn:hover { background: var(--navy); color: var(--ivory); }
.round-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.gallery {
  --edge: max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter)));
  display: flex; gap: 1.75rem; overflow-x: auto; padding: 0 var(--edge) 1.5rem;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--edge);
  scrollbar-width: thin; scrollbar-color: var(--taupe-deep) transparent;
}
.gallery > li { flex: 0 0 min(520px, 84vw); scroll-snap-align: start; }
.work-item { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; }
.work-item .preview { transition: transform .25s; }
.work-item:hover .preview { transform: translateY(-3px); }
.work-item .tag { display: block; margin-top: 1.1rem; font-size: .875rem; color: var(--taupe-deep); }
.work-item h3 { margin: .15rem 0 .4rem; }
.work-item p { color: var(--ink-muted); max-width: 30rem; }
.work-item .open { display: inline-block; margin-top: .7rem; font-weight: 500; font-size: .95rem; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .3em; text-decoration-color: var(--taupe-deep); }

/* Preview "paper" */
.preview { background: var(--ivory); border-radius: 4px; padding: 1.25rem; aspect-ratio: 4 / 3; overflow: hidden; color: var(--navy); }
.pv-title { font-size: .78rem; color: var(--ink-muted); margin-bottom: .8rem; display: flex; justify-content: space-between; gap: 1rem; }
.pv-table { width: 100%; border-collapse: collapse; font-size: .74rem; font-variant-numeric: tabular-nums; }
.pv-table th { text-align: left; font-weight: 500; color: var(--ink-muted); padding: .35rem .4rem; border-bottom: 1px solid var(--navy); }
.pv-table td { padding: .42rem .4rem; border-bottom: 1px solid var(--line-light); }
.pv-table .num { text-align: right; }
.pv-table td:first-child { white-space: nowrap; }
.pv-table th.num { text-align: right; }
.st { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.st::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--navy); }
.st.review::before { background: var(--taupe-deep); }
.st.pending::before { background: transparent; border: 1.5px solid var(--ink-muted); }
.pv-foot { margin-top: .8rem; font-size: .72rem; color: var(--ink-muted); }

.pv-chart svg { width: 100%; height: auto; }
.pv-chart text { font-family: var(--sans); fill: var(--ink-muted); font-size: 11px; }
.pv-legend { display: grid; grid-template-columns: repeat(2, 1fr); gap: .25rem 1.5rem; margin-top: .6rem; font-size: .74rem; }
.pv-legend span { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line-light); padding-block: .2rem; }

.pv-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; font-size: .72rem; }
.pv-flow h4 { margin: 0 0 .5rem; font-weight: 500; font-size: .74rem; padding-bottom: .35rem; border-bottom: 1px solid var(--navy); }
.pv-flow li { padding: .4rem .5rem; margin-bottom: .4rem; background: #E8E2D7; border-radius: 3px; line-height: 1.3; }

.pv-mail { font-size: .8rem; line-height: 1.55; }
.pv-mail .meta { color: var(--ink-muted); border-bottom: 1px solid var(--line-light); padding-bottom: .5rem; margin-bottom: .7rem; }
.pv-mail .meta b { font-weight: 500; color: var(--navy); }
.pv-mail p + p { margin-top: .55rem; }

/* larger previews inside the viewer dialog */
.viewer-preview { background: #FBF9F5; border: 1px solid var(--line-light); aspect-ratio: auto; padding: clamp(1rem, 3vw, 2rem); margin-top: 1.25rem; }
.viewer-preview .pv-table { font-size: .9rem; }
.viewer-preview .pv-flow { font-size: .85rem; }
.viewer-preview .pv-title, .viewer-preview .pv-foot, .viewer-preview .pv-legend { font-size: .85rem; }
.pv-mail-stack { display: grid; gap: 1.5rem; }
.pv-mail-stack .pv-mail { padding-bottom: 1.5rem; border-bottom: 1px solid var(--line-light); font-size: .95rem; }
.pv-mail-stack .pv-mail:last-child { border-bottom: 0; padding-bottom: 0; }
.viewer-note { margin-top: 1.1rem; color: var(--ink-muted); font-size: .95rem; }

/* Credentials */
.sec-slate h2 { margin-bottom: 2rem; }
.tabs { display: flex; gap: 2rem; border-bottom: 1px solid var(--line-dark); margin-bottom: 2.25rem; }
.tabs [role="tab"] {
  background: none; border: 0; padding: .75rem 0; margin-bottom: -1px; font-size: 1.05rem; color: var(--on-dark-muted);
  border-bottom: 2px solid transparent;
}
.tabs [role="tab"][aria-selected="true"] { color: var(--ivory); border-bottom-color: var(--taupe); }
.cert-tools { display: grid; gap: 1.25rem; margin-bottom: 1.75rem; }
#cert-search {
  width: 100%; max-width: 26rem; background: transparent; border: 0; border-bottom: 1px solid var(--stone);
  padding: .6rem 0; color: var(--ivory); border-radius: 0;
}
#cert-search::placeholder { color: var(--on-dark-muted); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { background: none; border: 1px solid var(--line-dark); border-radius: 999px; padding: .35rem 1rem; font-size: .9rem; color: var(--ivory); }
.chip:hover { border-color: var(--taupe); }
.chip[aria-pressed="true"] { background: var(--taupe); border-color: var(--taupe); color: var(--navy); }

.cert-row { display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 1.5rem; padding-block: 1.2rem; border-top: 1px solid var(--line-dark); }
.cert-row:last-child { border-bottom: 1px solid var(--line-dark); }
.cert-thumb { width: 96px; height: 68px; background: var(--navy); border: 1px solid var(--line-dark); border-radius: 2px; overflow: hidden; display: grid; place-items: center; }
.cert-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cert-thumb svg { width: 26px; height: 26px; fill: none; stroke: var(--taupe); stroke-width: 1.25; }
.cert-row h3 { font-size: 1.3rem; margin-bottom: .2rem; }
.cert-meta { color: var(--on-dark-muted); font-size: .95rem; }
.cert-row .btn-link { white-space: nowrap; }

.tgroup { margin-bottom: 2.5rem; }
.tgroup h3 { font-size: 1.3rem; color: var(--taupe); margin-bottom: .8rem; }
.trow { display: grid; grid-template-columns: 8rem 1fr; gap: 1.5rem; padding-block: .95rem; border-top: 1px solid var(--line-dark); }
.trow:last-child { border-bottom: 1px solid var(--line-dark); }
.trow .when { color: var(--on-dark-muted); font-size: .95rem; }
.trow .what { font-weight: 500; }
.trow .who { color: var(--on-dark-muted); font-size: .95rem; }
.trow .btn-link { margin-top: .35rem; font-size: .9rem; }
.empty { color: var(--on-dark-muted); max-width: 34rem; padding-block: 1rem; }

/* Contact */
.contact-list { margin-bottom: 2rem; }
.contact-list li { display: grid; grid-template-columns: 7rem 1fr; padding-block: 1rem; border-top: 1px solid var(--line-light); }
.contact-list li:last-child { border-bottom: 1px solid var(--line-light); }
.contact-list .label { color: var(--ink-muted); }
.contact-list a { text-underline-offset: .3em; text-decoration-color: var(--taupe-deep); word-break: break-word; }
.contact-body .small { margin-top: 1rem; }

/* Footer */
.site-footer { background: var(--navy); color: var(--on-dark-muted); padding-block: 1.75rem; font-size: .9rem; border-top: 1px solid var(--line-dark); }

/* ---------- Dialogs ---------- */
.dialog {
  width: min(520px, 94vw); max-height: 92vh; padding: clamp(1.25rem, 3vw, 2rem);
  border: 0; border-radius: 6px; background: var(--ivory); color: var(--navy); overflow: auto;
}
.dialog-wide { width: min(940px, 94vw); }
.dialog::backdrop { background: rgba(23, 31, 41, .72); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.dialog-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.close { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-light); background: none; display: grid; place-items: center; }
.close:hover { background: var(--navy); color: var(--ivory); }
.close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

.field { margin-top: 1.1rem; display: grid; gap: .3rem; }
.field label { font-weight: 500; font-size: .95rem; }
.field .opt { font-weight: 400; color: var(--ink-muted); }
.field input, .field textarea {
  width: 100%; padding: .7rem .8rem; background: #fff; border: 1px solid #b9b1a6; border-radius: 4px;
}
.field input[aria-invalid="true"] { border-color: #9b2c2c; }
.err { color: #9b2c2c; font-size: .875rem; min-height: 0; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.status { margin-top: 1rem; font-size: .95rem; min-height: 1.2em; }
.dialog-actions { display: flex; align-items: center; gap: 1.5rem; margin-top: 1.25rem; }

.viewer-media { margin-top: 1rem; }
.viewer-media img { width: 100%; height: auto; border: 1px solid var(--line-light); }
.viewer-media iframe { width: 100%; height: min(70vh, 640px); border: 1px solid var(--line-light); }
.viewer-sub { color: var(--ink-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .site-nav ul { gap: 1.4rem; }
  .site-nav { gap: 1.4rem; }
}

@media (max-width: 860px) {
  :root { --header-h: 68px; }
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 1.25rem;
    background: var(--navy); padding: 1.25rem var(--gutter) 1.75rem; border-bottom: 1px solid var(--line-dark);
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; gap: .4rem; width: 100%; }
  .site-nav ul a { display: block; padding: .6rem 0; font-size: 1.1rem; }
  .brand-name { font-size: 1.02rem; padding-left: .8rem; }
  .brand { gap: .8rem; }

  .hero { flex-direction: column; align-items: stretch; min-height: 0; }
  .hero-copy { padding-block: 3rem 1rem; }
  .hero-art { position: relative; right: auto; height: auto; width: min(100%, 520px); margin: 0 0 0 auto; }
  .hero-art img {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
  }
  .arc { width: 100%; bottom: -30%; right: 0; }

  .ribbon-list { grid-template-columns: repeat(2, 1fr); padding-inline: 0; }
  .ribbon-list li:nth-child(3) { border-left: 0; }
  .ribbon-list li:nth-child(n+3) { border-top: 1px solid var(--line-dark); }

  .split, .about-grid { grid-template-columns: 1fr; }
  .split-head { position: static; }
  .work-head { align-items: flex-start; flex-direction: column; }
  .gallery-controls { display: none; }
  .values div { grid-template-columns: 1fr; gap: .1rem; }
  .cert-row { grid-template-columns: 72px 1fr; }
  .cert-thumb { width: 72px; height: 54px; }
  .cert-row .btn-link { grid-column: 2; justify-self: start; }
  .trow { grid-template-columns: 1fr; gap: .15rem; }
  .contact-list li { grid-template-columns: 1fr; gap: .1rem; }
}

@media (max-width: 600px) {
  .preview:not(.viewer-preview) .pv-table th:nth-child(1),
  .preview:not(.viewer-preview) .pv-table td:nth-child(1),
  .preview:not(.viewer-preview) .pv-table th:nth-child(4),
  .preview:not(.viewer-preview) .pv-table td:nth-child(4) { display: none; }
  .viewer-preview { overflow-x: auto; }
}

@media (max-width: 480px) {
  .ribbon-list a { padding: 1.3rem .5rem; font-size: 1rem; }
  .pv-flow { grid-template-columns: repeat(2, 1fr); }
}


/* Certificate albums */
.cert-albums {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}
.album-card {
  display: flex; flex-direction: column; width: 100%; height: 100%;
  padding: 0; overflow: hidden; text-align: left; color: var(--ivory);
  background: rgba(23, 31, 41, .38); border: 1px solid var(--line-dark);
  border-radius: 5px; transition: border-color .2s, transform .2s, background-color .2s;
}
.album-card:hover { border-color: var(--taupe); background: rgba(23, 31, 41, .62); transform: translateY(-3px); }
.album-cover {
  display: grid; place-items: center; aspect-ratio: 16 / 10; overflow: hidden;
  background: linear-gradient(145deg, #303c48, #171f29);
  border-bottom: 1px solid var(--line-dark);
}
.album-cover img { width: 100%; height: 100%; object-fit: cover; opacity: .82; }
.album-icon { display: grid; place-items: center; width: 100%; height: 100%; }
.album-icon svg { width: 48px; height: 48px; fill: none; stroke: var(--taupe); stroke-width: 1.15; stroke-linecap: round; stroke-linejoin: round; }
.album-card-body { display: grid; gap: .35rem; padding: 1.1rem 1.15rem 1.2rem; }
.album-card-title { font-family: var(--serif); font-size: 1.35rem; line-height: 1.2; }
.album-card-count { color: var(--on-dark-muted); font-size: .9rem; }
.album-card-link { margin-top: .45rem; color: var(--taupe); font-size: .9rem; font-weight: 500; }
.album-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.album-count { color: var(--on-dark-muted); font-size: .9rem; }
.cert-unavailable { color: var(--on-dark-muted); font-size: .85rem; white-space: nowrap; }
.cert-thumb .album-icon svg { width: 26px; height: 26px; }
@media (max-width: 860px) { .cert-albums { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) {
  .cert-albums { grid-template-columns: 1fr; }
  .album-detail-head { align-items: flex-start; flex-direction: column; gap: .2rem; }
}
