/* ASCII skin for pages still on style.css: brings them in line with the home page
   (css/home-ascii.css) without touching their markup. Load it after every other style. */

@font-face {
  font-family: "Geist Mono";
  src: url("../assets/fonts/GeistMono-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0a0908;
  --bg-2: #12110e;
  --ink: #ece6d6;
  --ink-2: #a8a293;
  --ink-3: #6e695e;
  --rule: rgba(236, 230, 214, 0.14);
  --rule-2: rgba(236, 230, 214, 0.28);
  --accent: #facf0f;
  --accent-soft: rgba(250, 207, 15, 0.55);
  --mark: rgba(250, 207, 15, 0.16);
  --bg-rgb: 10, 9, 8;
  --ink-rgb: 236, 230, 214;
  --mono: "Geist Mono", "Geeza Pro", "Noto Naskh Arabic", ui-monospace, "SF Mono", Menlo, monospace;
}
/* Light theme: paper and ink, same tokens as the home page. assets/theme.js sets data-theme. */
:root[data-theme="light"] {
  --bg: #f3efe6;
  --bg-2: #ebe6da;
  --ink: #1b1a17;
  --ink-2: #46433c;
  --ink-3: #6f6a61;
  --rule: rgba(27, 26, 23, 0.14);
  --rule-2: rgba(27, 26, 23, 0.3);
  --accent: #7a5c00;
  --accent-soft: rgba(122, 92, 0, 0.62);
  --mark: rgba(250, 207, 15, 0.5);
  --bg-rgb: 243, 239, 230;
  --ink-rgb: 27, 26, 23;
  color-scheme: light;
}
:root { color-scheme: dark; }
/* The menu icons are cream SVGs tinted by the old stylesheet; on paper draw them in ink. */
:root[data-theme="light"] :is(.header__main-ham-menu, .header__main-ham-menu-close) { filter: brightness(0) opacity(.85) !important; }

/* Theme control at the right of the header (added by assets/theme.js): one click flips light and dark. */
.header .header__main { margin-left: auto; }
body .theme-switch { margin-left: 2.5ch; background: transparent; border: 1px solid var(--rule-2); color: var(--ink); font-family: var(--mono); font-size: 12px; padding: 2px 1ch; cursor: pointer; white-space: nowrap; transition: border-color .2s; }
body .theme-switch:hover { border-color: var(--ink); }
body .theme-switch__auto { color: var(--ink-3); margin-left: .4ch; }


html, body { background: var(--bg); }
body { color: var(--ink); font-family: var(--mono); font-weight: 400; letter-spacing: 0; font-variant-ligatures: none; }
::selection { background: var(--accent); color: var(--bg); }

/* The old rules name a face on nearly every class, so override them all, leaving icon fonts and SVG alone. */
body :not(i):not(svg):not(svg *):not(.fa):not(.fab):not(.fas):not(.far):not([class*="fa-"]) {
  font-family: var(--mono);
  letter-spacing: 0;
  font-weight: 400;
}
body :is(h1, h2, h3, h4, h5, strong, b, [class*="title"], [class*="heading"], [class*="name"]):not(i):not(svg):not(svg *) {
  font-weight: 500;
  letter-spacing: -0.01em;
}
/* The rule above loses to the blanket weight rule, so bold text needs the blanket rule's own
   selector plus one more element to win: run-in labels like "Creative agent (MIRO):" stay bold. */
body :is(strong, b, mark.hl):not(i):not(svg):not(svg *):not(.fa):not(.fab):not(.fas):not(.far):not([class*="fa-"]) { font-weight: 500; }
/* Dark text on paper: macOS's thin "antialiased" smoothing washes it out, so use the normal one. */
:root[data-theme="light"] body { -webkit-font-smoothing: auto; -moz-osx-font-smoothing: auto; }
/* Highlighter on the few facts worth catching on a skim (same as the home page). */
mark.hl {
  color: var(--ink);
  background: linear-gradient(to bottom, transparent 56%, var(--mark) 56%, var(--mark) 92%, transparent 92%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  padding: 0 .25ch; margin: 0 -.25ch;
}
/* Any letter-spacing breaks Arabic joining (the blog title is Arabic). */
body .heading-sec__main.heading-sec__main--lt { letter-spacing: normal; }
body :is([class*="label"], [class*="__title"][class*="sidebar"], [class*="stage-num"], [class*="badge"]):not(i):not(svg):not(svg *) {
  letter-spacing: .06em;
}

/* Surfaces: one background, thin rules, square corners. */
body :is(section, footer, main, .cs-section, .cs-pipeline) { background-color: var(--bg); }
body :is([class*="btn"], [class*="tag"], [class*="badge"], [class*="skill"], [class*="card"], [class*="callout"],
         [class*="filter"], [class*="two-col__item"], [class*="stage"], [class*="results"], [class*="row-img"]) {
  border-radius: 0;
  box-shadow: none;
}

/* The old styles round and glow many one-off boxes (resume frames, project mockups); square them all. */
body *:not(svg):not(svg *) { border-radius: 0 !important; }
body :is(div, section, details, iframe, figure, img, video) { box-shadow: none !important; }
body img.project-details__showcase-img { margin-bottom: 3rem; }
body :is(details, iframe, [class*="container"]):not(.header *):not(.main-footer *) { border-color: var(--rule); }

/* Inline links read like the home page: ink with a gold underline. */
body :is(p, li, .cs-section__text, .cs-callout__text) a:not([class*="btn"]):not(.header *):not(.main-footer *) {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color .2s, text-decoration-color .2s;
}
body :is(p, li, .cs-section__text, .cs-callout__text) a:not([class*="btn"]):not(.header *):not(.main-footer *):hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ---------- header ---------- */
.header { top: 0; background: rgba(var(--bg-rgb), 0.92); border-bottom: 1px solid var(--rule); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.header__content { padding-top: 0; padding-bottom: 0; min-height: 72px; }
.header__logo-container { color: var(--ink); }
.header__logo-container:hover { color: var(--ink); }
body .header__logo-img-cont { width: 36px; height: 36px; border-radius: 50% !important; overflow: hidden; border: 1px solid var(--rule-2); background: transparent; }
.header__logo-img { filter: grayscale(1) contrast(1.05); }
.header .header__logo-sub { font-size: 13px; text-transform: none; letter-spacing: .02em; color: var(--ink); font-weight: 400; }
.header .header__link { font-size: 13px; text-transform: lowercase; color: var(--ink-2); padding: 2.4rem 1.5ch; font-weight: 400; }
.header .header__link::before { content: "["; opacity: 0; margin-right: .4ch; color: var(--ink-3); transition: opacity .2s; }
.header .header__link::after { content: "]"; opacity: 0; margin-left: .4ch; color: var(--ink-3); transition: opacity .2s; }
.header .header__link:hover { color: var(--ink); }
.header .header__link:hover::before, .header .header__link:hover::after { opacity: 1; }
.header__sm-menu { background: rgba(var(--bg-rgb), 0.97); border-bottom: 1px solid var(--rule); }
.header .header__sm-menu-link a { font-size: 15px; text-transform: lowercase; color: var(--ink-2); }
/* Phones: style.css turns the links into a floating bar under the name; keep it, squared off. */
@media only screen and (max-width: 37.5em) {
  .header { top: 0; }
  .header__content { min-height: 56px; }
  .header__links { top: 64px; border-radius: 0; background: rgba(var(--bg-rgb), 0.86); border-color: var(--rule); box-shadow: none; }
  .header .header__link { padding: .7rem .6ch; border-radius: 0; color: var(--ink-2); }
  .header .header__link::before, .header .header__link::after { content: none; }
  .header__link-wrapper:not(:first-child)::before { color: var(--ink-3); }
}

/* Case-study hero: square frame, button backed so it reads over the video. */
.project-cs-hero, .project-cs-hero :is(div, video, img, button, a) { border-radius: 0; }
body .project-cs-hero { background: var(--bg); color: var(--ink); }
/* A hero over video keeps light text on dark footage in both themes. */
body .project-cs-hero:has(video) { background: #0a0908; color: #ece6d6; }
body .project-cs-hero:has(video) :is(h1, h2, p, span) { color: #ece6d6; text-shadow: 0 1px 14px rgba(10, 9, 8, 0.9); }
body .project-cs-hero:has(video) .btn { background: rgba(10, 9, 8, 0.72); color: #ece6d6; border-color: rgba(236, 230, 214, 0.28); }
body .project-cs-hero:has(video) .btn::after { color: #6e695e; }
body .project-cs-hero:has(video) .project-cs-hero__unmute { color: #ece6d6; background: rgba(10, 9, 8, 0.55); border-color: rgba(236, 230, 214, 0.28); }
body .cs-pipeline__stage:is(:first-child, :last-child) { border-radius: 0; }
body :is(.cs-pipeline__stage, .cs-two-col__item, .cs-pipeline__results, .cs-pipeline__screenshot) { border-color: var(--rule); }

/* ---------- buttons, tags ---------- */
body .btn { background: transparent; color: var(--ink); border: 1px solid var(--rule-2); text-transform: lowercase; letter-spacing: 0; font-weight: 400; transition: background .2s, color .2s, border-color .2s; }
body .btn::after { content: "\00a0\2192"; color: var(--ink-3); }
body .btn:hover { transform: none; background: var(--ink); color: var(--bg); border-color: var(--ink); }
body .btn:hover::after { color: var(--bg); }
body .skills__skill { background: transparent; color: var(--ink-2); border: 1px solid var(--rule); font-size: 12px; font-weight: 400; }
body .skills__skill:hover { color: var(--ink); border-color: var(--rule-2); }

/* ---------- footer ---------- */
.main-footer { background: var(--bg); border-top: 1px solid var(--rule); color: var(--ink-2); }
.main-footer .heading-sm, .main-footer__heading-sm { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.main-footer .text-lt { color: var(--ink); font-size: 15px; }
.main-footer__short-desc { color: var(--ink-2); font-size: 13px; }
.main-footer__social-cont { display: flex; flex-wrap: wrap; gap: 1ch 3ch; }
.main-footer__social-cont a { text-decoration: none; color: var(--ink-2); transition: color .2s; }
.main-footer__social-cont a::after { content: " \2197"; color: var(--ink-3); }
.main-footer__social-cont a:hover { color: var(--accent); }
.main-footer__lower { border-top: 1px dashed var(--rule); color: var(--ink-3); font-size: 12px; }
.main-footer__lower a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--accent-soft); text-underline-offset: 4px; }

/* Page heroes: the mono title sits tight on its subtitle without a little room. */
body .heading-primary { line-height: 1.05; margin-bottom: 1.6rem; letter-spacing: -0.02em; }

/* Images follow the home page's work cards: greyscale until the row is hovered, no zoom. */
body .blog_row-img, body .idea-item__img { filter: grayscale(1) contrast(1.04) brightness(.86); transition: filter .5s ease !important; }
body .blog_row:hover .blog_row-img, body .idea-item:hover .idea-item__img { filter: none; transform: none; }

/* Blog category badges keep their hue on paper, darkened so they stay readable. */
:root[data-theme="light"] .blog-category-badge--tech { color: #1d6680; background: rgba(29, 102, 128, 0.07); border-color: rgba(29, 102, 128, 0.3); }
:root[data-theme="light"] .blog-category-badge--tech::before { background: #1d6680; box-shadow: none; }
:root[data-theme="light"] .blog-category-badge--nontech { color: #8a6a00; background: rgba(138, 106, 0, 0.07); border-color: rgba(138, 106, 0, 0.3); }
:root[data-theme="light"] .blog-category-badge--nontech::before { background: #8a6a00; box-shadow: none; }

/* logo-img-guard: the header photo is decoration, not something to open or drag */
.header__logo-img { pointer-events: none; -webkit-user-drag: none; user-select: none; }
