:root {
  color-scheme: light dark;
  --bg: #f3ead9;
  --surface: #fff7e8;
  --surface-strong: #ead8bd;
  --text: #201c18;
  --muted: #695e50;
  --line: #cfb995;
  --accent: #b8552c;
  --accent-strong: #81391f;
  --safe: #297b42;
  --warn: #b38321;
  --shadow: rgb(73 45 24 / 0.16);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171512;
    --surface: #211f1a;
    --surface-strong: #302a21;
    --text: #f1e7d3;
    --muted: #b6a58b;
    --line: #4b3d2d;
    --accent: #d27439;
    --accent-strong: #f2a25a;
    --safe: #62d66e;
    --warn: #d6a84f;
    --shadow: rgb(0 0 0 / 0.34);
  }
}

* { box-sizing: border-box; }

html {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 18% 8%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 34rem),
    radial-gradient(circle at 88% 18%, color-mix(in srgb, var(--safe) 16%, transparent), transparent 30rem),
    var(--bg);
}

a { color: inherit; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 68px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.8rem clamp(1rem, 3vw, 2rem);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border-radius: 0.85rem;
  background: var(--accent);
  color: #171512;
  box-shadow: 0 10px 30px var(--shadow);
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  min-width: 0;
}

.main-nav a,
.header-cta,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  border-radius: 999px;
  padding: 0 1rem;
  text-decoration: none;
  font-weight: 750;
  border: 1px solid transparent;
  white-space: nowrap;
}

.main-nav a {
  color: var(--muted);
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

.header-cta,
.button.primary {
  background: var(--accent);
  color: #171512;
  box-shadow: 0 12px 34px var(--shadow);
}

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

.button:active,
.header-cta:active {
  transform: translateY(1px);
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2rem) 4rem;
}

.hero {
  min-height: min(760px, calc(100dvh - 68px));
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding: clamp(2rem, 5vw, 4.5rem) 0 2rem;
}

.hero-copy,
.page-hero {
  max-width: 720px;
}

.kicker,
.breadcrumb,
.meta-row,
.status-strip,
.tool-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.kicker {
  margin: 0 0 1rem;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2.55rem, 6vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.page-hero h1 {
  font-size: clamp(2.2rem, 4.5vw, 4.2rem);
}

h2 {
  margin: 0 0 0.8rem;
  font-size: clamp(1.55rem, 2.4vw, 2.2rem);
  line-height: 1.08;
  letter-spacing: 0;
}

p {
  line-height: 1.65;
}

.hero-copy > p:not(.kicker),
.page-hero > p {
  max-width: 62ch;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
}

.hero-actions,
.timer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.hero-visual {
  margin: 0;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 30px 80px var(--shadow);
}

.hero-visual img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.status-strip,
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 0;
}

.status-strip {
  justify-content: center;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
}

.status-strip span,
.meta-row span {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.page-hero {
  padding: clamp(2rem, 5vw, 4.5rem) 0 2rem;
}

.breadcrumb a {
  color: var(--accent-strong);
  font-weight: 800;
}

.quick-answer,
.planner-panel,
.tool-surface,
.content-block,
.faq-section,
.related-section {
  margin-top: 1.25rem;
  padding: clamp(1.1rem, 2.5vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 16px 42px var(--shadow);
}

.quick-answer {
  border-color: color-mix(in srgb, var(--safe) 44%, var(--line));
}

.tool-grid,
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.tool-tile,
.related-link {
  min-height: 12rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 1.2rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease;
}

.tool-tile:nth-child(2),
.related-link:nth-child(2) {
  background: color-mix(in srgb, var(--accent) 15%, var(--surface));
}

.tool-tile:nth-child(3),
.related-link:nth-child(3) {
  background: color-mix(in srgb, var(--safe) 12%, var(--surface));
}

.tool-tile:hover,
.related-link:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.tool-tile strong,
.related-link strong {
  font-size: 1.1rem;
}

.tool-tile span,
.related-link span {
  color: var(--muted);
  line-height: 1.55;
}

.planner-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(300px, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.raid-form,
.inline-tool {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  align-items: end;
}

.field {
  display: grid;
  gap: 0.38rem;
  color: var(--muted);
  font-weight: 750;
}

select,
input {
  width: 100%;
  min-height: 2.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 0 0.8rem;
  font: inherit;
}

select:focus,
input:focus {
  outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-color: var(--accent);
}

.tool-output {
  display: block;
  min-height: 4rem;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 0.9rem;
  border: 1px solid color-mix(in srgb, var(--safe) 42%, var(--line));
  background: color-mix(in srgb, var(--safe) 10%, var(--surface));
  color: var(--text);
  line-height: 1.55;
}

.content-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.content-block ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  padding: 0;
  margin: 1rem 0 0;
  list-style: none;
}

.content-block li {
  padding: 0.7rem;
  border-radius: 0.8rem;
  border: 1px solid var(--line);
  background: var(--surface);
}

.faq-section details {
  border-top: 1px solid var(--line);
  padding: 1rem 0;
}

.faq-section details:first-of-type {
  border-top: 0;
}

.faq-section summary {
  cursor: pointer;
  font-weight: 850;
}

.loot-table {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.loot-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr 0.7fr 1.5fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--surface);
}

.timer-face {
  width: min(100%, 18rem);
  margin: 1rem 0;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid color-mix(in srgb, var(--safe) 45%, var(--line));
  background: color-mix(in srgb, var(--safe) 10%, var(--surface));
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(2.6rem, 7vw, 4.8rem);
  font-weight: 850;
  text-align: center;
}

.site-footer {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  padding: 2rem clamp(1rem, 3vw, 2rem) 3rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer p {
  max-width: 72ch;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-content: start;
}

.site-footer a {
  color: var(--text);
  font-weight: 750;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  .hero,
  .planner-panel,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .tool-grid,
  .related-grid,
  .content-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .raid-form,
  .inline-tool {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .loot-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-header {
    position: static;
  }

  .brand span:last-child {
    display: none;
  }

  .tool-grid,
  .related-grid,
  .content-stack,
  .raid-form,
  .inline-tool,
  .content-block ul {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  h1 {
    font-size: clamp(2.25rem, 14vw, 3.3rem);
  }
}