/**
 * dshost — sketchy primitives (double-line, grain, frame)
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body.ds-landing-root {
  margin: 0;
  min-height: 100vh;
  font-family: var(--ds-font-body);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ds-ink);
  background-color: var(--ds-bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(232, 184, 74, 0.06), transparent 55%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.05 0 0 0 0 0.04 0 0 0 0 0.03 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-blend-mode: normal, soft-light;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--ds-gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--ds-gold-bright);
}

h1,
h2,
h3,
.ds-display {
  font-family: var(--ds-font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.15;
  color: var(--ds-ink);
  margin: 0;
}

.ds-label {
  font-family: var(--ds-font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ds-ink-muted);
}

/* —— Sketchy double frame —— */
.ds-frame {
  position: relative;
  background: var(--ds-surface);
  border: 2px solid var(--ds-line);
  border-radius: var(--ds-radius);
  box-shadow:
    inset 0 0 0 1px rgba(196, 176, 138, 0.35),
    var(--ds-shadow-ink);
}

.ds-frame::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(196, 176, 138, 0.5);
  border-radius: 1px;
  pointer-events: none;
  opacity: 0.85;
  /* hand-drawn irregularity */
  clip-path: polygon(
    0.6% 1.2%,
    12% 0.3%,
    48% 0.9%,
    78% 0.2%,
    99.4% 0.8%,
    99.8% 22%,
    99.1% 55%,
    99.7% 88%,
    99.2% 99.3%,
    62% 99.8%,
    28% 99.1%,
    0.5% 99.5%,
    0.2% 71%,
    0.8% 38%,
    0.3% 12%
  );
}

/* Outer ink wobble — only the stroke layer, not children text */
.ds-frame::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 2px solid var(--ds-line);
  border-radius: var(--ds-radius);
  pointer-events: none;
  opacity: 0.55;
  filter: url("#ds-ink-wobble");
  mix-blend-mode: soft-light;
}

.ds-frame--gold {
  border-color: var(--ds-gold);
  box-shadow:
    inset 0 0 0 1px rgba(232, 184, 74, 0.4),
    0 0 0 1px rgba(232, 184, 74, 0.15),
    var(--ds-shadow-ink);
}

.ds-frame--gold::before {
  border-color: rgba(232, 184, 74, 0.55);
}

.ds-frame--flat {
  box-shadow: inset 0 0 0 1px rgba(196, 176, 138, 0.28);
}

.ds-frame--flat::before {
  inset: 3px;
}

/* Grain overlay helper */
.ds-grain {
  position: relative;
  isolation: isolate;
}

.ds-grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  z-index: 1;
}

/* Layout helpers for demo */
.ds-wrap {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.ds-section {
  padding-block: var(--ds-space-8);
}

.ds-section-head {
  margin-bottom: var(--ds-space-5);
}

.ds-section-head .ds-label {
  margin-bottom: var(--ds-space-2);
}

.ds-section-head h2 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  color: var(--ds-gold);
}

.ds-section-head p {
  margin: var(--ds-space-3) 0 0;
  max-width: 36rem;
  color: var(--ds-ink-muted);
}

.ds-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-space-4);
  align-items: center;
}

.ds-grid-2 {
  display: grid;
  gap: var(--ds-space-5);
}

@media (min-width: 720px) {
  .ds-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.ds-grid-3 {
  display: grid;
  gap: var(--ds-space-5);
}

@media (min-width: 860px) {
  .ds-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.ds-stack {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-3);
}

.ds-divider {
  height: 0;
  border: 0;
  border-top: 1px solid var(--ds-line-dim);
  margin: var(--ds-space-6) 0;
  opacity: 0.7;
}
