/*
 * ETHMAR frontend design system.
 * Plain CSS, no build step. Logical properties throughout so the same rules serve LTR (en) and RTL (ar).
 * Shape rule: containers and images 16px, inner media 12px, buttons and chips full pill.
 * Z-index scale: header 20, mobile menu 30, lightbox (native <dialog> top layer).
 */

@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-weight: 160 700;
  font-display: swap;
  src: url("./fonts/readex-pro-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-weight: 160 700;
  font-display: swap;
  src: url("./fonts/readex-pro-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-weight: 160 700;
  font-display: swap;
  src: url("./fonts/readex-pro-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --bg: #f5f5f4;
  --surface: #fcfcfc;
  --surface-2: #ebebea;
  --ink: #111111;
  --ink-2: #3a3a3a;
  --muted: #616161;
  --line: rgb(17 17 17 / 0.1);
  /* Brand accent follows the logo: black on light, off-white on dark. */
  --accent: #111111;
  --accent-hover: #2e2e2e;
  --accent-ink: #fafafa;
  --accent-soft: rgb(17 17 17 / 0.06);
  --shadow: 0 1px 2px rgb(17 17 17 / 0.05), 0 12px 32px -12px rgb(17 17 17 / 0.16);
  --logo-filter: none;

  --font: "Readex Pro", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --radius: 16px;
  --radius-sm: 12px;
  --container: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 72px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --track-tight: -0.025em;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0f0f0f;
    --surface: #181818;
    --surface-2: #222222;
    --ink: #ededed;
    --ink-2: #c9c9c9;
    --muted: #9e9e9e;
    --line: rgb(237 237 237 / 0.1);
    --accent: #f2f2f2;
    --accent-hover: #d9d9d9;
    --accent-ink: #111111;
    --accent-soft: rgb(242 242 242 / 0.1);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 16px 40px -16px rgb(0 0 0 / 0.6);
    --logo-filter: invert(1);
  }
}

/* Arabic script must not be letter-spaced: it breaks the joins between letters. */
[dir="rtl"] { --track-tight: 0; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  font-weight: 350;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[dir="rtl"] body { line-height: 1.8; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: var(--track-tight); line-height: 1.1; text-wrap: balance; }
[dir="rtl"] :is(h1, h2, h3, h4) { line-height: 1.35; }
p { margin: 0; text-wrap: pretty; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.ph { font-size: 1.15em; line-height: 1; }
/* Directional arrows point the reading direction. */
[dir="rtl"] .ph-arrow-right, [dir="rtl"] .ph-arrow-up-right, [dir="rtl"] .ph-caret-right, [dir="rtl"] .ph-caret-left { transform: scaleX(-1); }

.skip-link {
  position: absolute; inset-inline-start: 16px; top: -100px; z-index: 40;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px;
}
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 9vw, 120px) clamp(72px, 10vw, 136px); }
.section--tight { padding-block: clamp(40px, 6vw, 72px) clamp(56px, 8vw, 96px); }
.section--flush-top { padding-top: 0; }
.measure { max-width: 62ch; }
.lead { font-size: clamp(1.125rem, 1.6vw, 1.3rem); color: var(--ink-2); line-height: 1.6; }
.muted { color: var(--muted); }
.eyebrow { font-size: 0.8rem; font-weight: 500; color: var(--accent); text-transform: uppercase; letter-spacing: 0.14em; }
[dir="rtl"] .eyebrow { letter-spacing: 0; text-transform: none; font-size: 0.95rem; }
.h-display { font-size: clamp(2.25rem, 5.2vw, 4rem); font-weight: 600; }
.h-section { font-size: clamp(1.75rem, 3.4vw, 2.75rem); }
.h-card { font-size: clamp(1.25rem, 2vw, 1.6rem); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 500; font-size: 0.975rem; cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--ink); }
.btn .ph { transition: transform 0.3s var(--ease); }
.btn:hover .ph-arrow-right { transform: translateX(3px); }
[dir="rtl"] .btn:hover .ph-arrow-right { transform: scaleX(-1) translateX(3px); }

.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--accent); }
.link-arrow .ph { transition: transform 0.3s var(--ease); }
.link-arrow:hover .ph-arrow-right { transform: translateX(3px); }
[dir="rtl"] .link-arrow:hover .ph-arrow-right { transform: scaleX(-1) translateX(3px); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
@media (prefers-reduced-transparency: reduce) { .site-header { background: var(--bg); backdrop-filter: none; } }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--header-h); }
.brand img { width: 104px; height: auto; filter: var(--logo-filter); }
@media (max-width: 599px) { .brand img { width: 92px; } }
.nav { display: flex; align-items: center; gap: 4px; }
.nav__link {
  position: relative; padding: 8px 14px; border-radius: 999px; color: var(--ink-2); font-weight: 400;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.nav__link:hover { color: var(--ink); background: var(--surface-2); }
.nav__link[aria-current="page"] { color: var(--ink); font-weight: 500; background: var(--surface-2); }
.nav__aside { display: flex; align-items: center; gap: 8px; }
.lang-switch { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 0.925rem; transition: border-color 0.2s var(--ease); }
.lang-switch:hover { border-color: var(--ink); }
.menu-toggle { display: none; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; align-items: center; justify-content: center; font-size: 1.2rem; }
.mobile-nav { display: none; }

@media (max-width: 899px) {
  .nav, .nav__aside .btn { display: none; }
  .menu-toggle { display: inline-flex; }
  .mobile-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; z-index: 30;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 12px var(--gutter) 24px;
    display: grid; gap: 4px;
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
  }
  .mobile-nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .mobile-nav a { padding: 14px 4px; font-size: 1.15rem; border-bottom: 1px solid var(--line); }
  .mobile-nav a[aria-current="page"] { color: var(--accent); font-weight: 500; }
  .mobile-nav .btn { margin-top: 16px; justify-content: center; border-bottom: 0; }
}

/* Hero */
.hero { padding-block: clamp(32px, 6vw, 72px) clamp(40px, 6vw, 72px); }
.hero__grid { display: grid; gap: clamp(24px, 4vw, 48px); }
.hero__top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: end; }
@media (min-width: 900px) { .hero__top { grid-template-columns: minmax(0, 1.5fr) auto; } }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Slides carry admin-edited HTML with inline colours and centring. Normalise it to the theme. */
.rich-slide :is(span, strong, em) { color: inherit !important; }
.rich-slide [style] { text-align: start !important; color: inherit !important; }
.rich-slide :is(h1, h2) { font-size: clamp(2.25rem, 5.4vw, 4.25rem); font-weight: 600; margin: 0 0 14px; }
.rich-slide h3 { font-size: clamp(0.95rem, 1.3vw, 1.05rem); font-weight: 500; color: var(--accent) !important; margin: 0 0 10px; text-transform: none; letter-spacing: 0; }
.rich-slide h3 span { color: inherit !important; }
.rich-slide p { font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--ink-2) !important; max-width: 46ch; }
.rich-slide p strong { font-weight: 400; }

.slides { position: relative; }
.slide-copy { display: none; }
.slide-copy.is-active { display: block; animation: rise 0.7s var(--ease) both; }
.hero__media {
  position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface-2);
  aspect-ratio: 1920 / 663; max-height: 52vh; width: 100%;
}
@media (max-width: 699px) { .hero__media { aspect-ratio: 4 / 3; max-height: none; } }
.hero__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.9s var(--ease); }
.hero__media img.is-active { opacity: 1; }
.slide-controls { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.slide-controls button {
  width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: border-color 0.2s var(--ease);
}
.slide-controls button:hover { border-color: var(--ink); }
.slide-count { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.9rem; margin-inline-start: 6px; }

/* Admin-edited long-form content (home welcome block). */
.prose { color: var(--ink-2); font-size: 1.075rem; }
.prose [style] { padding: 0 !important; text-align: start !important; }
.prose :is(h1, h2, h3) { color: var(--ink); font-size: clamp(1.75rem, 3.2vw, 2.5rem); font-weight: 400; margin: 0 0 24px; }
.prose :is(h1, h2, h3) strong { font-weight: 600; }
.prose p { margin: 0 0 1em; max-width: 62ch; }
.prose p:empty, .prose p:has(> br:only-child) { display: none; }
/* The welcome block's pasted inline image is replaced by the section photo beside it. */
.prose img { display: none !important; }

/* Split section */
.split { display: grid; gap: clamp(32px, 6vw, 80px); align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); } }
.split__media { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 5; background: var(--surface-2); }
.split__media img { width: 100%; height: 100%; object-fit: cover; }

/* Projects bento: first item spans two rows, others stack. */
.bento { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(260px, auto); }
  .bento > :first-child { grid-row: span 2; }
  .bento--single > :first-child { grid-row: auto; grid-column: 1 / -1; }
  /* An even count has no odd tile to stand tall, so every tile takes one cell. */
  .bento--even > :first-child { grid-row: auto; }
}
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 300px; border-radius: var(--radius); overflow: hidden; isolation: isolate;
  color: #f2f2f2; background: #1b1b1b;
}
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 0.8s var(--ease); }
.tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgb(10 10 10 / 0.82) 0%, rgb(10 10 10 / 0.25) 45%, rgb(10 10 10 / 0) 70%); }
.tile:hover img { transform: scale(1.04); }
.tile__body { padding: clamp(20px, 3vw, 32px); display: grid; gap: 8px; }
.tile__body p { color: rgb(242 242 242 / 0.82); max-width: 48ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile__meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tile__go {
  flex: none; width: 44px; height: 44px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  background: rgb(242 242 242 / 0.14); border: 1px solid rgb(242 242 242 / 0.25);
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
.tile:hover .tile__go { background: #f2f2f2; color: #111111; }

/* Service rows on home: plain list with a divider between items. */
.svc-list { display: grid; }
.svc-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: clamp(16px, 3vw, 32px); align-items: center;
  padding-block: clamp(24px, 3vw, 36px); border-top: 1px solid var(--line);
}
.svc-row:last-child { border-bottom: 1px solid var(--line); }
.svc-row__icon { width: 56px; height: 56px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.svc-row p { color: var(--muted); margin-top: 6px; max-width: 70ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.svc-row .ph-arrow-right { font-size: 1.4rem; color: var(--muted); transition: transform 0.3s var(--ease), color 0.3s var(--ease); }
.svc-row:hover .ph-arrow-right { color: var(--accent); transform: translateX(4px); }
[dir="rtl"] .svc-row:hover .ph-arrow-right { transform: scaleX(-1) translateX(4px); }
@media (max-width: 599px) { .svc-row { grid-template-columns: minmax(0, 1fr) auto; } .svc-row__icon { display: none; } }

/* Contact band */
.band {
  border-radius: calc(var(--radius) + 8px); padding: clamp(32px, 6vw, 72px);
  background: var(--ink); color: var(--bg);
  display: grid; gap: 28px; align-items: center;
}
@media (min-width: 900px) { .band { grid-template-columns: minmax(0, 1fr) auto; } }
.band p { color: color-mix(in srgb, var(--bg) 72%, transparent); margin-top: 12px; max-width: 52ch; }
.band .btn--primary { background: var(--bg); color: var(--ink); }
.band .btn--primary:hover { background: color-mix(in srgb, var(--bg) 88%, var(--accent)); }

/* Page header */
.page-head { padding-block: clamp(40px, 7vw, 88px) clamp(24px, 4vw, 48px); }
.page-head .lead { margin-top: 18px; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.925rem; margin-bottom: 20px; }
.crumbs a:hover { color: var(--ink); }

/* About */
.about-lead { margin-top: 16px; font-size: clamp(1.25rem, 2.2vw, 1.75rem); line-height: 1.45; font-weight: 300; color: var(--ink); max-width: 34ch; }
[dir="rtl"] .about-lead { line-height: 1.75; }
.about-grid { display: grid; gap: 16px; margin-top: clamp(48px, 7vw, 88px); }
@media (min-width: 900px) {
  .about-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-auto-rows: minmax(220px, auto); }
  .about-grid > .about-card--feature { grid-row: span 2; }
}
.about-card { border-radius: var(--radius); padding: clamp(24px, 3.4vw, 40px); background: var(--surface); border: 1px solid var(--line); display: grid; align-content: start; gap: 14px; }
.about-card p { color: var(--muted); }
.about-card__icon { font-size: 1.6rem; color: var(--accent); }
.about-card--feature { position: relative; overflow: hidden; isolation: isolate; color: #f2f2f2; border: 0; align-content: end; min-height: 420px; background: #1b1b1b; }
.about-card--feature img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.about-card--feature::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgb(10 10 10 / 0.88), rgb(10 10 10 / 0.2) 70%); }
.about-card--feature p { color: rgb(242 242 242 / 0.85); }
.about-card--feature .about-card__icon { color: #f2f2f2; }

/* Services page */
.service { display: grid; gap: clamp(28px, 5vw, 72px); align-items: center; padding-block: clamp(40px, 6vw, 72px); }
.service + .service { border-top: 1px solid var(--line); }
@media (min-width: 900px) {
  .service { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .service:nth-child(even) .service__media { order: 2; }
}
.service__media { border-radius: var(--radius); overflow: hidden; aspect-ratio: 400 / 248; background: var(--surface-2); }
.service__media img { width: 100%; height: 100%; object-fit: cover; }
.service h2 { margin-bottom: 18px; }
.service p { color: var(--ink-2); font-size: 1.075rem; }

/* Project detail */
.project-head { display: grid; gap: clamp(28px, 5vw, 64px); align-items: end; }
@media (min-width: 900px) { .project-head { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); } }
.project-head__meta { display: grid; gap: 4px; padding-block: 20px; border-top: 1px solid var(--line); color: var(--muted); }
.project-head__meta strong { color: var(--ink); font-weight: 500; font-size: 1.5rem; font-variant-numeric: tabular-nums; }

.gallery { columns: 3 280px; column-gap: 16px; }
.gallery__item {
  display: block; width: 100%; margin: 0 0 16px; padding: 0; border: 0; background: var(--surface-2);
  border-radius: var(--radius-sm); overflow: hidden; break-inside: avoid; cursor: zoom-in;
}
.gallery__item img { width: 100%; transition: transform 0.6s var(--ease), opacity 0.3s var(--ease); }
.gallery__item:hover img { transform: scale(1.03); }

.lightbox { border: 0; padding: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: rgb(10 10 10 / 0.94); color: #f2f2f2; }
.lightbox::backdrop { background: rgb(10 10 10 / 0.6); }
.lightbox__stage { position: absolute; inset: 64px 72px; display: flex; align-items: center; justify-content: center; }
.lightbox__stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius-sm); }
.lightbox__btn {
  position: absolute; width: 48px; height: 48px; border-radius: 999px; border: 1px solid rgb(242 242 242 / 0.25);
  background: rgb(242 242 242 / 0.08); color: inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem;
}
.lightbox__btn:hover { background: rgb(242 242 242 / 0.18); }
.lightbox__close { top: 12px; inset-inline-end: 12px; }
.lightbox__prev { top: 50%; inset-inline-start: 12px; transform: translateY(-50%); }
.lightbox__next { top: 50%; inset-inline-end: 12px; transform: translateY(-50%); }
.lightbox__count { position: absolute; bottom: 20px; inset-inline: 0; text-align: center; font-variant-numeric: tabular-nums; color: rgb(242 242 242 / 0.7); }
@media (max-width: 699px) { .lightbox__stage { inset: 64px 12px 72px; } .lightbox__prev, .lightbox__next { top: auto; bottom: 12px; transform: none; } }

.more { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.more .tile { min-height: 240px; }

/* Contact */
.contact-grid { display: grid; gap: clamp(40px, 6vw, 88px); }
@media (min-width: 960px) { .contact-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.channels { display: grid; margin-top: 32px; }
.channel {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center;
  padding-block: 20px; border-top: 1px solid var(--line);
}
.channel:last-child { border-bottom: 1px solid var(--line); }
.channel__icon { width: 48px; height: 48px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; }
.channel__label { display: block; color: var(--muted); font-size: 0.9rem; }
.channel__value { display: block; font-size: 1.15rem; font-weight: 500; overflow-wrap: anywhere; }
.channel .ph-arrow-up-right { color: var(--muted); transition: transform 0.3s var(--ease), color 0.3s var(--ease); }
.channel:hover .ph-arrow-up-right { color: var(--accent); transform: translate(2px, -2px); }
[dir="rtl"] .channel:hover .ph-arrow-up-right { transform: scaleX(-1) translate(2px, -2px); }

.form-card { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); padding: clamp(24px, 4vw, 44px); }
.form-card h2 { margin-bottom: 8px; }
.form-card > p { color: var(--muted); margin-bottom: 28px; }
.field { display: grid; gap: 8px; margin-bottom: 20px; }
.field label { font-weight: 500; font-size: 0.95rem; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent); border-radius: var(--radius-sm);
  padding: 13px 14px; transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field textarea { min-height: 140px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field__error { color: #b42318; font-size: 0.9rem; min-height: 1.2em; }
@media (prefers-color-scheme: dark) { .field__error { color: #ff8a80; } }
.field.has-error input, .field.has-error textarea { border-color: #b42318; }
.form-note { color: var(--muted); font-size: 0.9rem; margin-top: 14px; }
.field-row { display: grid; gap: 0 16px; }
@media (min-width: 640px) { .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field__optional { color: var(--muted); font-weight: 400; font-size: 0.875rem; margin-inline-start: 6px; }
.btn:disabled { opacity: 0.6; cursor: progress; }
/* Spam trap: kept out of sight and out of the tab order. */
.hp { position: absolute; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-success { display: flex; gap: 14px; align-items: flex-start; padding: 20px; margin-top: 20px; border-radius: var(--radius-sm); background: var(--accent-soft); }
.form-success .ph { font-size: 1.6rem; flex: none; }
.form-success p { color: var(--muted); margin-top: 4px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: clamp(48px, 7vw, 80px) 32px; margin-top: clamp(24px, 4vw, 48px); }
.footer-grid { display: grid; gap: 40px; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 1fr); } }
.footer-brand img { width: 112px; filter: var(--logo-filter); margin-bottom: 18px; }
.footer-brand p { color: var(--muted); max-width: 36ch; }
.footer-title { font-size: 0.95rem; font-weight: 500; margin-bottom: 14px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; color: var(--muted); }
.footer-links a:hover { color: var(--ink); }
.footer-links .ph { color: var(--accent); margin-inline-end: 8px; vertical-align: -2px; }
.socials { display: flex; gap: 8px; margin-top: 22px; }
.socials a { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; transition: border-color 0.2s var(--ease), color 0.2s var(--ease); }
.socials a:hover { border-color: var(--accent); color: var(--accent); }
.footer-base { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

.section-head { display: grid; gap: 14px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head__row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; }

.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 48px 24px; text-align: center; color: var(--muted); }

/* Reveal on scroll. Only hidden when JS has run and motion is allowed. */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Brand projects with their own website */
.project-site { margin-top: 28px; }
.tile__site { justify-self: start; font-size: 0.85rem; color: rgb(242 242 242 / 0.85); border: 1px solid rgb(242 242 242 / 0.3); border-radius: 999px; padding: 3px 12px; }

/* Not found page */
.not-found { min-height: 60vh; display: grid; align-content: center; gap: 20px; }
.not-found .actions { display: flex; flex-wrap: wrap; gap: 12px; }
