@font-face {
  font-family: "Oxanium";
  src: url("assets/fonts/oxanium-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
}

@font-face {
  font-family: "Cormorant Garamond";
  src: url("assets/fonts/cormorant-garamond-italic-latin.woff2") format("woff2");
  font-style: italic;
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #120608;
  --panel: #211013;
  --panel-border: #583239;
  --text: #fff4dc;
  --muted: #c0adb0;
  --gold: #e9bd67;
  --aqua: #68d8c4;
  --oracle-blue: #2f7cff;
  --crimson: #c63f54;
  --ember: #db7955;
  --danger: #ff9178;
  --focus: #82ead6;
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

::selection {
  color: #22150a;
  background: var(--gold);
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  max-width: 100%;
  overflow-x: clip;
  background: var(--bg);
}

body {
  position: relative;
  min-height: 100svh;
  margin: 0;
  max-width: 100%;
  overflow-x: clip;
  color: var(--text);
  background:
    radial-gradient(ellipse at 76% 18%, rgb(135 20 43 / 26%), transparent 33rem),
    radial-gradient(ellipse at 8% 76%, rgb(83 10 26 / 20%), transparent 28rem),
    radial-gradient(circle at 48% 118%, rgb(188 111 42 / 8%), transparent 36rem),
    linear-gradient(125deg, #080405 0, var(--bg) 46%, #0b0507 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: 0.48;
  background-image:
    radial-gradient(circle, rgb(233 189 103 / 50%) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgb(233 189 103 / 30%) 0 0.8px, transparent 1.2px),
    radial-gradient(circle, rgb(255 233 177 / 42%) 0 1px, transparent 1.5px);
  background-position: 0 0, 19px 27px, 43px 11px;
  background-size: 67px 67px, 97px 97px, 139px 139px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

body::after {
  content: "";
  position: fixed;
  z-index: -1;
  width: min(76vw, 980px);
  aspect-ratio: 1;
  top: -35vw;
  right: -21vw;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0.34;
  background: repeating-radial-gradient(
    circle,
    transparent 0 48px,
    rgb(233 189 103 / 18%) 49px,
    transparent 50px 74px
  );
  mask-image: radial-gradient(circle, black, transparent 68%);
}

button,
textarea {
  font: inherit;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  min-height: 100svh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.site-header,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-header {
  padding: 26px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: "Oxanium", ui-monospace, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-decoration: none;
}

.brand-mark {
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.brand:hover .brand-mark {
  border-color: var(--gold);
  box-shadow: inset 5px 7px 12px rgb(255 255 255 / 7%), 0 0 18px rgb(243 199 111 / 28%);
  transform: rotate(-8deg);
}

.brand:focus-visible {
  border-radius: 6px;
  outline: 3px solid var(--focus);
  outline-offset: 5px;
}

.brand-mark {
  width: 34px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid #673b43;
  border-radius: 50%;
  color: var(--gold);
  background: #08050c;
  font-family: Georgia, serif;
  font-size: 1.1rem;
  letter-spacing: 0;
  box-shadow: inset 5px 7px 12px rgb(255 255 255 / 7%);
}

.brand-mark::before {
  content: "8";
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--oracle-blue);
  box-shadow: 0 0 12px var(--oracle-blue);
}

main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  align-items: center;
  gap: clamp(40px, 7vw, 100px);
  padding: 36px 0 60px;
}

.intro {
  max-width: 590px;
}

.eyebrow {
  margin: 0 0 17px;
  color: var(--gold);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

h1 {
  margin: 0;
  font-family: "Oxanium", ui-monospace, monospace;
  font-weight: 700;
  font-size: clamp(3rem, 6.5vw, 5.9rem);
  line-height: 0.94;
  letter-spacing: -0.055em;
}

h1 em {
  color: transparent;
  background: linear-gradient(105deg, #df6678 4%, #c54155 44%, #e9bd67 96%);
  background-clip: text;
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.045em;
}

.lede {
  max-width: 560px;
  margin: 28px 0 30px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.65;
}

.prompt-starters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -11px 0 22px;
}

.prompt-starters > span {
  flex: 0 0 auto;
  color: #7f899b;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.prompt-starters > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.prompt-chip {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #5f3a40;
  border-radius: 999px;
  color: #dfcdd0;
  background: rgb(39 14 20 / 78%);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.prompt-chip:hover {
  color: var(--text);
  border-color: #a15a66;
  background: #3b1720;
  transform: translateY(-1px);
}

.prompt-chip:focus-visible,
.copy-button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

form {
  position: relative;
  padding: 20px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background:
    linear-gradient(150deg, rgb(43 20 25 / 96%), rgb(18 8 11 / 94%));
  box-shadow: 0 22px 60px rgb(0 0 0 / 26%);
  backdrop-filter: blur(12px);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

form::before {
  content: "";
  position: absolute;
  top: -1px;
  right: 24px;
  left: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--crimson), var(--gold), transparent);
}

form:focus-within {
  border-color: #74424b;
  box-shadow: 0 24px 68px rgb(0 0 0 / 34%), 0 0 38px rgb(198 63 84 / 10%);
}

label {
  display: block;
  margin: 0 0 10px;
  font-size: 0.9rem;
  font-weight: 750;
}

textarea {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  padding: 15px 16px;
  border: 1px solid #5b353c;
  border-radius: 14px;
  outline: 0;
  color: var(--text);
  background: #100609;
  line-height: 1.5;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea::placeholder {
  color: #8c7479;
}

textarea:hover {
  border-color: #81505a;
}

textarea:focus-visible {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgb(117 232 255 / 22%);
}

textarea[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgb(255 141 154 / 16%);
}

.field-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 3px 0;
  color: #7f899b;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.7rem;
}

.error {
  min-height: 1.25rem;
  margin: 4px 3px 6px;
  color: var(--danger);
  font-size: 0.8rem;
}

.ask-button {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  color: #241709;
  background: linear-gradient(110deg, #f0b95f, #ffe29b 54%, #d7a95b);
  font-weight: 900;
  font-family: "Oxanium", ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 10px 28px rgb(243 199 111 / 16%);
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.ask-button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: linear-gradient(110deg, #f6ca7c, #ffebba 54%, #e7bd75);
  box-shadow: 0 14px 34px rgb(243 199 111 / 25%);
}

.ask-button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.ask-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.button-icon {
  font-size: 1.2rem;
  transition: transform 150ms ease;
}

.ask-button:hover:not(:disabled) .button-icon {
  transform: translate(2px, -2px);
}

.oracle {
  position: relative;
  min-width: 0;
  display: grid;
  justify-items: center;
  padding-top: 26px;
  isolation: isolate;
}

.oracle-meta {
  position: absolute;
  top: -8px;
  width: min(86%, 390px);
  display: flex;
  justify-content: space-between;
  color: #9c7f84;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.oracle-visual {
  position: relative;
  width: min(100%, 580px);
  aspect-ratio: 1;
  isolation: isolate;
}

.oracle-art {
  width: 116%;
  height: 116%;
  margin: -8%;
  display: block;
  object-fit: cover;
  filter: drop-shadow(0 30px 48px rgb(0 0 0 / 38%));
  mask-image: radial-gradient(ellipse 70% 72% at 50% 50%, black 42%, rgb(0 0 0 / 92%) 60%, transparent 82%);
}

.answer-output {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.answer-text {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22%;
  height: auto;
  transform: translateX(-50%);
  display: block;
  color: white;
  font-family: "Oxanium", ui-monospace, monospace;
  font-size: clamp(0.75rem, 1.2vw, 1.1rem);
  line-height: 1.02;
  text-align: center;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  text-shadow: 0 1px 8px #020713;
  overflow: visible;
}

.answer-line {
  display: block;
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
  white-space: nowrap;
}

.oracle-readout {
  position: absolute;
  bottom: 2.5%;
  left: 50%;
  max-width: 92%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgb(233 189 103 / 18%);
  border-radius: 999px;
  color: #d7c6b0;
  background: rgb(8 4 6 / 72%);
  backdrop-filter: blur(8px);
  white-space: nowrap;
}

.answer-label,
.confidence {
  font-family: ui-monospace, "Cascadia Code", monospace;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.answer-label {
  color: #fff0c7;
  font-size: clamp(0.42rem, 0.62vw, 0.52rem);
  font-weight: 800;
}

.confidence {
  color: #ead7ec;
  font-size: clamp(0.4rem, 0.58vw, 0.49rem);
  line-height: 1.3;
}

.oracle-visual.thinking {
  animation: think 700ms ease-in-out infinite alternate;
}

.oracle-visual.revealed .answer-output {
  animation: reveal 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.recent-question {
  max-width: 440px;
  margin: 22px 18px 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: center;
}

.copy-button {
  min-height: 36px;
  margin-top: 12px;
  padding: 7px 13px;
  border: 1px solid #5f3a40;
  border-radius: 999px;
  color: #d8c6c9;
  background: #18090c;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.copy-button:hover {
  color: var(--text);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

footer {
  padding: 22px 0 28px;
  border-top: 1px solid #49262e;
  color: #9b8287;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
}

footer p {
  margin: 0;
}

@keyframes think {
  from { transform: rotate(-1deg) scale(0.99); }
  to { transform: rotate(1deg) scale(1.01); }
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 860px) {
  .page-shell {
    width: min(680px, calc(100% - 32px));
  }

  main {
    grid-template-columns: 1fr;
    gap: 58px;
    padding-top: 52px;
  }

  .intro {
    max-width: none;
  }

  .oracle {
    padding: 30px 0 24px;
  }
}

@media (max-width: 520px) {
  .page-shell {
    width: min(100% - 24px, 460px);
  }

  .site-header {
    padding: 18px 0;
  }

  .status {
    font-size: 0;
  }

  .status::after {
    content: "Online";
    font-size: 0.7rem;
  }

  main {
    padding: 38px 0 48px;
  }

  h1 {
    font-size: clamp(2.85rem, 15vw, 4.4rem);
  }

  form {
    padding: 15px;
  }

  .prompt-starters {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .oracle-visual {
    width: min(94vw, 390px);
  }

  .oracle-readout {
    gap: 5px;
    padding: 6px 8px;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

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