/* ==========================================================================
   Site — editorial / engineering-notebook design system
   ========================================================================== */

:root {
  --paper: #f3f0e8;
  --paper-2: #ebe6da;
  --paper-3: #e2dccd;
  --ink: #17160f;
  --ink-2: #3a382f;
  --muted: #6e6a5e;
  --rule: #d6cfbe;
  --rule-strong: #17160f;
  --accent: #00A651;            /* logo green */
  --accent-text: #007A3C;       /* same green, darker so small text stays readable on paper */
  --accent-soft: rgba(0, 166, 81, .09);
  --on-accent: #ffffff;
  --danger: #c0392b;
  --code-bg: #1c1b17;
  --code-ink: #e9e5da;
  --sel: #c6eed6;

  --font: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --mono: "IBM Plex Mono", "IBM Plex Sans Arabic", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 2px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #11110f;
  --paper-2: #191916;
  --paper-3: #23221e;
  --ink: #ece8de;
  --ink-2: #c9c4b7;
  --muted: #8f8a7d;
  --rule: #2d2b26;
  --rule-strong: #ece8de;
  --accent: #22C55E;            /* logo glow green */
  --accent-text: #22C55E;
  --accent-soft: rgba(34, 197, 94, .1);
  --on-accent: #06210f;
  --danger: #f87171;
  --code-bg: #0a0a09;
  --code-ink: #e9e5da;
  --sel: #14532d;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--sel); color: var(--ink); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.mono { font-family: var(--mono); font-size: .8125rem; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--ink); color: var(--paper); padding: 8px 14px; z-index: 100; }
.skip:focus { top: 12px; }

/* ---------- Header ---------- */
.site-head { border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); }
.site-head .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.05rem; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: var(--ink); color: var(--paper); font-family: var(--mono); font-weight: 500; font-size: .95rem; }
.brand-mark.has-logo { width: 40px; height: 40px; background: #fff; border-radius: 8px; padding: 3px; box-shadow: inset 0 0 0 1px var(--rule); }
.brand-mark.has-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; line-height: 1; margin-top: 3px; font-family: var(--mono); }
.nav { display: flex; gap: 4px; margin-inline-start: auto; }
.nav a { padding: 6px 12px; font-size: .95rem; color: var(--ink-2); position: relative; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; inset-inline: 12px; bottom: -23px; height: 2px; background: var(--accent); }
.head-tools { display: flex; gap: 6px; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--rule); background: transparent; cursor: pointer; border-radius: var(--radius); color: var(--ink-2); }
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }
.menu-btn { display: none; }
.theme-icon-dark { display: none; }
:root[data-theme="dark"] .theme-icon-dark { display: block; }
:root[data-theme="dark"] .theme-icon-light { display: none; }

@media (max-width: 860px) {
  .menu-btn { display: grid; }
  .nav { position: fixed; inset: 68px 0 auto 0; flex-direction: column; background: var(--paper); border-bottom: 1px solid var(--rule); padding: 8px var(--gutter) 20px; gap: 0; transform: translateY(-8px); opacity: 0; pointer-events: none; transition: .18s ease; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: 1.05rem; }
  .nav a[aria-current="page"]::after { display: none; }
  .nav a[aria-current="page"] { color: var(--accent-text); }
  body.menu-open .nav { transform: none; opacity: 1; pointer-events: auto; }
  .head-tools { margin-inline-start: auto; }
}

/* ---------- Search overlay ---------- */
.search-panel { position: fixed; inset: 0; z-index: 60; background: color-mix(in srgb, var(--paper) 96%, transparent); display: none; }
.search-panel.open { display: block; }
.search-panel form { max-width: 760px; margin: 14vh auto 0; padding-inline: var(--gutter); }
.search-panel label { display: block; margin-bottom: 14px; }
.search-panel input { width: 100%; font: inherit; font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 600; border: 0; border-bottom: 2px solid var(--ink); background: transparent; color: var(--ink); padding: 8px 0; outline: none; }
.search-panel .hint { margin-top: 12px; }
.search-close { position: absolute; top: 18px; inset-inline-end: var(--gutter); }

/* ---------- Section labels ---------- */
.section { padding-block: clamp(56px, 8vw, 96px); border-top: 1px solid var(--rule); }
.section-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 36px; flex-wrap: wrap; }
.section-num { font-family: var(--mono); font-size: .8125rem; color: var(--accent-text); }
.section-title { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.section-link { margin-inline-start: auto; font-size: .95rem; color: var(--ink-2); border-bottom: 1px solid var(--rule); padding-bottom: 2px; }
.section-link:hover { color: var(--accent-text); border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(56px, 10vw, 120px) clamp(48px, 7vw, 88px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(32px, 6vw, 88px); align-items: end; }
.kicker { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); margin-bottom: 28px; }
.kicker::before { content: ""; width: 28px; height: 1px; background: var(--accent); }
.hero h1 { font-size: clamp(2.3rem, 6.2vw, 4.6rem); line-height: 1.12; font-weight: 700; letter-spacing: -.02em; max-width: 15ch; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--accent-text); }
.hero-text { margin-top: 28px; font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--ink-2); max-width: 56ch; line-height: 1.85; }
.hero-actions { display: flex; gap: 12px; margin-top: 36px; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; gap: 10px; height: 48px; padding-inline: 22px; border: 1px solid var(--ink); font-weight: 600; font-size: .95rem; border-radius: var(--radius); cursor: pointer; transition: background .15s, color .15s; background: transparent; }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn .arrow { transition: transform .15s; }
.btn:hover .arrow { transform: translateX(-4px); }

.now { border-top: 2px solid var(--rule-strong); padding-top: 14px; }
.now-row { display: flex; justify-content: space-between; gap: 12px; padding-block: 11px; border-bottom: 1px solid var(--rule); font-size: .92rem; }
.now-row span:first-child { color: var(--muted); }
.now-note { margin-top: 16px; font-size: .92rem; color: var(--ink-2); line-height: 1.75; }
.dot { display: inline-block; width: 8px; height: 8px; background: #2f9e5b; border-radius: 50%; margin-inline-end: 8px; box-shadow: 0 0 0 3px color-mix(in srgb, #2f9e5b 22%, transparent); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .now { max-width: 420px; }
}

/* ---------- Featured post ---------- */
.feature { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.feature-media { aspect-ratio: 1600 / 840; background: var(--paper-2); overflow: hidden; border: 1px solid var(--rule); }
.feature-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.feature:hover .feature-media img { transform: scale(1.02); }
.feature-media.placeholder { display: grid; place-items: center; background:
  repeating-linear-gradient(90deg, transparent 0 39px, var(--rule) 39px 40px),
  repeating-linear-gradient(0deg, transparent 0 39px, var(--rule) 39px 40px), var(--paper-2); }
.feature-media.placeholder span { font-family: var(--mono); font-size: 4rem; color: var(--ink); background: var(--paper); padding: 0 18px; border: 1px solid var(--ink); }
.feature h3 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.25; text-wrap: balance; }
.feature:hover h3 { color: var(--accent-text); }
.feature p { margin-top: 18px; color: var(--ink-2); font-size: 1.05rem; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--muted); font-family: var(--mono); font-size: .8125rem; margin-bottom: 14px; }
.meta .cat { color: var(--accent-text); }
.meta .sep { width: 4px; height: 4px; background: var(--rule); border-radius: 50%; }
@media (max-width: 800px) { .feature { grid-template-columns: 1fr; } }

/* ---------- Post index rows ---------- */
.post-list { border-top: 2px solid var(--rule-strong); }
.post-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; padding-block: 28px; border-bottom: 1px solid var(--rule); align-items: center; position: relative; }
.post-row.has-thumb { grid-template-columns: 280px minmax(0, 1fr); }
.post-row .thumb { aspect-ratio: 1600 / 840; overflow: hidden; border: 1px solid var(--rule); background: var(--paper-2); }
.post-row .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-row:hover .thumb img { transform: scale(1.03); }
.post-row .meta { margin-bottom: 10px; }
.post-row h3 { font-size: clamp(1.15rem, 1.8vw, 1.45rem); font-weight: 600; line-height: 1.45; transition: color .15s; }
.post-row h3 a::after { content: ""; position: absolute; inset: 0; }
.post-row p { margin-top: 8px; color: var(--muted); font-size: .97rem; line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-row:hover h3 { color: var(--accent-text); }
@media (max-width: 760px) {
  .post-row, .post-row.has-thumb { grid-template-columns: 1fr; gap: 16px; padding-block: 24px; }
}

/* ---------- Projects ---------- */
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 2px solid var(--rule-strong); }
.project { padding: 30px 0 34px; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 12px; }
.project:nth-child(odd) { padding-inline-end: clamp(20px, 3vw, 44px); border-inline-end: 1px solid var(--rule); }
.project:nth-child(even) { padding-inline-start: clamp(20px, 3vw, 44px); }
.project-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.project h3 { font-size: 1.3rem; }
.project p { color: var(--ink-2); font-size: .98rem; }
.project-cover { aspect-ratio: 16/9; border: 1px solid var(--rule); overflow: hidden; background: var(--paper-2); }
.project-cover img { width: 100%; height: 100%; object-fit: cover; }
.stack { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip { font-family: var(--mono); font-size: .75rem; padding: 3px 9px; border: 1px solid var(--rule); color: var(--ink-2); direction: ltr; }
.project-links { display: flex; gap: 18px; margin-top: auto; padding-top: 6px; font-size: .92rem; }
.project-links a { border-bottom: 1px solid var(--rule); }
.project-links a:hover { color: var(--accent-text); border-color: var(--accent); }
@media (max-width: 760px) {
  .projects { grid-template-columns: 1fr; }
  .project:nth-child(n) { padding-inline: 0; border-inline-end: 0; }
}

/* ---------- Topics ---------- */
.topics { display: flex; flex-wrap: wrap; gap: 10px; }
.topic { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border: 1px solid var(--rule); font-weight: 500; transition: .15s; }
.topic:hover, .topic.active { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.topic sup { font-family: var(--mono); font-size: .72rem; color: var(--muted); }
.topic:hover sup, .topic.active sup { color: inherit; opacity: .7; }

/* ---------- CTA strip ---------- */
.cta { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; }
.cta h2 { font-size: clamp(1.6rem, 3.6vw, 2.6rem); max-width: 22ch; text-wrap: balance; }
@media (max-width: 700px) { .cta { grid-template-columns: 1fr; } }

/* ---------- Page header (blog/archive/etc) ---------- */
.page-head { padding-block: clamp(48px, 8vw, 96px) clamp(32px, 5vw, 56px); }
.page-head h1 { font-size: clamp(2.2rem, 5.5vw, 4rem); letter-spacing: -.02em; }
.page-head .lead { margin-top: 18px; font-size: 1.15rem; color: var(--ink-2); max-width: 60ch; }
.filters { margin-top: 32px; }

/* ---------- Pagination ---------- */
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 40px; gap: 12px; }
.pager .pages { font-family: var(--mono); font-size: .85rem; color: var(--muted); }
.pager a, .pager span.disabled { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding-inline: 18px; border: 1px solid var(--rule); }
.pager a:hover { border-color: var(--ink); }
.pager span.disabled { opacity: .4; }

.empty { padding: 64px 0; text-align: center; color: var(--muted); border-bottom: 1px solid var(--rule); }

/* ---------- Article ---------- */
.article-head { padding-block: clamp(40px, 7vw, 88px) 36px; max-width: 900px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-family: var(--mono); font-size: .8125rem; color: var(--muted); margin-bottom: 28px; }
.crumbs a:hover { color: var(--accent-text); }
.crumbs span[aria-hidden] { opacity: .5; }
.article-head h1 { font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; }
.article-head .lead { margin-top: 22px; font-size: clamp(1.08rem, 1.7vw, 1.25rem); color: var(--ink-2); line-height: 1.85; }
.byline { display: flex; align-items: center; gap: 14px; margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-weight: 700; }
.byline .who { font-weight: 600; line-height: 1.3; }
.byline .who small { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; }
.byline .meta { margin: 0 auto 0 0; }

.article-cover { margin-bottom: 56px; border: 1px solid var(--rule); background: var(--paper-2); }
.article-cover img { width: 100%; max-height: 620px; object-fit: cover; }

.article-layout { display: grid; grid-template-columns: minmax(0, 720px) 240px; gap: clamp(32px, 6vw, 96px); justify-content: space-between; }
.toc { position: sticky; top: 96px; align-self: start; font-size: .9rem; border-top: 2px solid var(--rule-strong); padding-top: 14px; max-height: calc(100vh - 120px); overflow: auto; }
.toc-title { font-family: var(--mono); font-size: .75rem; color: var(--muted); margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 7px 0; color: var(--muted); border-bottom: 1px solid var(--rule); line-height: 1.5; transition: color .15s; }
.toc a:hover, .toc a.active { color: var(--ink); }
.toc a.active { color: var(--accent-text); }
.toc .l3 a { padding-inline-start: 14px; font-size: .85rem; }
@media (max-width: 1000px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; order: -1; max-height: none; }
  .toc details summary { cursor: pointer; }
}

/* Prose */
.prose { font-size: 1.12rem; line-height: 1.95; color: var(--ink); overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.35em; }
.prose h2 { font-size: 1.75rem; margin-top: 2.3em; padding-top: .3em; scroll-margin-top: 90px; }
.prose h3 { font-size: 1.32rem; margin-top: 1.9em; scroll-margin-top: 90px; }
.prose h2 + *, .prose h3 + * { margin-top: .8em; }
.prose .anchor { margin-inline-start: .35em; color: var(--rule); font-weight: 400; opacity: 0; transition: opacity .15s; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; }
.prose .anchor:hover { color: var(--accent-text); }
.prose a { color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.prose a.anchor { text-decoration: none; }
.prose strong { font-weight: 700; }
.prose ul, .prose ol { padding-inline-start: 1.4em; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--accent-text); }
.prose blockquote { margin-inline: 0; padding: 4px 22px; border-inline-start: 3px solid var(--accent); color: var(--ink-2); font-size: 1.15rem; }
.prose hr { border: 0; height: 1px; background: var(--rule); margin-block: 3em; }
.prose img { border: 1px solid var(--rule); margin-inline: auto; }
.prose figure { margin: 2em 0; }
.prose figcaption { font-size: .88rem; color: var(--muted); text-align: center; margin-top: 10px; }
.prose :not(pre) > code { font-family: var(--mono); font-size: .86em; background: var(--paper-2); border: 1px solid var(--rule); padding: .1em .4em; border-radius: var(--radius); direction: ltr; unicode-bidi: isolate; }
.prose pre { position: relative; direction: ltr; text-align: left; background: var(--code-bg); color: var(--code-ink); padding: 22px 22px; overflow-x: auto; font-family: var(--mono); font-size: .88rem; line-height: 1.75; border-radius: var(--radius); margin-inline: calc(var(--gutter) * -0); tab-size: 4; }
.prose pre code { font-family: inherit; background: none; border: 0; padding: 0; }
.prose pre[data-lang]::before { content: attr(data-lang); position: absolute; top: 8px; right: 14px; font-size: .7rem; color: #8a857a; text-transform: uppercase; letter-spacing: .08em; }
.copy-btn { position: absolute; top: 8px; left: 8px; font-family: var(--mono); font-size: .72rem; padding: 4px 10px; background: transparent; color: #a8a396; border: 1px solid #3a3833; cursor: pointer; opacity: 0; transition: opacity .15s; }
.prose pre:hover .copy-btn, .copy-btn:focus { opacity: 1; }
.copy-btn:hover { color: #fff; border-color: #6b675d; }
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.prose th, .prose td { padding: 10px 14px; border-bottom: 1px solid var(--rule); text-align: start; }
.prose th { background: var(--paper-2); font-weight: 600; }
.prose tr:last-child td { border-bottom: 0; }
.prose input[type="checkbox"] { accent-color: var(--accent); margin-inline-end: 8px; }

/* Syntax tokens (highlight.js) — tuned to the palette instead of a stock theme */
.hljs-comment, .hljs-quote { color: #7d786c; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-meta .hljs-keyword { color: #4ade80; }
.hljs-string, .hljs-attr .hljs-string, .hljs-regexp, .hljs-addition { color: #f2c48d; }
.hljs-number, .hljs-literal, .hljs-symbol { color: #e8c170; }
.hljs-title, .hljs-title.function_, .hljs-section { color: #8fc3e8; }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable, .hljs-property { color: #e3b5d8; }
.hljs-type, .hljs-title.class_, .hljs-class .hljs-title { color: #f0d58a; }
.hljs-tag, .hljs-name, .hljs-selector-class, .hljs-selector-id { color: #4ade80; }
.hljs-deletion { color: #ff8080; }
.hljs-meta { color: #9a958a; }

/* Article footer */
.article-foot { margin-top: 64px; padding-top: 28px; border-top: 2px solid var(--rule-strong); display: grid; gap: 24px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { font-family: var(--mono); font-size: .8rem; padding: 5px 12px; border: 1px solid var(--rule); color: var(--ink-2); }
.tags a:hover { border-color: var(--accent); color: var(--accent-text); }
.share { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.share .label { margin-inline-end: 6px; }
.share a, .share button { height: 38px; padding-inline: 14px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--rule); background: transparent; cursor: pointer; font-size: .88rem; }
.share a:hover, .share button:hover { border-color: var(--ink); }

.prevnext { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-top: 56px; }
.prevnext a { padding: 24px 0; display: flex; flex-direction: column; gap: 6px; }
.prevnext a:hover strong { color: var(--accent-text); }
.prevnext a + a, .prevnext .next { text-align: end; border-inline-start: 1px solid var(--rule); padding-inline-start: 24px; }
.prevnext .prev { padding-inline-end: 24px; }
.prevnext strong { font-weight: 600; line-height: 1.5; }
@media (max-width: 600px) { .prevnext { grid-template-columns: 1fr; } .prevnext a + a, .prevnext .next { border-inline-start: 0; border-top: 1px solid var(--rule); text-align: start; padding-inline-start: 0; } }

.progress { position: fixed; top: 0; inset-inline: 0; height: 2px; z-index: 50; pointer-events: none; }
.progress span { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: right; transform: scaleX(0); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); padding-bottom: 96px; }
.about-photo { aspect-ratio: 4/5; object-fit: cover; border: 1px solid var(--rule); filter: grayscale(.2) contrast(1.05); }
.about-aside .now { margin-top: 28px; }
.social { display: flex; flex-direction: column; margin-top: 28px; border-top: 2px solid var(--rule-strong); }
.social a { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.social a:hover { color: var(--accent-text); }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } .about-photo { max-width: 260px; } }

/* ---------- Forms ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(32px, 6vw, 96px); padding-bottom: 96px; }
.form { display: grid; gap: 22px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.field label { display: block; font-size: .9rem; font-weight: 500; margin-bottom: 8px; }
.field input, .field textarea { width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--ink-2); padding: 10px 0; outline: none; border-radius: 0; transition: border-color .15s; }
.field textarea { min-height: 180px; resize: vertical; line-height: 1.8; }
.field input:focus, .field textarea:focus { border-bottom: 2px solid var(--accent); padding-bottom: 9px; }
.field .err { color: var(--danger); font-size: .85rem; margin-top: 6px; }
.hp { position: absolute; inset-inline-start: -9999px; }
.notice { padding: 16px 20px; border: 1px solid var(--ink); background: var(--paper-2); }
@media (max-width: 860px) { .contact-grid, .form-row { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-foot { border-top: 2px solid var(--rule-strong); margin-top: 0; padding-block: 56px 32px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.foot-name { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.foot-col h4 { font-family: var(--mono); font-size: .75rem; color: var(--muted); font-weight: 400; margin-bottom: 14px; }
.foot-col a { display: block; padding: 4px 0; color: var(--ink-2); }
.foot-col a:hover { color: var(--accent-text); }
.foot-bottom { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--rule); color: var(--muted); flex-wrap: wrap; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- 404 ---------- */
.notfound { padding-block: 120px; }
.notfound .code { font-family: var(--mono); font-size: clamp(5rem, 18vw, 12rem); line-height: 1; color: var(--accent-text); }

/* ---------- Newsletter ---------- */
.newsletter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; border: 1px solid var(--rule); border-top: 3px solid var(--accent); padding: clamp(24px, 4vw, 40px); background: var(--paper-2); }
.newsletter h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.newsletter p { margin-top: 10px; color: var(--ink-2); }
.newsletter-form { display: flex; gap: 10px; flex-wrap: wrap; }
.newsletter-form input[type="email"] { flex: 1 1 220px; min-width: 0; height: 48px; padding-inline: 14px; font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper); border: 1px solid var(--ink-2); border-radius: var(--radius); outline: none; }
.newsletter-form input[type="email"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.newsletter-form .err { flex-basis: 100%; color: var(--danger); font-size: .88rem; margin: 0; }
.newsletter .notice { margin: 0; }
@media (max-width: 760px) { .newsletter { grid-template-columns: 1fr; } }
