@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap");

:root {
  --deep-ink: #111b23;
  --charcoal: #20262a;
  --graphite: #5b6063;
  --soft-gray: #d9d8d3;
  --warm-cream: #f7f3ea;
  --sand-bone: #eee7da;
  --course-green: #0f4b28;
  --turf-olive: #59633e;
  --screen-blue: #c8dce5;
  --cardinal-red: #b3262e;
  --line: rgba(247, 243, 234, 0.16);
  color-scheme: dark;
  font-family: "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--warm-cream);
  background: var(--deep-ink);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--deep-ink);
  -webkit-font-smoothing: antialiased;
}
button {
  font: inherit;
  -webkit-tap-highlight-color: rgba(247, 243, 234, 0.12);
  touch-action: manipulation;
}

#viewport {
  position: relative;
  min-height: 100vh;
  overflow: visible;
  display: flex;
  justify-content: center;
  background: var(--deep-ink);
}

.app-screen {
  position: relative;
  display: grid;
  grid-template-rows: 1fr 88px;
  width: min(1144px, 100vw);
  aspect-ratio: 1144 / 849;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(247, 243, 234, 0.12);
  border-radius: 22px;
  background: var(--deep-ink);
  isolation: isolate;
}

.screen-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 66% 18%, rgba(247, 243, 234, 0.075), transparent 18rem),
    radial-gradient(circle at 18% 0%, rgba(15, 75, 40, 0.18), transparent 30rem),
    linear-gradient(90deg, rgba(5, 7, 7, 0.98), rgba(17, 27, 35, 0.96) 54%, rgba(6, 10, 10, 0.98)),
    var(--deep-ink);
}

.view {
  display: none;
  min-height: 0;
  padding: 0 44px;
}
.state-idle .view-idle,
.state-welcome .view-welcome,
.state-message .view-message,
.state-recommendation .view-detail,
.state-end .view-end { display: block; }

.mono-label,
.app-footer,
.detail-meta,
.shuffle-action,
.back-action,
.status-pill {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0;
}

.mono-label {
  margin: 0 0 10px;
  color: rgba(247, 243, 234, 0.62);
  font-size: 12px;
  line-height: 1.25;
  text-transform: uppercase;
}

.center-stage {
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(920px, calc(100% - 120px));
  max-width: 640px;
  transform: translate(-50%, -50%);
  text-align: center;
}
.welcome-stage {
  display: grid;
  justify-items: center;
}

h1, h2, p { margin-top: 0; }
.welcome-stage h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 168px;
  margin-bottom: 18px;
  font-size: clamp(100px, 11.4vw, 160px);
  line-height: 0.9;
  font-weight: 500;
  letter-spacing: 0;
}
.quiet-thesis {
  max-width: 760px;
  min-height: auto !important;
  font-size: clamp(40px, 5vw, 68px) !important;
  line-height: 1.02 !important;
}
.idle-stage {
  top: 44%;
  max-width: 880px;
}
.idle-stage .hairline {
  margin: 20px auto 22px;
}
.idle-stage .reservation-window {
  font-size: clamp(17px, 1.8vw, 24px);
  line-height: 1.25;
}
.idle-stage .welcome-prompts {
  margin-top: 48px;
}
.custom-message-heading,
.end-message-heading {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(30px, 3.6vw, 42px) !important;
  line-height: 1.12 !important;
  font-weight: 500;
}
.end-message-heading { max-width: 820px; }
.reservation-window {
  margin: 0;
  color: rgba(247, 243, 234, 0.7);
  font-size: clamp(30px, 3.2vw, 46px);
  line-height: 1.05;
}
.hairline {
  width: 44px;
  height: 1px;
  margin: 25px auto 30px;
  background: rgba(247, 243, 234, 0.22);
}

.center-stage p,
.detail-main p,
.instruction-panel p {
  color: rgba(247, 243, 234, 0.76);
  font-size: 19px;
  line-height: 1.44;
}

.center-stage p {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.welcome-prompts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 74px auto 0;
  width: min(900px, 100%);
  border: 1px solid rgba(247, 243, 234, 0.13);
  border-radius: 8px;
  background: transparent;
  overflow: hidden;
}
.welcome-prompts button {
  min-height: 124px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--warm-cream);
  padding: 28px 30px;
  text-align: left;
  cursor: pointer;
}
.welcome-prompts button + button { border-left: 1px solid rgba(247, 243, 234, 0.11); }
.welcome-prompts span,
.welcome-prompts small { display: block; }
.welcome-prompts span {
  margin-bottom: 8px;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.1;
}
.welcome-prompts small {
  color: rgba(247, 243, 234, 0.58);
  font-size: 14px;
  line-height: 1.3;
}
.welcome-prompts button:active,
.welcome-prompts button:focus-visible {
  background: rgba(247, 243, 234, 0.1);
}
.welcome-prompts button:focus-visible,
.back-action:focus-visible,
.shuffle-action:focus-visible {
  outline: 2px solid rgba(247, 243, 234, 0.36);
  outline-offset: 3px;
}

.view-detail {
  position: relative;
  height: 100%;
  padding-top: 96px;
}
.back-action {
  position: absolute;
  top: 24px;
  left: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  background: transparent;
  padding: 10px 8px 10px 0;
  color: rgba(247, 243, 234, 0.82);
  font-size: 13px;
  text-transform: uppercase;
  cursor: pointer;
}
.back-action span {
  display: inline-block;
  font-size: 26px;
  line-height: 0;
  transform: translateY(-1px);
}
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(500px, 1fr);
  gap: 52px;
  height: 100%;
}
.detail-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 570px;
  padding-top: 16px;
}
.detail-main h1 {
  max-width: 760px;
  margin: 12px 0 0;
  font-size: clamp(48px, 5.5vw, 76px);
  line-height: 1.0;
  font-weight: 500;
  letter-spacing: 0;
}
.detail-main p:not(.mono-label),
.instruction-panel p {
  max-width: 720px;
  color: rgba(247, 243, 234, 0.76);
  font-size: 19px;
  line-height: 1.44;
}
.detail-main p[hidden] { display: none; }
#detailSummary {
  margin: 24px 0 0;
  max-width: 620px;
  color: rgba(247, 243, 234, 0.72);
  font-size: 19px;
  line-height: 1.42;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 42px;
  color: rgba(247, 243, 234, 0.72);
  font-size: 14px;
  line-height: 1.35;
  text-transform: uppercase;
}
.detail-meta span {
  border: 0;
  border-radius: 0;
  padding: 0;
  color: inherit;
  background: transparent;
}
.detail-meta span + span::before {
  content: "·";
  display: inline-block;
  padding: 0 13px;
  color: rgba(247, 243, 234, 0.36);
}
.quiet-action {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  margin-top: 52px;
  border: 1px solid rgba(247, 243, 234, 0.2);
  border-radius: 8px;
  background: rgba(247, 243, 234, 0.06);
  color: rgba(247, 243, 234, 0.76);
  padding: 13px 18px;
  font-size: 12px;
  text-transform: uppercase;
  cursor: pointer;
}
.quiet-action span { font-size: 17px; line-height: 1; }
.quiet-action:active,
.quiet-action:focus-visible { background: rgba(247, 243, 234, 0.1); }
.instruction-panel {
  display: grid;
  align-content: start;
  gap: 0;
  border-left: 1px solid rgba(247, 243, 234, 0.16);
  background: transparent;
  padding: 12px 0 18px 44px;
}
.numbered-step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 24px;
  padding: 24px 0;
}
.numbered-step:first-child { padding-top: 0; }
.numbered-step + .numbered-step { position: relative; }
.numbered-step + .numbered-step::before {
  content: "";
  position: absolute;
  top: 0;
  left: 64px;
  width: min(340px, calc(100% - 64px));
  height: 1px;
  background: rgba(247, 243, 234, 0.12);
}
.numbered-step > span {
  color: rgba(247, 243, 234, 0.42);
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
}
.numbered-step h3 {
  margin: 0 0 5px;
  color: rgba(247, 243, 234, 0.9);
  font-size: 25px;
  font-weight: 500;
  line-height: 1.04;
}
.step-meta {
  margin: 0 0 10px !important;
  color: rgba(247, 243, 234, 0.52) !important;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px !important;
  line-height: 1.25 !important;
  letter-spacing: 0;
  text-transform: uppercase;
}
.numbered-step p {
  margin-bottom: 0;
  color: rgba(247, 243, 234, 0.68);
  font-size: 16px;
  line-height: 1.42;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 44px;
  color: rgba(247, 243, 234, 0.5);
  font-size: 11px;
  text-transform: uppercase;
}
.stu-logo {
  display: block;
  width: 68px;
  height: auto;
  object-fit: contain;
  opacity: 0.5;
}
.status-pill {
  display: none;
  position: absolute;
  top: 24px;
  right: 44px;
  border: 1px solid rgba(247, 243, 234, 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
  color: rgba(247, 243, 234, 0.62);
  padding: 8px 11px;
  font-size: 11px;
  text-transform: uppercase;
}
.debug-mode .status-pill { display: block; }

@media (orientation: landscape) and (min-width: 900px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  #viewport {
    width: 100vw;
    height: 100svh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .app-screen {
    grid-template-rows: 1fr 112px;
    width: 100vw;
    height: 100svh;
    height: 100dvh;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
  }

  .app-footer {
    padding: 20px 44px 46px;
  }
}

@media (max-width: 920px) {
  .app-screen { min-width: 0; min-height: 0; }
  .view { padding: 24px; }
  .center-stage { width: min(100% - 48px, 680px); }
  .detail-layout,
  .welcome-prompts { grid-template-columns: 1fr; }
  .welcome-prompts button + button { border-left: 0; border-top: 1px solid rgba(247, 243, 234, 0.11); }
  .welcome-stage h1 { font-size: 82px; }
  .detail-main h1 { font-size: 40px; }
}
