:root {
  color-scheme: dark;
  --bg: #101820;
  --bg-deep: #080d12;
  --panel: #17242d;
  --panel-strong: #1f303b;
  --text: #edf7f6;
  --muted: #9fb2b8;
  --line: rgba(255, 255, 255, 0.12);
  --card-bg: rgba(255, 255, 255, 0.055);
  --nav-hover-bg: rgba(255, 255, 255, 0.08);
  --grid-line: rgba(255, 255, 255, 0.035);
  --field-bg: #0c141b;
  --field-text: #edf7f6;
  --field-option-bg: #121f28;
  --field-option-text: #edf7f6;
  --result-bg: rgba(0, 0, 0, 0.22);
  --accent: #37f2a0;
  --accent-2: #ffcc4d;
  --accent-3: #ff5f7e;
  --blue: #55b7ff;
  --button-primary: #37f2a0;
  --button-primary-text: #07100d;
  --button-secondary: rgba(255, 255, 255, 0.07);
  --button-secondary-text: var(--text);
  --button-warm: #ffcc4d;
  --button-warm-text: #15130d;
  --header-bg: #121a22;
  --header-nav-bg: #18212a;
  --header-text: #edf7f6;
  --header-shadow: 0 18px 46px rgba(0, 0, 0, 0.22);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f7fafc;
  --bg-deep: #e7eef4;
  --panel: #ffffff;
  --panel-strong: #eaf2f7;
  --text: #111820;
  --muted: #314856;
  --line: rgba(20, 35, 48, 0.26);
  --card-bg: rgba(255, 255, 255, 0.86);
  --nav-hover-bg: rgba(0, 122, 83, 0.1);
  --grid-line: rgba(20, 35, 48, 0.045);
  --field-bg: #ffffff;
  --field-text: #121a20;
  --field-option-bg: #ffffff;
  --field-option-text: #121a20;
  --result-bg: rgba(16, 24, 32, 0.06);
  --accent: #007a53;
  --accent-2: #9a5f00;
  --accent-3: #c13f5b;
  --blue: #006ebf;
  --button-primary: #0f8f68;
  --button-primary-text: #ffffff;
  --button-secondary: #e9f1f6;
  --button-secondary-text: #15222b;
  --button-warm: #f0b23f;
  --button-warm-text: #19130a;
  --header-bg: #f8fbfd;
  --header-nav-bg: #ffffff;
  --header-text: #121a20;
  --header-shadow: 0 14px 36px rgba(18, 42, 58, 0.18);
  --shadow: 0 14px 34px rgba(18, 42, 58, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  font-size: 15px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 8%, rgba(85, 183, 255, 0.18), transparent 32rem),
    radial-gradient(circle at 88% 14%, rgba(55, 242, 160, 0.12), transparent 28rem),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
  color: var(--text);
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  background: var(--accent-2);
  color: #141414;
  border-radius: var(--radius);
  font-weight: 800;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.65rem 1rem;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--header-bg);
  box-shadow: var(--header-shadow);
}

.brand,
.main-nav,
.theme-toggle {
  display: inline-flex;
  align-items: center;
}

.brand {
  gap: 0.65rem;
  color: var(--header-text);
  font-weight: 900;
  text-decoration: none;
  letter-spacing: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, transparent 45%, rgba(0, 0, 0, 0.28) 46%),
    linear-gradient(135deg, var(--accent), var(--blue));
  box-shadow: 0 0 24px rgba(55, 242, 160, 0.36);
}

.main-nav {
  gap: 0.35rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--header-nav-bg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.main-nav a {
  min-width: 70px;
  padding: 0.48rem 0.72rem;
  border-radius: 999px;
  color: var(--muted);
  text-align: center;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 800;
}

.main-nav a:hover {
  color: var(--text);
  background: var(--nav-hover-bg);
}

.theme-toggle {
  min-height: 38px;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field-bg);
  color: var(--field-text);
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  font-weight: 900;
}

.hero,
.daily-strip,
.tool-band,
.blog-section,
.share-section,
.coffee-section,
.site-footer {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.45rem 1rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 1.35rem;
  align-items: center;
  min-height: 540px;
  padding-top: 1.2rem;
  padding-bottom: 2rem;
}

.hero-copy {
  order: -1;
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 1rem;
  max-width: 680px;
  font-size: clamp(2.35rem, 4.2vw, 4.6rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0.8rem;
  font-size: clamp(1.75rem, 3.15vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 1.15rem;
}

.hero-text {
  max-width: 680px;
  color: var(--muted);
  font-size: 1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.button,
.icon-button {
  min-height: 46px;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1rem;
}

.button-primary {
  background: var(--button-primary);
  color: var(--button-primary-text);
}

.button-secondary {
  border: 1px solid var(--line);
  background: var(--button-secondary);
  color: var(--button-secondary-text);
}

.hero-visual {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(85, 183, 255, 0.14), transparent),
    #0d151c;
  box-shadow: var(--shadow);
}

.radar-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(55, 242, 160, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(55, 242, 160, 0.11) 1px, transparent 1px);
  background-size: 34px 34px;
  transform: perspective(700px) rotateX(58deg) translateY(110px) scale(1.4);
  transform-origin: bottom;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(85, 183, 255, 0.28);
  border-radius: 50%;
}

.orbit-a {
  width: 300px;
  height: 300px;
  left: calc(50% - 150px);
  top: 46px;
}

.orbit-b {
  width: 184px;
  height: 184px;
  left: calc(50% - 92px);
  top: 105px;
  border-color: rgba(255, 204, 77, 0.28);
}

.hud-panel {
  position: absolute;
  min-width: 120px;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 24, 32, 0.82);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.26);
}

.hud-panel span,
.result-grid span,
.mini-result span,
.daily-grid span,
.party-result span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hud-panel strong {
  font-size: 1.55rem;
  color: var(--accent-2);
}

.hud-panel-a {
  left: 8%;
  top: 13%;
}

.hud-panel-b {
  right: 8%;
  bottom: 14%;
}

.hud-crosshair {
  position: absolute;
  left: 50%;
  top: 47%;
  width: 120px;
  height: 120px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.hud-crosshair::before,
.hud-crosshair::after,
.hud-crosshair span::before,
.hud-crosshair span::after {
  content: "";
  position: absolute;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(55, 242, 160, 0.72);
}

.hud-crosshair::before,
.hud-crosshair::after {
  left: calc(50% - 2px);
  width: 4px;
  height: 42px;
}

.hud-crosshair::before {
  top: 12px;
}

.hud-crosshair::after {
  bottom: 12px;
}

.hud-crosshair span::before,
.hud-crosshair span::after {
  top: calc(50% - 2px);
  width: 42px;
  height: 4px;
}

.hud-crosshair span::before {
  left: 12px;
}

.hud-crosshair span::after {
  right: 12px;
}

.daily-strip {
  display: grid;
  grid-template-columns: 0.55fr 1fr;
  gap: 0.9rem;
  align-items: stretch;
}

.daily-grid,
.result-grid,
.tool-grid,
.lab-layout {
  display: grid;
  gap: 0.85rem;
}

.daily-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.daily-grid article,
.tool-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.daily-grid article {
  padding: 0.8rem;
}

.daily-grid strong {
  display: block;
  margin-top: 0.45rem;
  font-size: 1.05rem;
}

.section-heading {
  max-width: 620px;
  margin-bottom: 0.9rem;
}

.tool-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
}

.tool-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tool-panel {
  padding: 0.85rem;
}

.tool-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: start;
  margin-bottom: 0.7rem;
}

.status-pill {
  flex: 0 0 auto;
  padding: 0.35rem 0.6rem;
  border: 1px solid rgba(55, 242, 160, 0.28);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
}

.control-grid,
.stacked-form {
  display: grid;
  gap: 0.6rem;
}

.control-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--field-text);
  padding: 0.55rem 0.65rem;
}

select option {
  background: var(--field-option-bg);
  color: var(--field-option-text);
}

textarea {
  resize: vertical;
}

input[type="color"] {
  padding: 0.25rem;
}

input[type="range"] {
  padding-inline: 0;
  accent-color: var(--accent);
}

.check-row {
  display: flex;
  align-items: center;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.form-actions {
  display: flex;
  align-items: end;
}

.tool-button {
  min-height: 38px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--button-secondary);
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

.copy-button,
.share-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
}

.copy-button {
  width: 100%;
  margin-top: 1rem;
  background: var(--button-primary);
  color: var(--button-primary-text);
}

.result-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 1rem;
}

.result-grid div,
.mini-result,
.party-result div {
  padding: 0.85rem;
  border-radius: var(--radius);
  background: var(--result-bg);
}

.result-grid strong,
.mini-result strong {
  display: block;
  margin-top: 0.35rem;
  font-size: clamp(1.25rem, 2.1vw, 1.7rem);
  line-height: 1;
  color: var(--accent-2);
}

.mini-result {
  margin-top: 1rem;
}

.lab-layout {
  grid-template-columns: minmax(0, 1fr) 360px;
}

.crosshair-stage {
  min-height: 500px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101820;
  box-shadow: var(--shadow);
}

.preview-map {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 500px;
  background:
    linear-gradient(115deg, rgba(85, 183, 255, 0.15), transparent 44%),
    linear-gradient(25deg, transparent 58%, rgba(255, 95, 126, 0.11)),
    linear-gradient(180deg, #15232c 0 48%, #263640 48% 100%);
}

.preview-map::before {
  content: "";
  position: absolute;
  inset: 48% -10% -20%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 54px 54px;
  transform: perspective(800px) rotateX(62deg);
  transform-origin: top;
}

.target {
  position: absolute;
  width: 62px;
  height: 62px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(255, 95, 126, 0.16);
}

.target-a {
  left: 18%;
  top: 26%;
}

.target-b {
  right: 18%;
  top: 34%;
}

.target-c {
  left: 54%;
  bottom: 22%;
}

.crosshair-preview {
  --crosshair-color: #37f2a0;
  --crosshair-length: 14px;
  --crosshair-gap: 7px;
  --crosshair-thickness: 3px;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1px;
  height: 1px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 5px var(--crosshair-color));
}

.ch-line,
.ch-dot {
  position: absolute;
  display: block;
  background: var(--crosshair-color);
}

.ch-top,
.ch-bottom {
  left: calc(var(--crosshair-thickness) / -2);
  width: var(--crosshair-thickness);
  height: var(--crosshair-length);
}

.ch-top {
  bottom: var(--crosshair-gap);
}

.ch-bottom {
  top: var(--crosshair-gap);
}

.ch-left,
.ch-right {
  top: calc(var(--crosshair-thickness) / -2);
  width: var(--crosshair-length);
  height: var(--crosshair-thickness);
}

.ch-left {
  right: var(--crosshair-gap);
}

.ch-right {
  left: var(--crosshair-gap);
}

.ch-dot {
  left: -3px;
  top: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.crosshair-preview.no-dot .ch-dot {
  display: none;
}

.copy-output {
  display: block;
  margin-top: 1rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  word-break: break-word;
}

.icon-button {
  padding: 0.48rem 0.75rem;
  background: var(--button-warm);
  color: var(--button-warm-text);
}

.party-result,
.name-result {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}

.name-result {
  margin-top: 0;
}

.name-result div {
  padding: 0.85rem;
  border-radius: var(--radius);
  background: var(--result-bg);
}

.party-result strong,
.name-result strong {
  display: block;
  color: var(--accent-2);
}

.blog-section,
.share-section,
.coffee-section,
.site-footer {
  border-top: 1px solid var(--line);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.blog-grid article,
.share-section,
.coffee-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.blog-grid article {
  padding: 0.9rem;
}

.blog-grid span {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.blog-grid a,
.footer-grid a {
  color: var(--blue);
  text-decoration: none;
}

.blog-grid p,
.coffee-section p,
.site-footer p {
  color: var(--muted);
}

.share-section,
.coffee-section {
  margin-top: 1.4rem;
  margin-bottom: 1.4rem;
}

.share-section h2,
.coffee-section h2 {
  font-size: clamp(1.6rem, 2.5vw, 2.45rem);
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.85rem;
  background: var(--button-secondary);
  color: var(--button-secondary-text);
}

.share-button:first-child {
  background: var(--button-primary);
  color: var(--button-primary-text);
}

.coffee-section {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr 1fr;
  gap: 2rem;
}

.footer-grid h2,
.footer-grid h3 {
  margin-bottom: 1rem;
}

.footer-grid a {
  display: block;
  margin-bottom: 0.6rem;
}

.footer-bottom {
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  margin-bottom: 0;
}

.site-footer {
  color: var(--muted);
  font-size: 0.92rem;
}

.article-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.45rem 1rem 4rem;
}

.article-page article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 4vw, 2rem);
}

.article-page h1 {
  font-size: clamp(2.2rem, 4vw, 3.8rem);
}

.article-page h2 {
  margin-top: 2rem;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.article-page p {
  color: var(--muted);
}

@media (max-width: 900px) {
  .main-nav {
    display: none;
  }

  .hero,
  .daily-strip,
  .tool-grid,
  .tool-grid.two-col,
  .lab-layout,
  .blog-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 1.6rem;
  }

  .hero-copy {
    order: 0;
  }

  .hero-visual {
    min-height: 300px;
  }

  .control-grid,
  .result-grid,
  .daily-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .coffee-section {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .hero,
  .daily-strip,
  .tool-band,
  .blog-section,
  .share-section,
  .coffee-section,
  .site-footer {
    padding-inline: 0.85rem;
  }

  h1 {
    font-size: 2.35rem;
  }

  .control-grid,
  .result-grid,
  .daily-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions .button {
    width: 100%;
  }

  .share-button,
  .coffee-section .button {
    width: 100%;
  }

  .hud-panel {
    min-width: 120px;
  }
}
