/* Ferbix — bekleme ekranı. Açık tema varsayılan; koyu tema cihazın tercihine uyar. */

:root {
  --bg: #f4f5f7;
  --bg-edge: #e4e6eb;
  --ink: #14161b;
  --muted: rgb(20 22 27 / 0.5);
  --soft: rgb(20 22 27 / 0.72);
  --accent: #4b55f0;
  --haze: rgb(112 96 255 / 0.06);
  --grain: 0.04;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI",
    Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0e12;
    --bg-edge: #050608;
    --ink: #eceef3;
    --muted: rgb(236 238 243 / 0.5);
    --soft: rgb(236 238 243 / 0.74);
    --accent: #8a90ff;
    --haze: rgb(128 112 255 / 0.08);
    --grain: 0.06;
  }
}

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

html,
body {
  height: 100%;
}

/* An opaque root: Safari falls back to it when it tints its bars. */
html {
  background-color: var(--bg);
}

body {
  overflow: hidden;
  background-color: var(--bg);
  background-image:
    radial-gradient(55% 45% at 50% 46%, var(--haze) 0%, transparent 100%),
    radial-gradient(130% 95% at 50% 44%, var(--bg) 0%, var(--bg) 42%, var(--bg-edge) 100%);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* A breath of film grain: it keeps the large empty field from looking flat. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: var(--grain);
  /* Fades out at the bar edges too: grain at full strength there lifted the edge a few
     shades above the flat bar colour and drew a faint seam (measured on an iPhone). */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 9%, #000 86%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 9%, #000 86%, transparent 100%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* iOS Safari paints its status bar and bottom toolbar a flat colour, read from the
   background-color of a fixed element at the screen edge (theme-color is ignored). The
   stage is that element, so both bars take var(--bg); its top and bottom edges settle into
   exactly that colour, and the bars read as part of the page instead of two black strips. */
.stage {
  position: fixed;
  inset: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(to bottom, var(--bg) 0%, transparent 9%, transparent 86%, var(--bg) 100%),
    radial-gradient(55% 45% at 50% 46%, var(--haze) 0%, transparent 100%),
    radial-gradient(130% 95% at 50% 44%, var(--bg) 0%, var(--bg) 42%, var(--bg-edge) 100%);
}

/* The silk thins out over the same edges, so no bright fold is ever cut off by a bar. */
.stage__scene {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.6s cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 9%, #000 86%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 9%, #000 86%, transparent 100%);
}

.is-ready .stage__scene {
  opacity: 1;
}

/* The name, in the middle. With the scene it waits a breath, then settles in from a
   soft blur; without it (no script, no graphics) it simply stands there. */
.brand {
  position: absolute;
  inset: 50% 0 auto 0;
  text-align: center;
  font-size: clamp(3.4rem, 9.5vw, 8rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1;
  transform: translateY(-50%);
}

.js .brand {
  opacity: 0;
  transform: translateY(calc(-50% + 12px));
  filter: blur(10px);
  transition:
    opacity 1.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1.8s cubic-bezier(0.22, 1, 0.36, 1),
    filter 1.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.js.is-named .brand,
.js.no-scene .brand {
  opacity: 1;
  transform: translateY(-50%);
  filter: none;
}

/* 404: the name leads home, the note sits just under it. */
.brand a {
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
}

.brand a:focus-visible,
.lost a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
}

.lost {
  position: absolute;
  inset: calc(50% + clamp(2.6rem, 6.5vw, 5.2rem)) 0 auto 0;
  padding: 0 20px;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--soft);
}

.lost a {
  color: var(--ink);
  text-underline-offset: 3px;
  border-radius: 4px;
}

.footer {
  position: fixed;
  inset: auto 0 0 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 max(28px, env(safe-area-inset-right)) calc(26px + env(safe-area-inset-bottom))
    max(28px, env(safe-area-inset-left));
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  opacity: 0;
  animation: rise 1.4s cubic-bezier(0.22, 1, 0.36, 1) 1.2s forwards;
}

.footer__meta {
  color: inherit;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.footer__meta--start {
  justify-self: start;
}

.footer__meta--end {
  justify-self: end;
  border-radius: 4px;
  transition: color 0.25s ease;
}

.footer__meta--end:hover {
  color: var(--ink);
}

.footer__meta--end:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* Trailing letter-spacing would push the word off-centre; the padding gives it back. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.85em;
  padding-left: 0.3em;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--soft);
}

.status__dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.status__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  70%,
  100% {
    transform: scale(3.2);
    opacity: 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 560px) {
  .footer {
    grid-template-columns: 1fr 1fr;
    row-gap: 18px;
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
    font-size: 11px;
  }

  .status {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .footer {
    animation: none;
    opacity: 1;
  }

  .status__dot::after {
    animation: none;
  }

  .stage__scene,
  .brand {
    transition: none;
  }
}
