/* Alex Rivera — portfolio. Editorial paper + ink, coral accent, mono details. */
:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --bg-2: #efece4;
  --card: #fffdf9;
  --ink: #141414;
  --ink-2: #3d3d3a;
  --muted: #6b6a64;
  --line: #dedad0;
  --accent: #ff5a36;       /* decorative / large */
  --accent-ink: #c2381a;   /* accessible text on paper */
  --accent-soft: #ffe3d9;
  --ok: #1a7f45;
  --err: #b42318;
  --code-bg: #141414;
  --shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(20,20,20,.35);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --r: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f0f10; --bg-2: #161618; --card: #1a1a1d; --ink: #f2f0ea; --ink-2: #cfccc4; --muted: #a09d95; --line: #2c2c30;
    --accent: #ff7a50; --accent-ink: #ff8f6b; --accent-soft: #3a1d14; --ok: #5fd08f; --err: #ff8a80; --code-bg: #050505;
    --shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(0,0,0,.8);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f10; --bg-2: #161618; --card: #1a1a1d; --ink: #f2f0ea; --ink-2: #cfccc4; --muted: #a09d95; --line: #2c2c30;
  --accent: #ff7a50; --accent-ink: #ff8f6b; --accent-soft: #3a1d14; --ok: #5fd08f; --err: #ff8a80; --code-bg: #050505;
  --shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(0,0,0,.8);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 17px/1.6 var(--sans); color: var(--ink); background: var(--bg); overflow-x: hidden; transition: background .3s, color .3s; }
img { max-width: 100%; display: block; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.08; letter-spacing: -.03em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1160px, 100% - 48px); margin-inline: auto; }
.skip-link { position: absolute; top: -50px; left: 12px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 300; }
.skip-link:focus { top: 12px; }
.back-link { position: fixed; left: 14px; bottom: 14px; z-index: 60; font: 600 12px/1 var(--mono); padding: 10px 13px; border-radius: 999px; text-decoration: none; background: var(--ink); color: var(--bg); box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.back-link:hover { background: var(--accent); color: #140500; }
.resume { display: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 24px; border-radius: 999px; border: 1.5px solid var(--ink); font-weight: 650; font-size: 16px; text-decoration: none; transition: transform .2s, background .2s, color .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #140500; }
.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--bg); }
.btn-small { min-height: 42px; padding: 0 16px; font-size: 14px; }
.btn-small svg { width: 17px; height: 17px; }
.btn-block { width: 100%; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); display: grid; place-items: center; color: var(--ink); position: relative; }
.icon-btn:hover { border-color: var(--ink); }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; } :root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .i-sun { display: block; } :root:not([data-theme="light"]) .i-moon { display: none; } }

/* Nav */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color .3s; }
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; gap: 20px; height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; }
.logo-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--ink); color: var(--accent); display: grid; place-items: center; font: 700 14px var(--mono); }
.nav-menu { margin-left: auto; display: flex; align-items: center; gap: 26px; }
.nav-menu ul { display: flex; gap: 26px; }
.nav-menu ul a { text-decoration: none; font-weight: 550; font-size: 15px; padding: 6px 0; position: relative; color: var(--ink-2); }
.nav-menu ul a:hover, .nav-menu ul a.active { color: var(--ink); }
.nav-menu ul a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); border-radius: 2px; }
.nav-tools { display: flex; gap: 8px; }
.menu-btn { display: none; }
.menu-btn span { position: absolute; left: 12px; right: 12px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .3s; }
.menu-btn span:first-child { top: 16px; } .menu-btn span:last-child { top: 24px; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* Hero */
.hero { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; padding: clamp(40px, 7vw, 96px) 0 48px; }
.status { display: inline-flex; align-items: center; gap: 10px; font: 500 13.5px var(--mono); color: var(--ink-2); background: var(--card); border: 1px solid var(--line); padding: 8px 14px; border-radius: 999px; margin-bottom: 26px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.9rem); font-weight: 800; }
.hl { background: linear-gradient(transparent 62%, var(--accent) 62%, var(--accent) 92%, transparent 92%); padding: 0 .05em; }
:root[data-theme="dark"] .hl { background: none; color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hl { background: none; color: var(--accent); } }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--ink-2); max-width: 580px; margin-top: 22px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 44px; max-width: 560px; }
.hero-stats li { border-top: 1.5px solid var(--ink); padding-top: 12px; }
.hero-stats strong { display: block; font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }
.hero-stats span { font-size: 14px; color: var(--muted); line-height: 1.35; display: block; }
.hero-photo { position: relative; margin: 0; }
.hero-photo img { border-radius: 28px 28px 120px 28px; aspect-ratio: 5/6; object-fit: cover; width: 100%; filter: saturate(.9); box-shadow: var(--shadow); }
.hero-photo::before { content: ""; position: absolute; inset: 22px -22px -22px 22px; border: 2px solid var(--accent); border-radius: 28px 28px 120px 28px; z-index: -1; }
.code-card { position: absolute; left: -44px; bottom: 36px; background: var(--code-bg); color: #e8e6df; font: 13px/1.6 var(--mono); padding: 16px 18px; border-radius: 14px; box-shadow: 0 20px 40px -12px rgba(0,0,0,.45); }
.c-com { color: #8a877f; } .c-key { color: #ff8f6b; } .c-str { color: #9fe0a8; } .c-num { color: #f7c86a; }

.logos { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; border-block: 1px solid var(--line); padding: 20px 0; margin-top: 28px; }
.logos p { font: 500 13px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.logos ul { display: flex; gap: 12px 36px; flex-wrap: wrap; }
.logos li { font-weight: 800; font-size: 19px; letter-spacing: -.02em; color: var(--muted); }

/* Sections */
.section { padding: clamp(64px, 9vw, 120px) 0 0; }
.sec-head { margin-bottom: 36px; }
.kicker { font: 500 13.5px var(--mono); color: var(--accent-ink); margin-bottom: 12px; letter-spacing: .02em; }
.sec-head h2, .contact h2 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); font-weight: 800; }

/* Work */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.filter { min-height: 42px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-weight: 600; font-size: 15px; color: var(--ink-2); }
.filter:hover { border-color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filter .n { font: 12px var(--mono); opacity: .65; margin-left: 6px; }
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.project { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; transition: transform .3s, box-shadow .3s; animation: fadeUp .45s ease both; }
.project:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.project.featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.3fr 1fr; }
.p-media { position: relative; overflow: hidden; aspect-ratio: 3/2; background: var(--bg-2); }
.project.featured .p-media { aspect-ratio: auto; min-height: 340px; }
.p-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.project:hover .p-media img { transform: scale(1.04); }
.p-year { position: absolute; top: 14px; left: 14px; font: 600 12px var(--mono); background: var(--card); color: var(--ink); padding: 5px 10px; border-radius: 999px; }
.p-body { padding: 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.p-cat { font: 500 13px var(--mono); color: var(--accent-ink); }
.p-body h3 { font-size: 1.5rem; font-weight: 750; }
.project.featured h3 { font-size: 2rem; }
.p-body p { color: var(--ink-2); font-size: 16px; }
.p-result { font-weight: 650; color: var(--ink) !important; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font: 12.5px var(--mono); padding: 4px 10px; border-radius: 6px; background: var(--bg-2); color: var(--ink-2); border: 1px solid var(--line); }
.p-foot { margin-top: auto; padding-top: 8px; }
.p-link { background: none; border: 0; padding: 8px 0; font-weight: 700; display: inline-flex; gap: 8px; align-items: center; color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 5px; text-decoration-thickness: 2px; }
.p-link:hover { color: var(--accent-ink); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.skill-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.skill-card h3 { font-size: 1.1rem; font-weight: 750; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; letter-spacing: -.01em; }
.skill-card h3 span { font: 600 12px var(--mono); color: var(--accent-ink); }
.skill-card li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px dashed var(--line); font-size: 15.5px; }
.lvl { display: inline-flex; gap: 3px; }
.lvl i { width: 16px; height: 6px; border-radius: 3px; background: var(--line); }
.lvl-1 i:nth-child(-n+1), .lvl-2 i:nth-child(-n+2), .lvl-3 i { background: var(--accent); }
.skill-legend { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 18px; font-size: 14px; color: var(--muted); }
.skill-legend li { display: flex; align-items: center; gap: 8px; }

/* Timeline */
.timeline { position: relative; border-left: 2px solid var(--line); margin-left: 8px; }
.tl-item { position: relative; padding: 0 0 40px 36px; display: grid; grid-template-columns: 190px 1fr; gap: 20px; }
.tl-item::before { content: ""; position: absolute; left: -9px; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--ink); }
.tl-item.current::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.tl-when { font: 500 14px var(--mono); color: var(--muted); padding-top: 3px; }
.tl-when b { display: block; color: var(--ink); font-weight: 600; }
.tl-body h3 { font-size: 1.35rem; font-weight: 750; letter-spacing: -.02em; }
.tl-org { color: var(--accent-ink); font-weight: 650; margin: 2px 0 10px; }
.tl-body > p { color: var(--ink-2); }
.tl-body ul { margin-top: 10px; display: grid; gap: 6px; }
.tl-body li { padding-left: 20px; position: relative; color: var(--ink-2); font-size: 16px; }
.tl-body li::before { content: "→"; position: absolute; left: 0; color: var(--accent-ink); }

/* Quotes */
.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.quote { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; display: flex; flex-direction: column; justify-content: space-between; gap: 22px; }
.quote blockquote { margin: 0; font-size: 18px; line-height: 1.55; font-weight: 500; letter-spacing: -.01em; }
.quote figcaption { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.quote figcaption strong { display: block; color: var(--ink); font-size: 15px; }
.quote img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 80px); align-items: start; padding-bottom: 40px; }
.contact-list { margin-top: 32px; display: grid; gap: 4px; }
.contact-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.cl-label { font: 500 13px var(--mono); color: var(--muted); width: 90px; flex: none; }
.contact-list a { font-weight: 650; overflow-wrap: anywhere; }
.copy-btn { margin-left: auto; border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; font: 600 12.5px var(--mono); padding: 0 12px; min-height: 36px; }
.copy-btn:hover { border-color: var(--ink); }
.socials { display: flex; gap: 16px; flex-wrap: wrap; }
.socials a { font-weight: 600; }
.socials .linkish { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.form-card { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: clamp(22px, 3vw, 36px); box-shadow: var(--shadow); }
.field { display: flex; flex-direction: column; margin-bottom: 6px; border: 0; padding: 0; min-width: 0; }
.field label, .field legend { font-weight: 650; font-size: 15px; margin-bottom: 8px; padding: 0; }
.field input, .field select, .field textarea { width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); transition: border-color .2s, box-shadow .2s; }
.field textarea { resize: vertical; min-height: 130px; }
.field select { margin-bottom: 20px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--accent-soft); }
.field.invalid input, .field.invalid textarea { border-color: var(--err); }
.err { color: var(--err); font-size: 13.5px; min-height: 20px; margin-top: 4px; }
.field-foot { display: flex; justify-content: space-between; gap: 12px; }
.count { font: 12px var(--mono); color: var(--muted); margin-top: 6px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pills label { margin: 0; font-weight: 500; position: relative; }
.pills input { position: absolute; opacity: 0; }
.pills span { display: inline-flex; align-items: center; min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); cursor: pointer; font-size: 15px; }
.pills input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pills input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.sent { text-align: center; padding: 30px 10px; outline: none; }
.sent-icon { width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); }
.sent-icon svg { width: 36px; height: 36px; stroke: var(--accent-ink); stroke-width: 2.5; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .6s .1s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.sent h3 { font-size: 1.8rem; margin-bottom: 10px; }
.sent p { color: var(--ink-2); margin-bottom: 8px; }
.sent .small { font-size: 14px; color: var(--muted); margin-bottom: 20px; }

.footer { border-top: 1px solid var(--line); margin-top: 80px; padding: 28px 0 80px; font-size: 14px; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Dialog */
.dlg { border: 0; padding: 0; border-radius: 22px; width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--card); color: var(--ink); box-shadow: 0 40px 80px -20px rgba(0,0,0,.5); }
.dlg::backdrop { background: rgba(10,10,10,.6); backdrop-filter: blur(3px); }
.dlg[open] { animation: fadeUp .25s ease; }
.dlg img { width: 100%; aspect-ratio: 16/8; object-fit: cover; }
.dlg-body { padding: 26px 28px 30px; }
.dlg-body h2 { font-size: 2rem; font-weight: 800; margin-bottom: 12px; }
.dlg-body > p { color: var(--ink-2); }
.dlg-close { position: absolute; top: 12px; right: 12px; font-size: 26px; line-height: 1; z-index: 2; }
.pd-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 22px 0; }
.pd-facts div { background: var(--bg-2); border-radius: 12px; padding: 12px 14px; }
.pd-facts dt { font: 12px var(--mono); color: var(--muted); }
.pd-facts dd { margin: 4px 0 0; font-weight: 650; font-size: 15px; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 140%); visibility: hidden; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-size: 15px; z-index: 100; transition: transform .3s, visibility .3s; max-width: calc(100vw - 32px); }
.toast.show { transform: translate(-50%, 0); visibility: visible; }

/* ============ Responsive ============ */
@media (max-width: 1020px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .quotes { grid-template-columns: 1fr 1fr; }
  .quotes .quote:last-child { grid-column: 1 / -1; }
  .code-card { left: -20px; }
}
@media (max-width: 860px) {
  .menu-btn { display: grid; }
  .nav-menu {
    position: fixed; top: 72px; left: 0; right: 0; height: calc(100vh - 72px); height: calc(100dvh - 72px);
    background: var(--bg); flex-direction: column; align-items: stretch; gap: 0; padding: 16px 24px 32px;
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .25s, transform .25s, visibility .25s;
  }
  .nav-menu.open { opacity: 1; visibility: visible; transform: none; }
  .nav-menu ul { flex-direction: column; gap: 0; }
  .nav-menu ul a { display: flex; min-height: 64px; align-items: center; font-size: 30px; font-weight: 800; letter-spacing: -.03em; border-bottom: 1px solid var(--line); color: var(--ink); }
  .nav-menu ul a.active::after { display: none; }
  .print-btn { margin-top: 24px; min-height: 52px; font-size: 16px; }
  .nav-tools { margin-left: auto; }
  .hero { grid-template-columns: 1fr; }
  .hero-photo { max-width: 420px; order: -1; margin-right: 22px; }
  .hero-photo img { aspect-ratio: 1; border-radius: 24px 24px 90px 24px; }
  .hero-photo::before { border-radius: 24px 24px 90px 24px; }
  .code-card { left: auto; right: -12px; bottom: -18px; font-size: 12px; }
  .project.featured { grid-template-columns: 1fr; }
  .project.featured .p-media { min-height: 0; aspect-ratio: 3/2; }
  .tl-item { grid-template-columns: 1fr; gap: 6px; }
  .contact { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 32px); }
  .logo-name { display: none; }
  .hero { padding-top: 28px; }
  .hero h1 { font-size: 2.45rem; }
  .status { font-size: 12px; margin-bottom: 20px; }
  .hero-photo { max-width: none; }
  .hero-photo img { aspect-ratio: 4/3.4; object-position: 50% 20%; }
  .code-card { display: none; }
  .hero-cta .btn { flex: 1 1 100%; }
  .hero-stats { gap: 12px; margin-top: 32px; }
  .hero-stats strong { font-size: 1.55rem; }
  .hero-stats span { font-size: 12.5px; }
  .logos { gap: 12px; }
  .logos ul { gap: 8px 20px; }
  .logos li { font-size: 16px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 2px 16px 6px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filter { flex: none; }
  .projects, .skills-grid, .quotes { grid-template-columns: 1fr; }
  .quotes .quote:last-child { grid-column: auto; }
  .project.featured h3 { font-size: 1.5rem; }
  .p-body { padding: 20px; }
  .tl-item { padding-left: 26px; padding-bottom: 32px; }
  .quote { padding: 22px; }
  .quote blockquote { font-size: 17px; }
  .pd-facts { grid-template-columns: 1fr 1fr; }
  .dlg { margin: auto auto 0; width: 100vw; max-width: 100vw; border-radius: 22px 22px 0 0; max-height: 92vh; }
  .dlg-body { padding: 20px; }
  .dlg-body h2 { font-size: 1.6rem; }
  .cl-label { width: 100%; }
  .copy-btn { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* "All projects" link: on phones it moves into the page footer (see app.js) so it never covers content;
   without JS it falls back to a small round button */
@media (max-width: 640px) {
  .back-link { width: 40px; height: 40px; min-height: 0; padding: 0 !important; display: inline-grid; place-items: center; overflow: hidden; font-size: 0 !important; letter-spacing: 0; }
  .back-link::before { content: "\2190"; font-size: 1.1rem; line-height: 1; }
}
.back-foot { display: flex; justify-content: center; width: 100%; flex-basis: 100%; grid-column: 1 / -1; padding: 16px 16px 24px; }
.back-link.in-footer { position: static; inset: auto; width: auto; height: auto; min-height: 42px; padding: 0 18px !important; display: inline-flex; align-items: center; font-size: .82rem !important; letter-spacing: .02em; opacity: 1; transform: none; box-shadow: none; }
.back-link.in-footer::before { content: none; }
