/* ORACLE 9 — home (mockup) + ask page */

:root {
  --red: #c00000;
  --black: #000000;
  --white: #ffffff;
  --muted: #333333;
  --tile-radius: 16px;
  --border: 5px solid var(--red);
  --max: 960px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  color: var(--black);
  background: var(--white);
  line-height: 1.45;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  padding: 0.6rem 1rem;
  background: var(--white);
  border: var(--border);
  border-radius: 8px;
  color: var(--black);
  transform: translateY(-200%);
  transition: transform 0.2s ease;
  z-index: 100;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

a {
  color: var(--red);
}

a:hover {
  text-decoration: underline;
}

/* ——— Home ——— */
.page-home {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.home-header {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 1.25rem;
  text-align: center;
}

.home-title {
  margin: 0;
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-prompt {
  margin: 2rem 0 0;
  text-align: left;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 400;
}

.home-main {
  flex: 1;
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: 0 0 2.5rem;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.topic-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  padding: 1rem 0.5rem;
  background: var(--white);
  border: var(--border);
  border-radius: var(--tile-radius);
  color: var(--black);
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

.topic-tile:hover {
  background: #fff5f5;
  transform: translateY(-2px);
}

.topic-tile:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.topic-han {
  font-size: clamp(2.5rem, 6vw, 3.25rem);
  font-weight: 600;
  line-height: 1.1;
}

.topic-en {
  margin-top: 0.5rem;
  font-size: clamp(0.75rem, 2vw, 0.95rem);
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
  max-width: 11ch;
}

.home-footer {
  width: min(var(--max), calc(100% - 2rem));
  margin: auto auto 0;
  padding: 1.5rem 0 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.home-footer p {
  margin: 0;
}

@media (max-width: 720px) {
  .topic-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .topic-tile {
    min-height: 120px;
  }

  .topic-en {
    max-width: 14ch;
  }
}

/* ——— Ask ——— */
.page-ask {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.ask-header {
  width: min(720px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 1rem;
  text-align: center;
}

.ask-brand {
  display: inline-block;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--black);
  text-decoration: none;
}

.ask-brand:hover {
  text-decoration: none;
  opacity: 0.85;
}

.ask-topic-line {
  margin: 1rem 0 0;
  font-size: 1.1rem;
}

.ask-topic-label {
  font-weight: 600;
}

.ask-topic-value {
  font-weight: 500;
}

.ask-no-topic {
  margin: 1rem 0 0;
  color: var(--muted);
}

.ask-main {
  flex: 1;
  width: min(720px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0 0 2rem;
}

.ask-form {
  border: var(--border);
  border-radius: var(--tile-radius);
  padding: 1.25rem 1.25rem 1.5rem;
  background: var(--white);
}

.ask-form[data-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

.ask-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.ask-field {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
}

.ask-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
  margin-bottom: 1.1rem;
}

.ask-field-row .ask-field {
  margin-bottom: 0;
}

.ask-field span:first-child {
  font-size: 0.95rem;
  font-weight: 600;
}

.ask-field-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
}

.ask-field input,
.ask-field textarea,
.ask-field select {
  width: 100%;
  padding: 0.75rem 0.85rem;
  font: inherit;
  color: var(--black);
  border: 2px solid #ccc;
  border-radius: 10px;
  background: var(--white);
}

.ask-field select {
  cursor: pointer;
  appearance: auto;
}

.ask-field input:focus,
.ask-field textarea:focus,
.ask-field select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(192, 0, 0, 0.15);
}

@media (max-width: 540px) {
  .ask-field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .ask-field-row .ask-field:first-child {
    margin-bottom: 1.1rem;
  }
}

.ask-counter {
  display: block;
  text-align: right;
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.ask-counter[data-state="max"] {
  color: #b45309;
}

.ask-counter[data-state="over"] {
  color: #b91c1c;
}

.ask-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.25rem;
}

.ask-btn {
  font: inherit;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  color: var(--white);
  background: var(--red);
  border: 2px solid var(--red);
  border-radius: 10px;
  cursor: pointer;
}

.ask-btn:hover {
  filter: brightness(1.05);
}

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

.ask-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  filter: none;
}

.ask-hint {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 18rem;
}

.ask-back {
  margin: 1.5rem 0 0;
  text-align: center;
}

.ask-back a {
  font-weight: 600;
  color: var(--black);
  text-decoration: none;
  border-bottom: 2px solid var(--red);
}

.ask-back a:hover {
  color: var(--red);
}
