/* ==========================================================================
   rakib-hasan.com — public site
   Palette is taken from the logo: navy blue (#12508C) sweeping into plum (#8B3A8E).
   Display type: Bricolage Grotesque. Text: Public Sans.
   ========================================================================== */

:root {
  --paper: #F5F7FB;
  --surface: #FFFFFF;
  --tint: #ECF1F8;
  --ink: #0E2238;
  --ink-soft: #2C3E57;
  --muted: #56647B;
  --line: #D9E0EB;
  --line-strong: #BCC7D8;
  --blue: #12508C;
  --blue-strong: #0C3F70;
  --blue-wash: #E3ECF7;
  --plum: #8B3A8E;
  --plum-wash: #F4E8F4;
  --success: #1F7A4D;
  --success-wash: #E4F4EA;
  --danger: #B42318;
  --danger-wash: #FDECEA;
  --footer-bg: #0E2238;
  --footer-ink: #C9D4E5;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-text: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: clamp(1.75rem, 1.4rem + 1.4vw, 2.4rem);
  --step-4: clamp(2.1rem, 1.6rem + 2.2vw, 3.1rem);
  --step-hero: clamp(3rem, 1.6rem + 6.2vw, 6.4rem);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --section: clamp(4rem, 3rem + 5vw, 7.5rem);
  --header-h: 72px;
  --focus: 0 0 0 3px var(--paper), 0 0 0 5px var(--blue);
  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #0B1626;
  --surface: #111F35;
  --tint: #0E1B2E;
  --ink: #E8EEF7;
  --ink-soft: #C9D4E5;
  --muted: #9AA9C0;
  --line: #22344F;
  --line-strong: #33496A;
  --blue: #7FB3EA;
  --blue-strong: #A6CBF2;
  --blue-wash: #16304F;
  --plum: #D58AD6;
  --plum-wash: #2E1B37;
  --success: #6FD3A0;
  --success-wash: #12352A;
  --danger: #FF9C92;
  --danger-wash: #3D1A1A;
  --footer-bg: #070F1B;
  --footer-ink: #A9B7CC;
  color-scheme: dark;
}

/* Base ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--blue); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--plum); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; margin: 0 0 0.5em; font-weight: 650; letter-spacing: -0.015em; color: var(--ink); }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.2em; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
::selection { background: var(--blue-wash); color: var(--ink); }

.icon { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -0.2em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: 0.6rem 1rem; background: var(--ink); color: var(--paper); border-radius: var(--radius-sm); }
.skip-link:focus { top: 1rem; }
main:focus { outline: none; }

.container { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 760px; }

/* Buttons & links ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 48px; padding: 0.7rem 1.35rem;
  border: 1.5px solid transparent; border-radius: 10px;
  font-weight: 600; font-size: 1rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.btn--primary { background: var(--blue); color: #fff; }
[data-theme="dark"] .btn--primary { color: #08172A; }
.btn--primary:hover { background: var(--blue-strong); color: #fff; }
[data-theme="dark"] .btn--primary:hover { color: #08172A; }
.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn--sm { min-height: 40px; padding: 0.5rem 1rem; font-size: 0.9375rem; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .65; cursor: progress; }

.text-link { font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: .35em; }
.text-link:hover { text-decoration: underline; }
.text-link--back { margin-top: 2rem; }

.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 10px; cursor: pointer;
}
.icon-btn:hover { border-color: var(--line-strong); }

/* Header -------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header__inner { display: flex; align-items: center; gap: 1.5rem; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand__mark { width: 42px; height: 42px; }
.brand__name { font-family: var(--font-display); font-weight: 650; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand__mark--dark { display: none; }
[data-theme="dark"] .brand__mark--light { display: none; }
[data-theme="dark"] .brand__mark--dark { display: block; }

.site-nav { display: flex; align-items: center; gap: 1.25rem; }
.site-nav__list { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.site-nav__link {
  display: block; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm);
  color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: 0.975rem; position: relative;
}
.site-nav__link:hover { color: var(--ink); background: var(--tint); }
.site-nav__link.is-active { color: var(--blue); }
.site-nav__link.is-active::after {
  content: ""; position: absolute; left: 0.75rem; right: 0.75rem; bottom: 0.2rem; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--blue), var(--plum));
}
.site-header__tools { display: flex; gap: 0.5rem; align-items: center; }
.theme-toggle__sun { display: none; }
[data-theme="dark"] .theme-toggle__sun { display: block; }
[data-theme="dark"] .theme-toggle__moon { display: none; }
.nav-toggle { display: none; }
.nav-toggle__close { display: none; }

@media (max-width: 920px) {
  .nav-toggle { display: inline-grid; }
  .js .site-nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 1rem;
    padding: 1rem var(--gutter) 1.5rem;
    background: var(--paper); border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -24px rgb(14 34 56 / 0.35);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .js .site-nav.is-open { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
  .site-nav__list { flex-direction: column; }
  .site-nav__link { padding: 0.8rem 0.75rem; font-size: 1.05rem; }
  .site-nav__link.is-active::after { left: 0; right: auto; top: 0.7rem; bottom: 0.7rem; width: 3px; height: auto; }
  .site-nav__cta { width: 100%; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__open { display: none; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__close { display: block; }
  html:not(.js) .site-header__inner { flex-wrap: wrap; }
  html:not(.js) .site-nav { width: 100%; overflow-x: auto; }
  html:not(.js) .site-nav__list { flex-direction: row; }
}

/* Hero ----------------------------------------------------------------------- */
.hero { padding-block: clamp(3rem, 2rem + 6vw, 7rem) clamp(4rem, 3rem + 5vw, 7rem); overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr); gap: clamp(2rem, 1rem + 5vw, 6rem); align-items: center; }
.hero__status { display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem; padding: 0.35rem 0.85rem; border: 1px solid var(--line); border-radius: 99px; font-size: var(--step--1); color: var(--ink-soft); background: var(--surface); }
.hero__status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-wash); }
.hero__title { margin: 0; font-weight: 750; }
.hero__greeting { display: block; font-family: var(--font-text); font-weight: 500; font-size: var(--step-1); color: var(--muted); letter-spacing: 0; margin-bottom: 0.4rem; }
.hero__name { display: block; font-size: var(--step-hero); line-height: 0.95; letter-spacing: -0.035em; font-variation-settings: "opsz" 96; }
.hero__swash { width: min(100%, 26rem); height: clamp(18px, 2.4vw, 30px); margin: 0.5rem 0 1.4rem -0.2rem; overflow: visible; }
.swash-a { stop-color: var(--blue); }
.swash-b { stop-color: var(--plum); }
.hero__role { font-family: var(--font-display); font-size: var(--step-2); font-weight: 650; color: var(--ink-soft); margin-bottom: 1rem; min-height: 1.3em; letter-spacing: -0.01em; }
.hero__role [data-rotate-target] { display: inline-block; transition: opacity .3s ease, transform .3s ease; }
.hero__role .is-out { opacity: 0; transform: translateY(6px); }
.hero__intro { font-size: var(--step-1); color: var(--ink-soft); max-width: 36rem; line-height: 1.6; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 2rem 0 0; }
.hero .social { margin-top: 2rem; }

.hero__portrait {
  position: relative; justify-self: end; width: min(100%, 420px); aspect-ratio: 4 / 5;
  --shape: var(--radius-lg) var(--radius-lg) 46% var(--radius-lg);
}
.hero__frame {
  position: relative; z-index: 1; width: 100%; height: 100%;
  border-radius: var(--shape); overflow: hidden; background: var(--tint);
}
.hero__portrait::after {
  /* Offset outline echoing the logo's sweep: blue at the top, plum at the curl. */
  content: ""; position: absolute; inset: 16px -16px -16px 16px; z-index: 0;
  border-radius: var(--shape); border: 2px solid transparent;
  background: linear-gradient(160deg, var(--blue), var(--plum)) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.hero__frame img, .hero__frame picture { width: 100%; height: 100%; object-fit: cover; }
.hero__portrait--mark .hero__frame { display: grid; place-items: center; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.hero__portrait--mark .hero__mark { width: 58%; height: auto; object-fit: contain; }
.hero__mark--dark { display: none; }
[data-theme="dark"] .hero__mark--light { display: none; }
[data-theme="dark"] .hero__mark--dark { display: block; }

/* The one orchestrated moment: name settles, swash draws, the rest follows. */
@media (prefers-reduced-motion: no-preference) {
  .js .hero--animate .hero__title,
  .js .hero--animate .hero__role,
  .js .hero--animate .hero__intro,
  .js .hero--animate .hero__actions,
  .js .hero--animate .social,
  .js .hero--animate .hero__portrait { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
  .js .hero--animate .hero__role { animation-delay: .45s; }
  .js .hero--animate .hero__intro { animation-delay: .55s; }
  .js .hero--animate .hero__actions { animation-delay: .65s; }
  .js .hero--animate .social { animation-delay: .75s; }
  .js .hero--animate .hero__portrait { animation-delay: .2s; animation-duration: .9s; }
  .js .hero--animate .hero__swash path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1s .25s cubic-bezier(.65,0,.35,1) forwards; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

.social { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.social a {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--line); color: var(--ink-soft); background: var(--surface);
}
.social a:hover { color: var(--blue); border-color: var(--blue); }
.social .icon { width: 18px; height: 18px; }

/* Sections -------------------------------------------------------------------- */
.section { padding-block: var(--section); }
.section--tint { background: var(--tint); }
.section--flush { padding-top: 0; }
.section__title { font-size: var(--step-4); font-weight: 750; letter-spacing: -0.025em; margin-bottom: 0.6em; }
.section__title--sm { font-size: var(--step-3); }
.section__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.section__head .section__title { margin: 0; }
.lead { font-size: var(--step-1); color: var(--ink-soft); line-height: 1.6; max-width: 42rem; }
.note { font-size: var(--step--1); color: var(--muted); margin-top: 1.5rem; }

/* About ----------------------------------------------------------------------- */
.about { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: start; }
.about__photo { margin: 0 0 2rem; border-radius: var(--radius-lg); overflow: hidden; }
.about__block + .about__block { margin-top: 2rem; }
.about__block h3 { font-size: var(--step-1); margin-bottom: 0.9rem; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.checklist li { display: flex; gap: 0.65rem; align-items: flex-start; color: var(--ink-soft); }
.checklist .icon { color: var(--blue); margin-top: 0.25em; }
.checklist--soft .icon { color: var(--plum); }
.highlights { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; margin: 1rem 0 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.highlights__item { display: flex; flex-direction: column-reverse; padding: 1.4rem 1.5rem; background: var(--surface); }
.highlights dd { margin: 0; font-family: var(--font-display); font-weight: 750; font-size: var(--step-3); color: var(--blue); line-height: 1.1; }
.highlights dt { color: var(--muted); font-size: var(--step--1); margin-top: 0.3rem; }

/* Prose (rich text) -------------------------------------------------------------- */
.prose { color: var(--ink-soft); max-width: 68ch; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: var(--step-3); margin: 2em 0 0.6em; color: var(--ink); }
.prose h3 { font-size: var(--step-2); margin: 1.8em 0 0.5em; color: var(--ink); }
.prose h4 { font-size: var(--step-1); margin: 1.6em 0 0.5em; color: var(--ink); }
.prose p, .prose ul, .prose ol { margin: 0 0 1.15em; }
.prose li + li { margin-top: 0.35em; }
.prose blockquote { margin: 1.8em 0; padding: 0.25em 0 0.25em 1.25em; border-left: 3px solid var(--plum); font-size: var(--step-1); color: var(--ink); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose pre { background: #0E2238; color: #E8EEF7; padding: 1.1rem 1.25rem; border-radius: var(--radius); overflow-x: auto; font-size: 0.9rem; line-height: 1.55; margin: 1.6em 0; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
.prose :not(pre) > code { background: var(--tint); padding: 0.1em 0.35em; border-radius: 5px; color: var(--ink); }
.prose img { border-radius: var(--radius); margin: 1.6em 0; }
.prose a { color: var(--blue); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin: 1.6em 0; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 0.5rem 0.75rem; text-align: left; }
.prose .ql-align-center { text-align: center; }
.prose .ql-align-right { text-align: right; }
.prose--article { font-size: 1.125rem; line-height: 1.75; }

/* Resume: tabs + timeline --------------------------------------------------------- */
.tabs__list { display: flex; gap: 0.25rem; padding: 0.3rem; margin-bottom: 2.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs__list [role="tab"] {
  appearance: none; border: 0; background: transparent; cursor: pointer; white-space: nowrap;
  padding: 0.6rem 1.1rem; border-radius: 9px; font-weight: 600; font-size: 0.975rem; color: var(--muted);
}
.tabs__list [role="tab"]:hover { color: var(--ink); }
.tabs__list [role="tab"][aria-selected="true"] { background: var(--blue); color: #fff; }
[data-theme="dark"] .tabs__list [role="tab"][aria-selected="true"] { color: #08172A; }
html:not(.js) .tabs__list { display: none; }
html:not(.js) .tabs__panel[hidden] { display: block; }
html:not(.js) .tabs__panel + .tabs__panel { margin-top: 3rem; }
.tabs__panel:focus-visible { box-shadow: none; outline: 2px dashed var(--line-strong); outline-offset: 8px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__item { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 2rem; position: relative; padding-bottom: 2.5rem; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__when { font-size: var(--step--1); color: var(--muted); font-weight: 600; padding-top: 0.2rem; text-align: right; font-variant-numeric: tabular-nums; }
.timeline__body { position: relative; padding-left: 2rem; border-left: 2px solid var(--line); padding-bottom: 0.5rem; }
.timeline__item:last-child .timeline__body { border-left-color: transparent; }
.timeline__body::before {
  content: ""; position: absolute; left: -7px; top: 0.45rem; width: 12px; height: 12px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--blue);
}
.section--tint .timeline__body::before { background: var(--tint); }
.timeline__item:first-child .timeline__body::before { background: var(--blue); }
.timeline__body > p { color: var(--ink-soft); max-width: none; }
.entry__head { display: flex; gap: 0.9rem; align-items: flex-start; margin-bottom: 0.75rem; }
.entry__logo { width: 44px; height: 44px; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--line); padding: 4px; }
.entry__title { font-size: var(--step-1); margin: 0 0 0.15rem; }
.entry__meta { color: var(--muted); margin: 0 0 0.75rem; }
.entry__head .entry__meta { margin: 0; }
.entry__meta a { color: inherit; font-weight: 600; }
.entry__grade { display: inline-flex; gap: 0.4rem; align-items: center; font-weight: 600; color: var(--ink-soft); font-size: var(--step--1); }
.entry__grade .icon { color: var(--plum); }
.entry__list { color: var(--ink-soft); margin: 0 0 1rem; max-width: none; }
.entry__list li + li { margin-top: 0.3rem; }

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0.75rem 0 0; }
.tags li { font-size: 0.8125rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 6px; background: var(--blue-wash); color: var(--blue-strong); }
[data-theme="dark"] .tags li { color: var(--blue); }
.tags--links li { background: none; padding: 0; }
.tags--links a { display: inline-block; font-size: 0.875rem; font-weight: 600; padding: 0.3rem 0.7rem; border-radius: 6px; border: 1px solid var(--line); text-decoration: none; color: var(--ink-soft); }
.tags--links a:hover { border-color: var(--plum); color: var(--plum); }

.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 960px) { .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .skills { grid-template-columns: 1fr; } }
.skills__group { padding: 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.skills__title { font-size: var(--step-1); margin-bottom: 1rem; }
.skills__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.85rem; }
.skill { display: grid; grid-template-columns: 1fr auto; gap: 0.35rem 1rem; align-items: baseline; }
.skill__name { font-weight: 600; font-size: 0.9375rem; line-height: 1.35; }
.skill__level { font-size: 0.8125rem; color: var(--muted); }
.skill__bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.skill__bar span { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--blue), var(--plum)); border-radius: inherit; }

.certs { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }
.cert { display: flex; gap: 1rem; padding: 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.cert__icon { width: 28px; height: 28px; color: var(--plum); }
.cert__name { font-size: 1.125rem; margin-bottom: 0.25rem; }
.cert__meta, .cert__id { font-size: var(--step--1); color: var(--muted); margin-bottom: 0.3rem; }
.cert__links { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0.5rem 0 0; font-size: var(--step--1); font-weight: 600; }
.cert__links a { display: inline-flex; gap: 0.3rem; align-items: center; }

/* Projects ------------------------------------------------------------------------- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 1.5rem; }
.project-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.project-card__media { display: block; aspect-ratio: 16 / 10; background: var(--tint); overflow: hidden; }
.project-card__media img, .project-card__media picture { width: 100%; height: 100%; object-fit: cover; }
.project-card__placeholder { display: grid; place-items: center; height: 100%; color: var(--line-strong); }
.project-card__placeholder .icon { width: 48px; height: 48px; }
.project-card__body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.project-card__cat { font-size: var(--step--1); font-weight: 600; color: var(--plum); margin-bottom: 0.35rem; }
.project-card__title { font-size: var(--step-1); margin-bottom: 0.5rem; }
.project-card__title a { color: var(--ink); text-decoration: none; }
.project-card__title a:hover { color: var(--blue); text-decoration: underline; }
.project-card__summary { color: var(--ink-soft); margin-bottom: 0.25rem; }
.project-card__links { display: flex; gap: 1.25rem; margin: auto 0 0; padding-top: 1.1rem; font-weight: 600; font-size: 0.9375rem; }
.project-card__links a { display: inline-flex; align-items: center; gap: 0.35rem; text-decoration: none; }
@media (min-width: 900px) {
  .project-card--lead { grid-column: 1 / -1; display: grid; grid-template-columns: 1.3fr 1fr; }
  .project-card--lead .project-card__media { aspect-ratio: auto; min-height: 100%; }
  .project-card--lead .project-card__body { padding: 2rem; justify-content: center; }
  .project-card--lead .project-card__title { font-size: var(--step-3); }
}

/* Testimonials -------------------------------------------------------------------- */
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 1.5rem; }
.quote { margin: 0; padding: 2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); display: flex; flex-direction: column; }
.quote__mark { width: 30px; height: 30px; color: var(--plum); margin-bottom: 1rem; }
.quote blockquote { margin: 0 0 1.5rem; font-size: 1.0625rem; color: var(--ink-soft); line-height: 1.7; }
.quote figcaption { display: flex; gap: 0.85rem; align-items: center; margin-top: auto; }
.quote figcaption img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.quote figcaption span { display: flex; flex-direction: column; line-height: 1.35; }
.quote figcaption span span { color: var(--muted); font-size: var(--step--1); }

/* Blog cards ------------------------------------------------------------------------ */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 2.5rem 1.75rem; }
.post-card { display: flex; flex-direction: column; }
.post-card__media { display: block; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; margin-bottom: 1.1rem; background: var(--tint); }
.post-card__media img, .post-card__media picture { width: 100%; height: 100%; object-fit: cover; }
.post-card__title { font-size: var(--step-1); line-height: 1.25; margin: 0.35rem 0 0.5rem; }
.post-card__title a { color: var(--ink); text-decoration: none; }
.post-card__title a:hover { color: var(--blue); text-decoration: underline; }
.post-card__excerpt { color: var(--ink-soft); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: var(--step--1); color: var(--muted); margin: 0; }
.post-meta__cat { font-weight: 600; color: var(--plum); text-decoration: none; }
.post-meta__cat:hover { text-decoration: underline; color: var(--plum); }
.post-meta--article { margin-top: 1.25rem; font-size: 0.9375rem; }

/* Page head, chips, search ------------------------------------------------------------ */
.page-head { padding-block: clamp(2.5rem, 2rem + 3vw, 4.5rem) 2.5rem; }
.page-head__title { font-size: var(--step-4); font-weight: 750; letter-spacing: -0.025em; margin-bottom: 0.4em; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0 0 1.25rem; font-size: var(--step--1); color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: 0.4rem; color: var(--line-strong); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--blue); }
.blog-tools { display: grid; gap: 1.25rem; margin-top: 2rem; }
.search { display: flex; align-items: center; gap: 0.5rem; max-width: 34rem; padding: 0.3rem 0.3rem 0.3rem 0.9rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; }
.search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-wash); }
.search .icon { color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0.5rem 0.25rem; }
.search input:focus { outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; }
.blog-tools .chips { margin-top: 0; }
.chip { display: inline-flex; gap: 0.4rem; align-items: center; padding: 0.4rem 0.9rem; border-radius: 99px; border: 1px solid var(--line); text-decoration: none; color: var(--ink-soft); font-weight: 500; font-size: 0.9375rem; background: var(--surface); }
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip__count { font-size: 0.8em; opacity: 0.7; }
.result-note { color: var(--muted); margin-bottom: 2rem; }
.empty { text-align: center; padding: 4rem 1rem; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }
.empty__icon { width: 40px; height: 40px; margin: 0 auto 1rem; color: var(--line-strong); }

.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.75rem; margin-top: 3.5rem; }
.pagination ol { display: flex; gap: 0.3rem; list-style: none; padding: 0; margin: 0; }
.pagination a, .pagination span[aria-current], .pagination__step { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 0.6rem; border-radius: 10px; text-decoration: none; font-weight: 600; }
.pagination a { color: var(--ink-soft); border: 1px solid var(--line); }
.pagination a:hover { border-color: var(--blue); color: var(--blue); }
.pagination span[aria-current] { background: var(--blue); color: #fff; }
[data-theme="dark"] .pagination span[aria-current] { color: #08172A; }
.pagination__step { display: inline-flex; gap: 0.3rem; }
.pagination__gap { display: grid; place-items: center; min-width: 24px; color: var(--muted); }

/* Article --------------------------------------------------------------------------- */
.article { padding-bottom: var(--section); }
.article__head { padding-top: clamp(2.5rem, 2rem + 3vw, 4.5rem); padding-bottom: 2rem; }
.article__title { font-size: var(--step-4); font-weight: 750; letter-spacing: -0.025em; line-height: 1.08; margin-bottom: 0.4em; }
.article__dek { font-size: var(--step-1); color: var(--ink-soft); }
.article__hero { margin: 0 auto 3rem; max-width: 1080px; }
.article__hero img, .article__hero picture { width: 100%; border-radius: var(--radius-lg); }
.article__foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1.25rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.article__foot .tags { margin: 0; }
.share { display: flex; align-items: center; gap: 0.4rem; }
.share__label { font-size: var(--step--1); font-weight: 600; color: var(--muted); margin-right: 0.25rem; }
.share a, .share__copy { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); color: var(--ink-soft); background: var(--surface); cursor: pointer; position: relative; }
.share a:hover, .share__copy:hover { color: var(--blue); border-color: var(--blue); }
.share .icon { width: 17px; height: 17px; }
.share__copied { position: absolute; bottom: calc(100% + 6px); right: 0; white-space: nowrap; font-size: 0.75rem; background: var(--ink); color: var(--paper); padding: 0.15rem 0.5rem; border-radius: 6px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.share__copied:not(:empty) { opacity: 1; }
.adjacent { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2.5rem; }
.adjacent__link { display: flex; flex-direction: column; gap: 0.2rem; padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.adjacent__link:hover { border-color: var(--blue); color: var(--ink); }
.adjacent__link span { font-size: var(--step--1); color: var(--muted); }
.adjacent__link--next { text-align: right; grid-column: 2; }
.facts { display: flex; flex-wrap: wrap; gap: 0.75rem 2.5rem; margin: 1.5rem 0 0; }
.facts dt { font-size: var(--step--1); color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 1.25rem; margin-top: 3rem; }
.gallery figure { margin: 0; }
.gallery img { border-radius: var(--radius); border: 1px solid var(--line); }
.gallery figcaption { font-size: var(--step--1); color: var(--muted); margin-top: 0.5rem; }
.related { margin-top: var(--section); }

.comments { margin-top: 4rem; }
.comments h2 { font-size: var(--step-2); }
.comment { padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.comment__meta { display: flex; gap: 0.75rem; align-items: baseline; margin-bottom: 0.35rem; }
.comment__meta time { font-size: var(--step--1); color: var(--muted); }
.comment-form { margin-top: 2rem; }
.comment-form h3 { font-size: var(--step-1); }

/* Contact & forms ---------------------------------------------------------------------- */
.section--contact { background: linear-gradient(180deg, var(--paper), var(--tint)); }
.contact { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(2rem, 1rem + 5vw, 6rem); align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.contact-list li { display: flex; gap: 0.75rem; align-items: center; }
.contact-list .icon { color: var(--blue); }
.contact-list--large { margin-top: 2rem; font-size: 1.0625rem; }
.contact-list--large a { color: var(--ink); text-decoration: none; font-weight: 600; }
.contact-list--large a:hover { color: var(--blue); text-decoration: underline; }
.contact__social { margin-top: 2.25rem; padding-top: 1.75rem; border-top: 1px solid var(--line); }
.contact__social-title { margin: 0 0 0.875rem; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.social--labeled { gap: 0.625rem; }
.social--labeled a { width: auto; height: 44px; display: inline-flex; align-items: center; gap: 0.5rem; padding: 0 1rem; font-weight: 600; font-size: 0.9375rem; text-decoration: none; transition: color .15s, border-color .15s, transform .15s; }
.social--labeled a:hover { transform: translateY(-1px); }
.contact-form, .comment-form { padding: clamp(1.5rem, 1rem + 2vw, 2.5rem); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.25rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.field label { font-weight: 600; font-size: 0.9375rem; }
.field__hint { font-weight: 400; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%; padding: 0.75rem 0.9rem; min-height: 48px;
  border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--paper);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-wash); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field__error { color: var(--danger); font-size: var(--step--1); margin: 0; }
.form-note { font-size: var(--step--1); color: var(--muted); margin: 1rem 0 0; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.85rem 1rem; border-radius: 10px; margin: 0 0 1.25rem; font-weight: 500; }
.alert .icon { margin-top: 0.15em; }
.alert--success { background: var(--success-wash); color: var(--success); }
.alert--error { background: var(--danger-wash); color: var(--danger); }

/* Footer -------------------------------------------------------------------------- */
.site-footer { position: relative; background: var(--footer-bg); color: var(--footer-ink); padding-top: clamp(2.5rem, 1.75rem + 3vw, 4rem); }
.site-footer::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, #12508C, #8B3A8E); }
.site-footer a { color: #E8EEF7; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.65fr) minmax(0, 1.15fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; padding-bottom: 2.5rem; }
.site-footer__about p { max-width: 34rem; margin-top: 1rem; }
.brand--footer { color: #fff; }
.brand--footer { gap: 0.75rem; }
.brand--footer img { width: 52px; height: 52px; }
.brand--footer .brand__name { font-size: 1.45rem; }
.brand--footer:hover { color: #fff; text-decoration: none !important; }
.site-footer__heading { font-family: var(--font-text); font-size: 0.9375rem; font-weight: 600; color: #fff; margin-bottom: 1rem; letter-spacing: 0; }
.site-footer__col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.55rem; }
.site-footer__posts ul { gap: 0.9rem; }
.site-footer__posts li { display: grid; gap: 0.15rem; }
.site-footer__posts a { font-size: 0.9375rem; font-weight: 500; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.site-footer__posts time { font-size: 0.8125rem; color: #9AA9C0; }
.site-footer .contact-list .icon { color: #9DBFE6; }
.social--footer { margin-top: 1.5rem; }
.social--footer a { background: transparent; border-color: rgb(255 255 255 / 0.18); color: #E8EEF7; }
.social--footer a:hover { border-color: #fff; color: #fff; }
.site-footer__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding-block: 1.5rem; border-top: 1px solid rgb(255 255 255 / 0.1); font-size: var(--step--1); }
.site-footer__bottom p { margin: 0; }
.site-footer__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; margin-left: auto; }
@media (max-width: 640px) { .site-footer__meta { margin-left: 0; } .brand--footer img { width: 44px; height: 44px; } .brand--footer .brand__name { font-size: 1.25rem; } }
.to-top {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 40; width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 12px; background: var(--surface); color: var(--ink) !important; border: 1px solid var(--line);
  box-shadow: 0 10px 30px -12px rgb(14 34 56 / 0.4);
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s, transform .2s, visibility 0s .2s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

.consent { position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 60; max-width: 34rem; margin-inline: auto; padding: 1.1rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 20px 50px -20px rgb(14 34 56 / 0.5); font-size: 0.9375rem; }
.consent p { margin-bottom: 0.9rem; }
.consent__actions { display: flex; gap: 0.5rem; justify-content: flex-end; }

/* Error page ----------------------------------------------------------------------- */
.error-page { padding-block: clamp(4rem, 3rem + 6vw, 9rem); max-width: 40rem; }
.error-page .code { font-family: var(--font-display); font-weight: 750; font-size: var(--step-4); background: linear-gradient(90deg, var(--blue), var(--plum)); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 0; }
.error-page h1 { font-size: var(--step-3); }

/* Responsive ------------------------------------------------------------------------ */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__portrait { order: -1; justify-self: center; width: min(64%, 300px); }
  .about, .contact { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: 2.5rem 2rem; }
}
@media (max-width: 640px) {
  :root { --header-h: 64px; }
  .timeline__item { grid-template-columns: 1fr; gap: 0.4rem; }
  .timeline__when { text-align: left; padding-left: 2rem; border-left: 2px solid var(--line); padding-bottom: 0.25rem; }
  .timeline__item:last-child .timeline__when { border-left-color: var(--line); }
  .field-row { grid-template-columns: 1fr; }
  .adjacent { grid-template-columns: 1fr; }
  .adjacent__link--next { grid-column: auto; }
  .site-footer__grid { grid-template-columns: 1fr; }
  .brand__name { font-size: 1.05rem; }
  .hero__actions .btn { flex: 1 1 auto; }
  .hero .social { justify-content: center; }
  .highlights { grid-template-columns: 1fr; }
  .highlights dd { overflow-wrap: anywhere; }
  .site-footer__grid { text-align: center; justify-items: center; }
  .site-footer__about p { margin-inline: auto; }
  .site-footer .brand--footer { margin-right: 0; justify-content: center; }
  .social--footer { justify-content: center; }
  .site-footer__col ul { justify-items: center; }
  .site-footer .contact-list li { justify-content: center; }
  .site-footer__bottom { flex-direction: column; align-items: center; text-align: center; gap: 0.5rem; }
  .site-footer__meta { margin-left: 0; justify-content: center; }
}
@media (min-width: 1600px) {
  .container { max-width: 1280px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  .site-header, .site-footer, .to-top, .share, .contact-form, .consent { display: none !important; }
  body { background: #fff; color: #000; }
}
.article:has(> .related) { padding-bottom: 0; }

/* Detail pages: title, image, text and gallery share one column width. */
.article { --article-width: 860px; }
.article .container--narrow,
.article .article__hero,
.article .gallery { max-width: var(--article-width); }
.article .prose--article { max-width: none; }
.article .article__hero { margin-bottom: 2.5rem; }
