/* Dithered Footer: a vanilla port of otatechie's "Dithered Footer" on 21st.dev (MIT).
   A full-width site footer: brand column (name, tagline, optional email form or link CTA), link columns,
   a band of accent-coloured dots that thin out upward (a 4px dot grid intersected with thresholded SVG noise
   over a vertical gradient, drifting sideways), the brand wordmark knocked out of the dots in the background
   colour, and a bottom row (copyright, links, status, socials, back to top). Values are the original's
   compiled Tailwind ones (rem sizes, 150ms colour transitions, radius 6px / 8px, breakpoints 40rem / 48rem).

   Colours follow the page theme (shadcn "Modern Minimal" tokens, with fallbacks). Per instance, set from JS:
     --df-accent / --df-accent-dark   the dots and focus ring (original default #ff6a00; demo #10b981)
     --df-status                      the status dot (original emerald-500)
   Optional overrides: --df-mark-font (wordmark font, default: inherited page font), --df-input (input border). */

.df {
  --df-bg: var(--color-canvas, #fff);
  --df-fg: var(--color-text, #333);
  --df-muted: var(--color-text-muted, #6b7280);
  --df-border: var(--color-border, #e5e7eb);
  --df-in: var(--df-input, var(--df-border));
  --df-a: var(--df-accent, #ff6a00);
  --df-ease: cubic-bezier(.4, 0, .2, 1);
  display: block;
  overflow: hidden;
  border-block-start: 1px solid var(--df-border);
  background: var(--df-bg);
  color: var(--df-fg);
}
:root[data-theme="dark"] .df {
  --df-bg: var(--color-canvas, #171717);
  --df-fg: var(--color-text, #e5e5e5);
  --df-muted: var(--color-text-muted, #a3a3a3);
  --df-border: var(--color-border, #404040);
  --df-a: var(--df-accent-dark, var(--df-accent, #ff6a00));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .df {
    --df-bg: var(--color-canvas, #171717);
    --df-fg: var(--color-text, #e5e5e5);
    --df-muted: var(--color-text-muted, #a3a3a3);
    --df-border: var(--color-border, #404040);
    --df-a: var(--df-accent-dark, var(--df-accent, #ff6a00));
  }
}

/* Local preflight (the site has no Tailwind reset). */
/* :where() keeps these at element specificity so the component's own classes below win. */
:where(.df) *, :where(.df) *::before, :where(.df) *::after { box-sizing: border-box; }
:where(.df) :is(p, ul, li, form) { margin: 0; padding: 0; }
:where(.df) ul { list-style: none; }
:where(.df) a { color: inherit; text-decoration: inherit; }
:where(.df) :is(button, input) { font: inherit; letter-spacing: inherit; color: inherit; margin: 0; }
:where(.df) button { background: transparent; border: 0; padding: 0; }
:where(.df) svg { display: block; flex-shrink: 0; }
.df :focus-visible { outline: 2px solid var(--df-a); outline-offset: 2px; }

/* Top grid: 2 columns, 1.6fr + 3 x 1fr from md. */
.df-top {
  margin-inline: auto; max-inline-size: 72rem;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.5rem; row-gap: 3rem;
  padding: 4rem 1.5rem;
}
.df-brand { grid-column: span 2 / span 2; }
.df-name { border-radius: 6px; font-size: 1rem; line-height: 1.5rem; font-weight: 600; letter-spacing: -.025em; }
.df-tagline { margin-block-start: .75rem; max-inline-size: 20rem; font-size: .875rem; line-height: 1.625; color: var(--df-muted); }

.df-form { margin-block-start: 2rem; max-inline-size: 24rem; }
.df-label { display: block; font-size: .875rem; line-height: 1.25rem; font-weight: 500; }
.df-row { margin-block-start: .5rem; display: flex; gap: .5rem; }
.df-input {
  block-size: 2.5rem; min-inline-size: 0; flex: 1 1 0%;
  border-radius: 8px; border: 1px solid var(--df-in); background: transparent;
  padding-inline: .75rem; font-size: .875rem; line-height: 1.25rem;
  transition: color .15s var(--df-ease), background-color .15s var(--df-ease), border-color .15s var(--df-ease), outline-color .15s var(--df-ease);
}
.df .df-input:focus { border-color: var(--df-a); outline: 2px solid var(--df-a); outline-offset: 0; }
.df-button {
  display: inline-flex; align-items: center; justify-content: center;
  block-size: 2.5rem; flex-shrink: 0; border-radius: 8px;
  padding-inline: 1rem; font-size: .875rem; line-height: 1.25rem; font-weight: 500;
  transition: all .15s var(--df-ease);
}
.df .df-button { background: var(--df-fg); color: var(--df-bg); }
@media (hover: hover) { .df-button:hover { opacity: .9; } }
.df-button:active { scale: .97; }
.df-button:disabled { opacity: .6; }
.df-cta { margin-block-start: .5rem; }
.df-msg { margin-block-start: .5rem; min-block-size: 1.25rem; font-size: .875rem; line-height: 1.25rem; color: var(--df-muted); }

.df-col-title { font-size: .875rem; line-height: 1.25rem; font-weight: 500; color: var(--df-fg); }
.df-links { margin-block-start: 1rem; }
.df-links > li + li { margin-block-start: .75rem; }
.df-link { border-radius: 6px; font-size: .875rem; line-height: 1.25rem; color: var(--df-muted); transition: color .15s var(--df-ease); }

/* Hover colour for every muted link/button. */
@media (hover: hover) {
  .df-link:hover, .df-bottom a:hover, .df-totop:hover { color: var(--df-fg); }
}

/* The dot band. */
.df-band { position: relative; block-size: 15rem; overflow: hidden; pointer-events: none; }
.df-field { position: absolute; inset: 0; }
.df-field.df-lit {
  -webkit-mask-image: radial-gradient(circle 190px at var(--df-x, 50%) var(--df-y, 50%), #000 35%, rgb(0 0 0 / .22) 100%);
  mask-image: radial-gradient(circle 190px at var(--df-x, 50%) var(--df-y, 50%), #000 35%, rgb(0 0 0 / .22) 100%);
}
.df-dots {
  position: absolute; inset-block: 0; left: 0;
  width: calc(100% + 360px);
  background: var(--df-a);
  /* 1) a 4px grid of ~1px dots; 2) a 360x240 tile: vertical gradient (top 0.04 -> bottom 0.96) plus
     fractal noise, thresholded to 0/1, so dots get sparser toward the top. Intersected. */
  -webkit-mask-image: radial-gradient(circle, #000 .9px, transparent 1.3px), url('data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27360%27%20height%3D%27240%27%3E%3Cdefs%3E%3ClinearGradient%20id%3D%27g%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%270%27%20y2%3D%271%27%3E%3Cstop%20offset%3D%270.04%27%20stop-color%3D%27%23000%27%2F%3E%3Cstop%20offset%3D%270.96%27%20stop-color%3D%27%23fff%27%2F%3E%3C%2FlinearGradient%3E%3Cfilter%20id%3D%27f%27%20x%3D%270%27%20y%3D%270%27%20width%3D%27100%25%27%20height%3D%27100%25%27%20color-interpolation-filters%3D%27sRGB%27%3E%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%270.45%27%20numOctaves%3D%272%27%20seed%3D%277%27%20stitchTiles%3D%27stitch%27%20result%3D%27n%27%2F%3E%3CfeColorMatrix%20in%3D%27n%27%20type%3D%27matrix%27%20values%3D%271%200%200%200%200%201%200%200%200%200%201%200%200%200%200%200%200%200%200%201%27%20result%3D%27ng%27%2F%3E%3CfeComposite%20in%3D%27SourceGraphic%27%20in2%3D%27ng%27%20operator%3D%27arithmetic%27%20k2%3D%270.5%27%20k3%3D%270.5%27%20result%3D%27s%27%2F%3E%3CfeComponentTransfer%20in%3D%27s%27%20result%3D%27t%27%3E%3CfeFuncR%20type%3D%27discrete%27%20tableValues%3D%270%201%27%2F%3E%3C%2FfeComponentTransfer%3E%3CfeColorMatrix%20in%3D%27t%27%20type%3D%27matrix%27%20values%3D%270%200%200%200%201%200%200%200%200%200.5%200%200%200%200%200%201%200%200%200%200%27%2F%3E%3C%2Ffilter%3E%3C%2Fdefs%3E%3Crect%20width%3D%27100%25%27%20height%3D%27100%25%27%20fill%3D%27url%28%23g%29%27%20filter%3D%27url%28%23f%29%27%2F%3E%3C%2Fsvg%3E');
  mask-image: radial-gradient(circle, #000 .9px, transparent 1.3px), url('data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27360%27%20height%3D%27240%27%3E%3Cdefs%3E%3ClinearGradient%20id%3D%27g%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%270%27%20y2%3D%271%27%3E%3Cstop%20offset%3D%270.04%27%20stop-color%3D%27%23000%27%2F%3E%3Cstop%20offset%3D%270.96%27%20stop-color%3D%27%23fff%27%2F%3E%3C%2FlinearGradient%3E%3Cfilter%20id%3D%27f%27%20x%3D%270%27%20y%3D%270%27%20width%3D%27100%25%27%20height%3D%27100%25%27%20color-interpolation-filters%3D%27sRGB%27%3E%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%270.45%27%20numOctaves%3D%272%27%20seed%3D%277%27%20stitchTiles%3D%27stitch%27%20result%3D%27n%27%2F%3E%3CfeColorMatrix%20in%3D%27n%27%20type%3D%27matrix%27%20values%3D%271%200%200%200%200%201%200%200%200%200%201%200%200%200%200%200%200%200%200%201%27%20result%3D%27ng%27%2F%3E%3CfeComposite%20in%3D%27SourceGraphic%27%20in2%3D%27ng%27%20operator%3D%27arithmetic%27%20k2%3D%270.5%27%20k3%3D%270.5%27%20result%3D%27s%27%2F%3E%3CfeComponentTransfer%20in%3D%27s%27%20result%3D%27t%27%3E%3CfeFuncR%20type%3D%27discrete%27%20tableValues%3D%270%201%27%2F%3E%3C%2FfeComponentTransfer%3E%3CfeColorMatrix%20in%3D%27t%27%20type%3D%27matrix%27%20values%3D%270%200%200%200%201%200%200%200%200%200.5%200%200%200%200%200%201%200%200%200%200%27%2F%3E%3C%2Ffilter%3E%3C%2Fdefs%3E%3Crect%20width%3D%27100%25%27%20height%3D%27100%25%27%20fill%3D%27url%28%23g%29%27%20filter%3D%27url%28%23f%29%27%2F%3E%3C%2Fsvg%3E');
  -webkit-mask-size: 4px 4px, 360px 240px;
  mask-size: 4px 4px, 360px 240px;
  -webkit-mask-repeat: repeat, repeat-x;
  mask-repeat: repeat, repeat-x;
  -webkit-mask-position: 0 0, left bottom;
  mask-position: 0 0, left bottom;
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
/* The wordmark, knocked out of the dots in the background colour. Uses the page font, so Arabic is shaped
   and joined by the browser's text engine. */
.df-mark {
  pointer-events: none; position: absolute; inset-block-end: -.05em; inset-inline-start: .75rem;
  user-select: none; -webkit-user-select: none; white-space: nowrap;
  font-family: var(--df-mark-font, inherit);
  font-size: clamp(5rem, 21vw, 13rem); font-weight: 700; line-height: .8; letter-spacing: -.06em;
  color: var(--df-bg);
}
/* Orism's solid band (no dots): the wordmark in a pale tint of the accent, one flat colour. */
.df-band--solid .df-field { display: none; }
.df-band--solid { block-size: clamp(7rem, 17vw, 12.5rem); }
.df-band--solid .df-mark { color: color-mix(in oklab, var(--df-a) 16%, var(--df-bg)); }
/* Joined scripts (Arabic): no tracking (it would tear or overlap the joins), and lift the baseline so the
   descenders of ر و م ي stay inside the band like the Latin baseline does. */
.df-mark--joined { letter-spacing: 0; line-height: 1.1; inset-block-end: -.12em; }

@media (prefers-reduced-motion: no-preference) {
  .df-dots { animation: df-drift 40s linear infinite; }
  .df-paused .df-dots { animation-play-state: paused; }
  @supports (animation-timeline: view()) {
    .df-band { view-timeline: --df-band; }
    .df-mark { animation: df-rise linear both; animation-timeline: --df-band; animation-range: entry 20% entry 100%; }
  }
}
@keyframes df-drift { to { translate: -360px 0; } }
@keyframes df-rise { from { translate: 0 30%; } }

/* Bottom row. */
.df-bottom { border-block-start: 1px solid var(--df-border); }
.df-bar {
  margin-inline: auto; max-inline-size: 72rem;
  display: flex; flex-direction: column; gap: 1rem;
  padding: 1.25rem 1.5rem;
  font-size: .875rem; line-height: 1.25rem; color: var(--df-muted);
}
.df-meta { display: flex; flex-wrap: wrap; align-items: center; column-gap: 1.25rem; row-gap: .5rem; }
.df-bottom a, .df-totop { border-radius: 6px; transition: color .15s var(--df-ease); }
.df-status { display: inline-flex; align-items: center; gap: .5rem; }
.df-dot { inline-size: .375rem; block-size: .375rem; border-radius: 9999px; background: var(--df-status, oklch(69.6% .17 162.48)); }
.df-end { margin-inline-end: -.5rem; display: flex; align-items: center; gap: .25rem; }
.df .df-social {
  display: grid; place-items: center; inline-size: 2.25rem; block-size: 2.25rem; border-radius: 8px;
  transition: color .15s var(--df-ease), background-color .15s var(--df-ease);
}
.df-social svg { inline-size: 1rem; block-size: 1rem; }
@media (hover: hover) { .df .df-social:hover { background: color-mix(in oklab, var(--df-fg) 5%, transparent); } }
.df-sep { margin-inline: .5rem; block-size: 1rem; inline-size: 1px; background: var(--df-border); }
.df-totop { display: inline-flex; align-items: center; gap: .375rem; padding-inline: .25rem; }
.df-totop svg { inline-size: .875rem; block-size: .875rem; }

@media (min-width: 40rem) {
  .df-top { column-gap: 2.5rem; padding-inline: 2rem; }
  .df-mark { inset-inline-start: 1.25rem; }
  .df-bar { flex-direction: row; align-items: center; justify-content: space-between; padding-inline: 2rem; }
}
@media (min-width: 48rem) {
  .df-top { grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); }
  .df-brand { grid-column: span 1 / span 1; }
}
/* Touch: 44px targets. */
@media (pointer: coarse) {
  .df-links > li + li { margin-block-start: 0; }
  .df-link, .df-meta a, .df-totop { display: inline-flex; min-block-size: 2.75rem; align-items: center; }
  .df-input, .df-button { block-size: 2.75rem; }
  .df .df-social { inline-size: 2.75rem; block-size: 2.75rem; }
}
