/* krzysztof.oddologyinc.com, "Paper and Ink" personal edition. Notes: ../../REDESIGN-PLAN.md */

@font-face {
  font-family: "Outfit";
  src: url("../fonts/Outfit-v.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #FAF8F4; --bg-2: #F3EEE5; --surface: #FFFDF9; --sunk: #F3EEE5;
  --text: #171412; --body: #4F4A44; --muted: #6A6359;
  --line: #E4DED4; --edge: #171412; --shadow: #171412;
  --accent: #2B50D6; --accent-ink: #2443B8; --accent-soft: #E4E9FB; --accent-2: #0E7C74;
  --ok: #2F7D4F;
  --inv-bg: #171412; --inv-fg: #FAF8F4;
  --sans: "Outfit", -apple-system, "Segoe UI", system-ui, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, ui-serif, serif;
  --r-lg: 16px; --r-md: 11px; --r-sm: 6px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --ease-io: cubic-bezier(.6, 0, .2, 1);
  --currents: url("../img/currents-ink.svg");
  --head-h: 64px;
  --gut: 24px;
  color-scheme: light;
}
:root[data-accent="teal"] { --accent: #0E7C74; --accent-ink: #0B6A63; --accent-soft: #DCF0EC; --accent-2: #2B50D6; }
:root[data-accent="cinnabar"] { --accent: #D9481C; --accent-ink: #B23A14; --accent-soft: #FBE3D8; --accent-2: #8A5207; }

:root[data-theme="dark"] {
  --bg: #171412; --bg-2: #1E1A17; --surface: #221E1B; --sunk: #1A1715;
  --text: #F3EEE5; --body: #CFC7BB; --muted: #A39A8E;
  --line: #3A332E; --edge: #5A514A; --shadow: #050404;
  --accent: #8FA8FF; --accent-ink: #9DB3FF; --accent-soft: #1C2547; --accent-2: #4FC7BA;
  --ok: #74C493;
  --inv-bg: #F3EEE5; --inv-fg: #171412;
  --currents: url("../img/currents-paper.svg");
  color-scheme: dark;
}
:root[data-theme="dark"][data-accent="teal"] { --accent: #4FC7BA; --accent-ink: #5FD0C3; --accent-soft: #10302D; --accent-2: #8FA8FF; }
:root[data-theme="dark"][data-accent="cinnabar"] { --accent: #FF8A5C; --accent-ink: #FF9A72; --accent-soft: #3A1D12; --accent-2: #F0B347; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171412; --bg-2: #1E1A17; --surface: #221E1B; --sunk: #1A1715;
    --text: #F3EEE5; --body: #CFC7BB; --muted: #A39A8E;
    --line: #3A332E; --edge: #5A514A; --shadow: #050404;
    --accent: #8FA8FF; --accent-ink: #9DB3FF; --accent-soft: #1C2547; --accent-2: #4FC7BA;
    --ok: #74C493;
    --inv-bg: #F3EEE5; --inv-fg: #171412;
    --currents: url("../img/currents-paper.svg");
    color-scheme: dark;
  }
  :root:not([data-theme="light"])[data-accent="teal"] { --accent: #4FC7BA; --accent-ink: #5FD0C3; --accent-soft: #10302D; }
  :root:not([data-theme="light"])[data-accent="cinnabar"] { --accent: #FF8A5C; --accent-ink: #FF9A72; --accent-soft: #3A1D12; }
}

/* Theme switch: the ink blot view transition (js/site.js), and a plain colour fade where it is not supported. */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
:root.vt-blot::view-transition-new(root) {
  -webkit-mask-image: url("../img/blot.svg"); mask-image: url("../img/blot.svg");
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: 0 0; mask-size: 0 0;
}
:root.theme-fade, :root.theme-fade * { transition: background-color .45s var(--ease), color .45s var(--ease), border-color .45s var(--ease), fill .45s var(--ease) !important; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 12px); -webkit-tap-highlight-color: color-mix(in srgb, var(--accent) 16%, transparent); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 400 1rem/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; overflow-wrap: break-word; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
section[tabindex="-1"]:focus { outline: none; }
.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 { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--inv-bg); color: var(--inv-fg); border-radius: 4px; font-weight: 700; text-decoration: none; transition: top .2s var(--ease); }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 max(var(--gut), env(safe-area-inset-right)) 0 max(var(--gut), env(safe-area-inset-left)); }
@media (max-width: 600px) { :root { --gut: 16px; } }

/* Band and header */
.band { height: 4px; background: var(--accent); position: sticky; top: 0; z-index: 41; }
.site-head { position: sticky; top: 4px; z-index: 40; background: color-mix(in srgb, var(--bg) 90%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; gap: 12px; height: var(--head-h); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; min-height: 44px; min-width: 44px; overflow: hidden; }
.brand span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand b { font-weight: 800; font-size: 17px; letter-spacing: .02em; text-transform: uppercase; }
.brand small { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-weight: 600; margin-top: -3px; letter-spacing: 0; text-transform: none; }
.nav { display: flex; gap: 2px; }
.nav a { padding: 10px 11px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 0.9063rem; color: var(--body); min-height: 44px; display: inline-flex; align-items: center; }
@media (hover: hover) { .nav a:hover { color: var(--text); background: var(--surface); } }
.nav a[aria-current="true"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.icon-btn { width: 44px; height: 44px; border-radius: 10px; border: 1px solid transparent; background: none; display: grid; place-items: center; cursor: pointer; color: var(--body); flex: none; }
@media (hover: hover) { .icon-btn:hover { border-color: var(--line); background: var(--surface); color: var(--text); } }
.theme-ico-dark { display: none; }
:root[data-theme="dark"] .theme-ico-dark { display: block; }
:root[data-theme="dark"] .theme-ico-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-ico-dark { display: block; }
  :root:not([data-theme="light"]) .theme-ico-light { display: none; }
}
.lang-toggle { position: relative; display: inline-grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); flex: none; min-height: 44px; padding: 3px 4px; border: solid transparent; border-width: 4px 0; border-radius: 999px; background: var(--surface) padding-box; box-shadow: inset 0 0 0 1px var(--edge); cursor: pointer; font-weight: 800; font-size: 12px; letter-spacing: .08em; min-width: 76px; }
.lang-toggle span { position: relative; z-index: 1; display: grid; place-items: center; padding: 0 8px; color: var(--body); transition: color .3s var(--ease); }
.lang-toggle::before { content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--inv-bg); transition: transform .42s var(--ease); }
.lang-toggle[data-lang="pl"]::before { transform: translateX(100%); }
.lang-toggle[data-lang="en"] .l-en, .lang-toggle[data-lang="pl"] .l-pl { color: var(--inv-fg); }
.lang-toggle::after { content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; border: 1.5px solid var(--accent); opacity: 0; pointer-events: none; }
.lang-toggle[data-lang="pl"]::after { transform: translateX(100%); }
.head-cta { margin-left: 4px; }
.menu-btn { display: none; }
@media (max-width: 1060px) {
  .nav, .head-row .head-cta { display: none; }
  .menu-btn { display: grid; }
}
.drawer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .42s var(--ease); border-top: 1px solid transparent; }
.drawer > div { overflow: hidden; min-height: 0; }
.drawer.open > div { max-height: calc(100vh - var(--head-h) - 4px); max-height: calc(100dvh - var(--head-h) - 4px); overflow-y: auto; overscroll-behavior: contain; }
.drawer.open { grid-template-rows: 1fr; border-top-color: var(--line); }
.drawer nav { display: grid; gap: 2px; padding-top: 10px; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
.drawer a { display: flex; align-items: center; padding: 12px 6px; font-weight: 700; font-size: 1.125rem; text-decoration: none; border-bottom: 1px solid var(--line); min-height: 44px; }
.drawer .btn { margin-top: 12px; justify-content: center; }
@media (min-width: 1061px) { .drawer { display: none; } }

/* Type */
h1, h2, h3, h4 { margin: 0; font-family: var(--sans); color: var(--text); }
.h2 { font-size: clamp(1.875rem, 4.2vw, 2.875rem); line-height: 1.02; font-weight: 800; text-transform: uppercase; letter-spacing: -.012em; }
.lede { font-family: var(--serif); font-size: 1.1563rem; line-height: 1.6; color: var(--body); margin: 14px 0 0; max-width: 62ch; }
.prose p { font-family: var(--serif); font-size: 1.0625rem; line-height: 1.65; color: var(--body); margin: 0 0 12px; }
.prose a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; font-weight: 600; }
@media (hover: hover) { .prose a:hover { text-decoration-thickness: 2.5px; } }
.sec { position: relative; padding: 96px 0; }
.sec-soft { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-head { max-width: 760px; margin-bottom: 40px; position: relative; z-index: 1; }
@media (max-width: 700px) { .sec { padding: 68px 0; } .sec-head { margin-bottom: 28px; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 4px; border: 1px solid var(--edge); background: var(--surface); font-weight: 700; font-size: 0.8438rem; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; text-decoration: none; color: var(--text); transition: box-shadow .25s var(--ease), transform .25s var(--ease), background-color .25s var(--ease); }
.btn { max-width: 100%; }
.btn svg { width: 17px; height: 17px; flex: none; }
@media (hover: hover) { .btn:hover { box-shadow: 3px 3px 0 var(--accent); transform: translate(-1px, -1px); } }
.btn:active { box-shadow: 0 0 0 var(--accent); transform: none; }
.btn-primary { background: var(--inv-bg); color: var(--inv-fg); border-color: var(--inv-bg); }
.btn-quiet { border-color: transparent; background: none; }
@media (hover: hover) { .btn-quiet:hover { box-shadow: none; transform: none; background: var(--surface); border-color: var(--line); } }
.btn-lg { padding: 13px 22px; font-size: 0.875rem; }

/* Cards */
.card { position: relative; background: var(--surface); border: 1px solid var(--edge); border-radius: var(--r-lg); box-shadow: 5px 5px 0 var(--shadow); }
.card-flat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }

/* Ink marks (same family as the live site's .ink-deco) */
.ink-deco { position: absolute; width: var(--s, 56px); height: var(--s, 56px); background-color: var(--c, var(--text)); -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; opacity: var(--o, .12); pointer-events: none; z-index: 0; }
.d-spatter { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M46,22 C58,18 72,24 77,35 C82,46 76,60 64,66 C52,72 36,68 29,57 C22,46 30,27 46,22 Z'/%3E%3Ccircle cx='85' cy='20' r='3.6'/%3E%3Ccircle cx='93' cy='11' r='2'/%3E%3Ccircle cx='79' cy='31' r='1.7'/%3E%3Ccircle cx='20' cy='73' r='4.4'/%3E%3Ccircle cx='11' cy='83' r='2.4'/%3E%3Ccircle cx='70' cy='79' r='2.8'/%3E%3C/svg%3E"); }
.d-ring { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill-rule='evenodd' d='M9,50 A41,27 0 1 0 91,50 A41,27 0 1 0 9,50 Z M18.5,51.5 A33.5,21 0 1 1 85.5,51.5 A33.5,21 0 1 1 18.5,51.5 Z'/%3E%3Ccircle cx='88' cy='19' r='3.1'/%3E%3Ccircle cx='95' cy='11' r='1.6'/%3E%3Ccircle cx='12' cy='83' r='2.3'/%3E%3C/svg%3E"); }

/* Hero */
.hero { position: relative; padding: 72px 0 84px; overflow: hidden; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--currents) center / cover no-repeat; pointer-events: none; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.25rem, 4.5vw, 3.875rem); line-height: .98; font-weight: 800; text-transform: uppercase; letter-spacing: -.02em; }
.mark { position: relative; font-style: normal; white-space: nowrap; color: var(--accent-ink); }
.mark svg { position: absolute; left: -2%; bottom: -.16em; width: 104%; height: .34em; overflow: visible; }
.mark path { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw 1.1s .45s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.hero .lede { font-size: clamp(1.125rem, 1.6vw, 1.25rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-note { margin: 14px 0 0; font-size: 0.9688rem; font-weight: 600; color: var(--muted); }
.hero-photo { position: relative; justify-self: center; width: min(100%, 440px); aspect-ratio: 1; }
.hero-photo .blot { position: absolute; inset: 4% 2% 0 6%; color: var(--accent); }
.hero-photo .blot svg { width: 100%; height: 100%; }
.hero-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; -webkit-mask-image: linear-gradient(#000 64%, transparent 94%); mask-image: linear-gradient(#000 64%, transparent 94%); }
@media (max-width: 900px) {
  .hero { padding: 40px 0 60px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .hero-photo { width: min(72%, 300px); order: -1; }
}
@media (max-width: 480px) {
  .brand small { display: none; }
}
@media (max-width: 300px) {
  :root { --gut: 10px; }
  .head-row { flex-wrap: wrap; height: auto; min-height: var(--head-h); gap: 4px; padding-top: 6px; padding-bottom: 6px; }
  .drawer.open > div { max-height: calc(100vh - 112px); max-height: calc(100dvh - 112px); }
}
@media (max-height: 500px) and (orientation: landscape) {
  :root { --head-h: 56px; }
  .hero { padding: 28px 0 44px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 32%); gap: 24px; }
  .hero-photo { order: 0; width: 100%; }
  .hero h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
}
@media (max-width: 379px) {
  .head-row:has(.lang-toggle:not([hidden])) .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Now */
.now { padding: 0 0 8px; position: relative; z-index: 2; }
.now-card { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; padding: 24px 28px; }
.now-card h2 { font-size: 1.625rem; font-weight: 800; text-transform: uppercase; letter-spacing: -.01em; }
.now-card time { display: block; margin-top: 6px; font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
.now-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; }
.now-list li { font-family: var(--serif); font-size: 1.0313rem; color: var(--body); line-height: 1.55; }
@media (max-width: 860px) { .now-card { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 20px; } .now-list { grid-template-columns: minmax(0, 1fr); } }

/* Case studies */
.cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 28px; position: relative; z-index: 1; }
.case { display: flex; flex-direction: column; overflow: hidden; }
.case.feature, .case.wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.case.feature .case-shot, .case.wide .case-shot { order: 2; border-left: 1px solid var(--line); border-bottom: 0; aspect-ratio: auto; min-height: 100%; }
.case-shot { position: relative; aspect-ratio: 16 / 10; background: var(--sunk); border-bottom: 1px solid var(--line); overflow: hidden; }
.case-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .7s var(--ease); }
@media (hover: hover) { .case:hover .case-shot img { transform: scale(1.025); } }
.case-shot.phones { display: flex; justify-content: center; align-items: flex-start; gap: 16px; padding: 22px 22px 0; background: var(--accent-soft); }
.case-shot.phones img { width: 36%; height: auto; object-fit: contain; border: 1px solid var(--edge); border-bottom: 0; border-radius: 16px 16px 0 0; box-shadow: 4px 4px 0 var(--shadow); }
.case.wide.noshot { display: flex; }
.case-foot.start { justify-content: flex-start; column-gap: 28px; }
.feud-intro { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 32px; }
.sys-groups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 26px; padding: 14px 0 8px; border-top: 1px dashed var(--line); margin-top: 2px; }
.sys-groups h4 { font-size: 0.9688rem; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.sys-groups p { font-family: var(--serif); font-size: 1rem; line-height: 1.55; color: var(--body); margin: 0; }
.case-shot.phones.store { align-items: center; padding: 16px 22px; }
.case-shot.phones.store img { width: auto; height: 100%; max-width: 44%; border-bottom: 1px solid var(--edge); border-radius: 12px; }
.case-body { padding: 24px 26px 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.case h3 { font-size: 1.5625rem; font-weight: 800; letter-spacing: -.01em; }
.case .sum { font-family: var(--serif); font-size: 1.0625rem; line-height: 1.6; color: var(--body); margin: 0; }
.case-foot .btn { max-width: 100%; min-width: 0; overflow-wrap: anywhere; }
.case-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 6px; }

/* Expand and collapse, used everywhere: the region animates its height through grid rows. */
.xbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 2px; border: 0; background: none; cursor: pointer; font-weight: 800; font-size: 0.8438rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); }
.xbtn .chev { width: 18px; height: 18px; transition: transform .42s var(--ease); }
.xbtn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.xbtn .x-less, .xbtn[aria-expanded="true"] .x-more { display: none; }
.xbtn[aria-expanded="true"] .x-less { display: inline; }
.js .xregion { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease), opacity .4s var(--ease); opacity: 0; }
.js .xregion.open { grid-template-rows: 1fr; opacity: 1; }
.xregion > .xinner { min-height: 0; overflow: hidden; }
.cs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 26px; padding: 14px 0 6px; border-top: 1px dashed var(--line); margin-top: 6px; }
.cs-grid h4 { font-size: 0.9688rem; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.cs-grid p { font-family: var(--serif); font-size: 1rem; line-height: 1.6; color: var(--body); margin: 0; }
.cs-grid .full { grid-column: 1 / -1; }
.stack-line { font-size: 0.875rem; font-weight: 600; color: var(--muted); }
@media (max-width: 900px) {
  .cases { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .case.feature, .case.wide { display: flex; }
  .case.feature .case-shot, .case.wide .case-shot { order: 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .cs-grid { grid-template-columns: minmax(0, 1fr); }
  .feud-intro { grid-template-columns: minmax(0, 1fr); }
  .sys-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-body { padding: 20px; }
}
@media (max-width: 560px) { .sys-groups { grid-template-columns: minmax(0, 1fr); gap: 12px; } }

/* Infrastructure */
.infra-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 32px; align-items: start; position: relative; z-index: 1; }
.diagram { padding: 18px; }
.diagram svg { width: 100%; height: auto; }
.diagram .ln { fill: none; stroke: var(--text); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.diagram .ln-dash { stroke-dasharray: 5 7; }
.diagram .ln-acc { stroke: var(--accent); stroke-width: 2.4; }
.diagram .box { fill: var(--surface); stroke: var(--edge); stroke-width: 1.5; }
.diagram .box-inv { fill: var(--inv-bg); stroke: var(--inv-bg); }
.diagram .box-acc { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.8; }
.diagram text { fill: var(--text); font: 700 14px var(--sans); }
.diagram .t-sm { font: 600 11.5px var(--sans); fill: var(--muted); }
.diagram .t-inv { fill: var(--inv-fg); }
.diagram .pulse { fill: var(--accent); }
.flow { stroke-dasharray: 4 9; animation: flow 1.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -26; } }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5em), 1fr)); gap: 12px; margin-top: 18px; }
.fact { padding: 16px; }
.fact b { display: block; font-size: 1.875rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.fact span { display: block; margin-top: 6px; font-size: 0.8438rem; color: var(--body); font-weight: 600; }
.story { display: grid; gap: 14px; }
.story-item { padding: 18px 20px; }
.story-item h3 { font-size: 1.0625rem; font-weight: 800; margin-bottom: 6px; }
.story-item p { margin: 0; font-family: var(--serif); font-size: 1rem; line-height: 1.6; color: var(--body); }
@media (max-width: 900px) { .infra-grid { grid-template-columns: minmax(0, 1fr); } .diagram { padding: 10px; } }

/* Security */
.sec-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 20px; position: relative; z-index: 1; }
.sec-item { padding: 22px 24px 16px; display: flex; flex-direction: column; gap: 10px; }
.sec-item h3 { font-size: 1.25rem; font-weight: 800; }
.sec-item .sum { margin: 0; font-family: var(--serif); font-size: 1.0313rem; line-height: 1.6; color: var(--body); }
.sec-item .cs-grid { grid-template-columns: minmax(0, 1fr); }
.sec-note { margin-top: 22px; font-size: 0.875rem; color: var(--muted); max-width: 70ch; }
@media (max-width: 900px) { .sec-list { grid-template-columns: minmax(0, 1fr); } }

/* Side projects */
.side-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.side { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.side h3 { font-size: 1.1875rem; font-weight: 800; }
.side p { margin: 0; font-family: var(--serif); font-size: 1rem; line-height: 1.6; color: var(--body); }
.side .stack-line { margin-top: auto; }
@media (max-width: 1000px) { .side-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .side-grid { grid-template-columns: minmax(0, 1fr); } }

/* Toolkit and experience */
.split { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 40px; }
.tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tool { padding: 18px; }
.tool h3 { font-size: 1rem; font-weight: 800; margin-bottom: 6px; }
.tool p { margin: 0; font-family: var(--serif); font-size: 1rem; line-height: 1.6; color: var(--body); }
.tl { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.tl li { position: relative; padding: 0 0 22px 22px; }
.tl li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg-2); border: 2px solid var(--text); }
.tl li:first-child::before { background: var(--accent); border-color: var(--accent); }
.tl h3 { font-size: 1.0625rem; font-weight: 800; }
.tl .when { font-size: 0.8125rem; font-weight: 700; color: var(--muted); }
.tl p { margin: 4px 0 0; font-family: var(--serif); font-size: 0.9688rem; color: var(--body); line-height: 1.55; }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .tools { grid-template-columns: minmax(0, 1fr); } }

/* Testimonials (scaffold, hidden until permissions exist) */
.quotes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.quote { padding: 24px; }
.quote blockquote { margin: 0; font-family: var(--serif); font-size: 1.125rem; line-height: 1.6; }

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 56px; align-items: center; }
.about-photo { position: relative; max-width: 400px; }
.about-photo .frame { overflow: hidden; border-radius: var(--r-lg); border: 1px solid var(--edge); box-shadow: 8px 8px 0 var(--accent); aspect-ratio: 4 / 5; background: var(--sunk); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px) { .about-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; } .about-photo { max-width: 320px; } }

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 40px; align-items: start; }
.links { display: grid; gap: 10px; margin-top: 22px; }
.link-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 56px; text-decoration: none; transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
@media (hover: hover) { .link-row:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--accent); } }
.link-row:active { transform: none; box-shadow: none; }
.link-row > span { min-width: 0; }
.link-row svg { width: 22px; height: 22px; flex: none; }
.link-row b { display: block; font-size: 0.9375rem; }
.link-row small { display: block; color: var(--muted); font-size: 0.8125rem; }
.form { padding: 26px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 0.8438rem; font-weight: 700; }
.input { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid var(--edge); border-radius: 6px; background: var(--bg); color: var(--text); transition: box-shadow .2s var(--ease); }
.input:focus { outline: none; box-shadow: 3px 3px 0 var(--accent); }
textarea.input { min-height: 150px; resize: vertical; font-family: var(--serif); font-size: 1.0313rem; line-height: 1.55; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-note { margin: 12px 0 0; min-height: 1.5em; font-weight: 600; font-size: 0.9063rem; }
.form-note.ok { color: var(--ok); }
.form-note.err { color: #B3261E; }
:root[data-theme="dark"] .form-note.err { color: #F2867D; }
.input[aria-invalid="true"] { border-color: #B3261E; }
:root[data-theme="dark"] .input[aria-invalid="true"] { border-color: #F2867D; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .form-note.err { color: #F2867D; }
  :root:not([data-theme="light"]) .input[aria-invalid="true"] { border-color: #F2867D; }
}
.form small.priv { display: block; margin-top: 10px; color: var(--muted); font-size: 0.8125rem; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .row2 { grid-template-columns: minmax(0, 1fr); gap: 0; } .form { padding: 18px; } }

/* Footer */
.foot { padding: 40px 0 calc(48px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.foot-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; font-size: 0.875rem; color: var(--muted); }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.foot a { text-decoration: none; font-weight: 600; color: var(--body); padding: 12px 2px; display: inline-block; min-height: 44px; min-width: 44px; text-align: center; }
@media (hover: hover) { .foot a:hover { color: var(--text); } }

/* Scroll reveal (only when JS is on and motion is allowed) */
.js .rv { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .rv.in { opacity: 1; transform: none; }

/* Language switch: the ink wash and the re-inked words (js/site.js) */
.i18n-swapping { overflow: hidden; }
.ink-wash { position: fixed; left: 0; top: 0; width: 100%; z-index: 50; pointer-events: none; color: var(--accent); overflow: visible; will-change: transform, opacity; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .rv { opacity: 1; transform: none; }
  .mark path { stroke-dashoffset: 0; }
  .flow { animation: none; }
}

/* Small screens: keep the diagram legible and let it scroll sideways inside its card. */
@media (max-width: 600px) {
  .diagram { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  .diagram svg { min-width: 560px; }
}
.hero h1:lang(pl), .h2:lang(pl) { line-height: 1.08; }
