/* How far the lime sun stands above the line, 0 (sunk) to 1 (up). The pixel
   sky reads it; the stage raises it as the middle opens. */
@property --sun {
  syntax: '<number>';
  inherits: false;
  initial-value: 1;
}

/* The pixel horizon (pixel-skies.js): a low-resolution canvas over the
   gradient, scaled up without smoothing. The grain stays off it: pixels are
   the texture. */
.horizon > .pixel-sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  pointer-events: none;
}
.horizon[data-px]::after {
  display: none;
}

/* The corporate paper, type and earth from the November 2026 Ufuk design. */
:root[data-site='core'] {
  --canvas: #faf9f5;
  --band: #f0eee6;
  --ink: #141413;
  --ink-2: #5e5d59;
  --rule: #74716a;
  --rule-soft: rgba(20, 20, 19, 0.12);
  --on-mark: #1d1c19;
  --ok: #1f6b3a;
  --warn: #7e5200;
  --bad: #94261a;
  --gst: #0c6272;
  --focus: #0c6272;
  --night: #141413;
  --night-2: #1f1e1c;
  --on-night: #f2ede4;
  --on-night-2: #a9a59c;
  --earth: #110d0b;
  --on-horizon: #f2ede4;
  --on-horizon-2: #bdb6aa;
  --font-serif: 'Newsreader', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-display: var(--font-serif);
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-site='core'] :is(h1, h2, h3, h4, .display, .brand):not(.sheet-classic *, .label) {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.012em;
}

[data-site='core'] .horizon {
  --sky: linear-gradient(
    180deg,
    #0a1222 0%,
    #142d52 calc(var(--horizon-at) - 44%),
    #2f5b91 calc(var(--horizon-at) - 28%),
    #6683b4 calc(var(--horizon-at) - 16%),
    #b8949f calc(var(--horizon-at) - 8%),
    #ef9a5a calc(var(--horizon-at) - 3%),
    #e2582a calc(var(--horizon-at) + 0.5%),
    #2a140d calc(var(--horizon-at) + 5%),
    var(--earth) calc(var(--horizon-at) + 18%)
  );
  --glow: rgba(255, 132, 64, 0.75);
  --horizon-at: 62%;
  --band: rgba(242, 237, 228, 0.1);
  --rule-soft: rgba(242, 237, 228, 0.16);
  background-image:
    radial-gradient(
      160% 48% at 50% calc(var(--horizon-at) + 46%),
      var(--earth) 0 72%,
      transparent 74.5%
    ),
    radial-gradient(70% 9% at 50% var(--horizon-at), var(--glow), transparent 70%),
    var(--sky);
}

[data-site='core'] .horizon-toque {
  --sky: linear-gradient(
    180deg,
    #1c0907 0%,
    #5a1a10 calc(var(--horizon-at) - 42%),
    #a8361b calc(var(--horizon-at) - 26%),
    #e0672c calc(var(--horizon-at) - 14%),
    #f3a84a calc(var(--horizon-at) - 6%),
    #f8d68c calc(var(--horizon-at) - 1%),
    #3a1a0e calc(var(--horizon-at) + 5%),
    var(--earth) calc(var(--horizon-at) + 18%)
  );
  --glow: rgba(255, 214, 140, 0.8);
}

[data-site='core'] .horizon-zelie {
  --sky: linear-gradient(
    180deg,
    #04060a 0%,
    #0a1522 calc(var(--horizon-at) - 40%),
    #10304a calc(var(--horizon-at) - 24%),
    #1b5866 calc(var(--horizon-at) - 12%),
    #2f8a74 calc(var(--horizon-at) - 5%),
    #7fd3a4 calc(var(--horizon-at) - 0.5%),
    #0f2420 calc(var(--horizon-at) + 4.5%),
    var(--earth) calc(var(--horizon-at) + 18%)
  );
  --glow: rgba(110, 230, 170, 0.55);
}

/* The printed gradient is the entire sky without scripting. The drawn
   pixel surface replaces the grain only after its first successful paint. */
[data-site='core'] .horizon::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: var(--grain);
  background-size: 220px;
  mix-blend-mode: overlay;
  opacity: 0.55;
}

[data-site='core'] .horizon:has(> .pixel-sky[data-px])::after {
  display: none;
}

[data-site='core'] .horizon > .pixel-sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  pointer-events: none;
}

[data-site='core'] .ufuk-page-horizon {
  --horizon-at: 190px;
  min-height: min(74svh, 680px);
  border-bottom: 0;
}

[data-site='core'] .pressed {
  filter: url('#cc-press');
}

/* The original floating pills have their own dark surfaces over both sky
   and paper. BarClient reveals the bar as the home stage opens or on Tab. */
html[data-site='core'] .site-bar,
html[data-site='core'][data-scrolled] .site-bar {
  --band: rgba(242, 237, 228, 0.12);
  --rule-soft: rgba(242, 237, 228, 0.16);
  border-bottom: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

[data-site='core'] .bar-pill {
  height: 38px;
  border-color: rgba(242, 237, 228, 0.14);
  background: rgba(22, 20, 18, 0.78);
  font-size: 14.5px;
}

[data-site='core'] .bar-pill:is(:hover, :focus-visible) {
  background: rgba(46, 42, 38, 0.92);
}

[data-site='core'] .bar-pill.is-current {
  border-color: rgba(242, 237, 228, 0.42);
}

[data-site='core'] .bar-pill:has(+ [popover]:popover-open) {
  background: #faf9f5;
  color: #141413;
  border-color: #faf9f5;
}

[data-site='core'] .bar-pill-light {
  background: #f2ede4;
  color: #141413;
  border-color: #f2ede4;
}

[data-site='core'] .bar-pill-light:is(:hover, :focus-visible) {
  background: #fff;
}

[data-site='core'] .bar-icon {
  width: 38px;
}

[data-site='core'] .bar-light {
  --canvas: #faf9f5;
  --band: #f0eee6;
  --ink: #141413;
  --ink-2: #5e5d59;
  --rule-soft: rgba(20, 20, 19, 0.12);
  --focus: #0c6272;
}

[data-site='core'] .bar-panel {
  background: var(--canvas);
  border-color: rgba(20, 20, 19, 0.08);
  box-shadow: 0 24px 60px rgba(10, 8, 6, 0.28);
}

[data-site='core'] .bar-sheet {
  background: var(--night);
}

[data-site='core'] .bar-big {
  font-weight: 400;
  letter-spacing: -0.015em;
}

[data-site='core'] .logo > span {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

[data-site='core'] footer .logo + p {
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.015em;
}
