:root {
  --bg-1: #111;
  --bg-2: #222;
  --accent-1: #ff6ec7;
  --accent-2: #00ffd5;
  --text-main: #ffffff;
  --text-soft: rgba(255,255,255,0.75);
  --blur-strength: 120px;
  --grain-opacity: 0.06;
  --bg-x: 20%;
  --bg-y: 10%;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  height: 100%;
  margin: 0;
  overflow: clip;

  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-main);

  background: radial-gradient(
    circle at var(--bg-x) var(--bg-y),
    var(--bg-1),
    var(--bg-2)
  );
}

/* Grain overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  opacity: var(--grain-opacity);
  pointer-events: none;
  z-index: 1;
}

/* =========================================================
   CONTROL PANEL
   ========================================================= */

#control-panel {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 30;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-end;
  gap: 0.5rem;
  max-height: calc(100vh - 2rem);
}

#control-panel button {
  padding: 0.45rem 0.8rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #ffffff;
  background:
    linear-gradient(
      120deg,
      rgba(255,255,255,0.12),
      rgba(255,255,255,0.02)
    );
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.35);
  backdrop-filter: blur(10px);
  cursor: pointer;
  user-select: none;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    letter-spacing 160ms ease;
}

#control-panel button:hover {
  border-color: rgba(255,255,255,0.9);
  letter-spacing: 0.16em;
  transform: translateY(-1px);
  box-shadow:
    0 6px 18px rgba(0,0,0,0.35),
    inset 0 0 0 1px rgba(255,255,255,0.2);
}

#control-panel button:active {
  transform: translateY(0) scale(0.96);
  box-shadow:
    0 2px 8px rgba(0,0,0,0.4);
}

#control-panel button:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--accent-1),
    0 0 0 4px rgba(0,0,0,0.8);
}

/* =========================================================
   ORBS
   ========================================================= */

.orb {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  background: radial-gradient(
    circle,
    var(--accent-1),
    transparent 65%
  );
  filter: blur(var(--blur-strength));
  opacity: 0.65;
  animation: drift 28s linear infinite;
  z-index: 0;
}

.orb.secondary {
  background: radial-gradient(
    circle,
    var(--accent-2),
    transparent 65%
  );
  animation-duration: 34s;
  animation-direction: reverse;
}

@keyframes drift {
  0%   { transform: translate(-20%, -20%) rotate(0deg); }
  100% { transform: translate(20%, 20%) rotate(360deg); }
}

/* =========================================================
   FIELD LAYER
   ========================================================= */

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.6;
}

/* =========================================================
   LAYOUT
   ========================================================= */

main {
  position: relative;
  z-index: 2;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 3rem;
  text-align: center;
}

.content {
  max-width: 64ch;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 6rem);
  letter-spacing: -0.04em;
  margin: 0;
  line-height: 1.05;
}

.accent {
  background: linear-gradient(
    90deg,
    var(--accent-1),
    var(--accent-2)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

p {
  max-width: 48ch;
  margin: 1.5rem auto 0;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  color: var(--text-soft);
}

.layout-offset main {
  place-items: center start;
  text-align: left;
}

.layout-offset .content {
  max-width: 56ch;
}

.layout-split .content {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(200px, 0.9fr);
  gap: 2rem;
  align-items: center;
  text-align: left;
}

.layout-split p {
  margin: 0;
}

@media (max-width: 760px) {
  .layout-split .content {
    grid-template-columns: 1fr;
    gap: 1.2rem;
    text-align: center;
  }

  .layout-offset main {
    place-items: center;
    text-align: center;
  }
}

.type-outline .accent {
  color: transparent;
  -webkit-text-stroke: 1px var(--accent-2);
  text-stroke: 1px var(--accent-2);
  background: none;
}

.type-stacked .accent {
  display: inline-block;
}

.type-stacked .accent .stack-line {
  display: block;
}

.type-stacked h1 {
  letter-spacing: -0.02em;
}

.type-stacked p {
  margin-top: 1rem;
}

/* =========================================================
   FOCUS MODE
   ========================================================= */

body.focus-mode main {
  padding-top: 1rem;
}

body.focus-mode h1 {
  font-size: clamp(3rem, 8vw, 7rem);
}

body.focus-mode p {
  color: rgba(255,255,255,0.6);
}

body.focus-mode #control-panel {
  opacity: 0.6;
}

body.focus-mode .footer {
  opacity: 0.35;
}

@media (max-width: 720px) {
  #control-panel {
    top: auto;
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-height: none;
  }
}

.footer {
  position: absolute;
  bottom: 1.5rem;
  width: 100%;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.65;
  z-index: 2;
}
