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

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-top: 74px;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  color: #2d173f;
  background: #fffaf6;
}

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

[hidden] {
  display: none !important;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}


/* =========================================================
   FIXED HEADER
   ========================================================= */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
  background: rgba(255, 250, 246, 0.94);
  border-bottom: 1px solid rgba(57, 36, 71, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  color: #2d173f;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 132px;
  max-width: 132px;
  height: auto;
  object-fit: contain;
}

.brand-product {
  font-size: 0.95rem;
  font-weight: 800;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: 1.3rem;
  align-items: center;
  margin-left: auto;
}

.site-nav a {
  color: #352440;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: #7b3fe4;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.4rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid rgba(78, 48, 96, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
}

.language-switch button {
  min-width: 34px;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.language-switch button.is-active,
.language-switch button[aria-pressed="true"] {
  background: #f1e5ff;
}


/* =========================================================
   TYPOGRAPHY / ACCESSIBILITY
   ========================================================= */

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

h1,
h2,
h3 {
  color: #2d173f;
}

a {
  color: inherit;
}

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

button,
input,
summary,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(125, 67, 226, 0.26);
  outline-offset: 3px;
}


/* =========================================================
   WORDS PAGE
   ========================================================= */

.ai-words-page {
  background:
    radial-gradient(
      circle at 12% 12%,
      rgba(255, 236, 178, 0.34),
      transparent 30%
    ),
    radial-gradient(
      circle at 88% 18%,
      rgba(190, 145, 255, 0.18),
      transparent 34%
    ),
    #fffaf6;
}

.words-hero {
  padding: 4.5rem 0 4rem;
}

.words-hero-grid {
  display: grid;
  grid-template-columns:
    minmax(0, 0.92fr)
    minmax(460px, 1.08fr);
  gap: 3.5rem;
  align-items: center;
}

.words-hero-left h1 {
  max-width: 650px;
  margin: 1rem 0 1.25rem;
  font-size: clamp(3.4rem, 6vw, 6.4rem);
  line-height: 0.94;
  letter-spacing: -0.06em;
}

.hero-subtitle {
  max-width: 650px;
  font-size: 1.1rem;
  line-height: 1.75;
  color: #71677b;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0;
  color: #7651a5;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.words-hero-left > .eyebrow {
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(126, 79, 191, 0.2);
  background: rgba(245, 233, 255, 0.72);
}


/* =========================================================
   SEARCH
   ========================================================= */

.word-form {
  margin-top: 1.75rem;
}

.search-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.4rem;
  background: #fff;
  border: 1px solid rgba(81, 58, 104, 0.15);
  border-radius: 16px;
  box-shadow:
    0 16px 40px
    rgba(69, 43, 89, 0.07);
}

.search-row input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  padding: 0.85rem 1rem;
  font: inherit;
  background: transparent;
}

.button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0.8rem 1.2rem;
  border: 0;
  border-radius: 12px;
  background:
    linear-gradient(
      135deg,
      #8b45f7,
      #7035e8
    );
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    0 10px 22px
    rgba(124, 61, 237, 0.2);
}

.button-primary:disabled {
  cursor: wait;
  opacity: 0.82;
}

.search-reassurance {
  margin: 0.75rem 0 0;
  color: #807486;
  font-size: 0.9rem;
}

.search-reassurance::before {
  content: "✓";
  margin-right: 0.45rem;
  color: #28a66d;
  font-weight: 800;
}


/* =========================================================
   POPULAR TERMS
   ========================================================= */

.hero-term-list {
  margin-top: 1.75rem;
}

.term-list-label {
  margin: 0 0 0.75rem;
  color: #665a70;
  font-weight: 800;
}

.term-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.term-chip {
  border: 1px solid rgba(81, 58, 104, 0.15);
  background: rgba(255, 255, 255, 0.84);
  color: #392447;
  border-radius: 999px;
  padding: 0.6rem 0.85rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.term-chip:hover,
.term-chip:focus-visible {
  transform: translateY(-1px);
  border-color: #8552c9;
}

.term-chip.is-active {
  color: #fff;
  background: #7740d6;
  border-color: #7740d6;
}


/* =========================================================
   RIGHT-HAND HERO PANEL
   ========================================================= */

.words-hero-right {
  position: relative;
  min-width: 0;
}

.hero-visual,
.hero-result,
.hero-not-found {
  min-height: 465px;
  border-radius: 30px;
  border:
    1px solid
    rgba(142, 93, 193, 0.15);
  box-shadow:
    0 28px 70px
    rgba(87, 51, 109, 0.09);
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2rem;
  background:
    radial-gradient(
      circle at 18% 18%,
      rgba(255, 228, 137, 0.72),
      transparent 35%
    ),
    radial-gradient(
      circle at 80% 75%,
      rgba(211, 165, 255, 0.52),
      transparent 38%
    ),
    linear-gradient(
      145deg,
      #fffaf0,
      #f6ecff
    );
}

.conversation-card {
  width: min(100%, 420px);
  padding: 1.35rem;
  border-radius: 22px;
  background:
    rgba(255, 255, 255, 0.9);
  box-shadow:
    0 18px 50px
    rgba(84, 49, 112, 0.12);
  backdrop-filter: blur(10px);
}

.conversation-row {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.conversation-row p {
  margin: 0.25rem 0 0;
  color: #6e6475;
  line-height: 1.5;
}

.conversation-avatar,
.result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #fff4cf;
}

.ai-avatar {
  background: #efe1ff;
  color: #7c3fe5;
}

.conversation-divider {
  height: 1px;
  margin: 1rem 0;
  background:
    rgba(69, 47, 91, 0.08);
}

.coffee-note {
  position: absolute;
  left: 1.7rem;
  bottom: 1.6rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.9rem 1.15rem;
  border-radius: 18px;
  background:
    rgba(255, 255, 255, 0.94);
  box-shadow:
    0 12px 30px
    rgba(84, 49, 112, 0.11);
}

.coffee-note strong,
.coffee-note span {
  display: block;
}

.coffee-note span:last-child {
  margin-top: 0.15rem;
  color: #817587;
  font-size: 0.82rem;
}

.floating-term {
  position: absolute;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: #fff;
  color: #8053ae;
  font-weight: 800;
  font-size: 0.8rem;
  box-shadow:
    0 8px 20px
    rgba(78, 43, 102, 0.09);
}

.floating-term-a {
  top: 2rem;
  left: 2rem;
}

.floating-term-b {
  top: 3rem;
  right: 1.8rem;
}

.floating-term-c {
  right: 1.6rem;
  bottom: 3rem;
}


/* =========================================================
   RESULT PANEL
   ========================================================= */

.hero-result {
  padding: 2rem;
  background:
    rgba(255, 255, 255, 0.95);
}

.hero-result-header {
  padding-bottom: 1rem;
  border-bottom:
    1px solid
    rgba(69, 47, 91, 0.08);
}

.hero-result-header h2 {
  margin: 0.4rem 0 0;
  font-size:
    clamp(2.3rem, 4vw, 3.8rem);
  letter-spacing: -0.04em;
}

.hero-result-main {
  padding: 1.3rem 0;
}

.result-kicker {
  margin: 0 0 0.4rem;
  color: #7f56aa;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.result-main-copy {
  margin: 0;
  color: #51465a;
  font-size: 1.15rem;
  line-height: 1.7;
}

.hero-analogy {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 1.1rem;
  border-radius: 18px;
  background: #f4ecff;
}

.hero-analogy h3,
.hero-result-card h3 {
  margin: 0 0 0.35rem;
}

.hero-analogy p,
.hero-result-card p {
  margin: 0;
  color: #706477;
  line-height: 1.55;
}

.hero-result-grid {
  display: grid;
  grid-template-columns:
    1fr 1fr;
  gap: 0.8rem;
  margin-top: 0.9rem;
}

.hero-result-card {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 18px;
  border:
    1px solid
    rgba(69, 47, 91, 0.09);
  background: #fffdfa;
}

.technical-details {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top:
    1px solid
    rgba(69, 47, 91, 0.08);
}

.technical-details summary {
  cursor: pointer;
  color: #69428d;
  font-weight: 800;
}

.technical-details p {
  color: #6f6377;
  line-height: 1.6;
}


/* =========================================================
   NOT FOUND
   ========================================================= */

.hero-not-found {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 2rem;
  background:
    linear-gradient(
      135deg,
      #fff7dc,
      #f4ebff
    );
}

.not-found-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: #fff;
  font-size: 1.5rem;
}


/* =========================================================
   UNIVERSAL LOADING COMPONENT
   ========================================================= */

.dookun-spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  border:
    2px solid
    currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation:
    dookun-spin
    0.7s
    linear
    infinite;
}

.dookun-spinner-large {
  width: 2rem;
  height: 2rem;
  border-width: 3px;
}

@keyframes dookun-spin {
  to {
    transform: rotate(360deg);
  }
}

.dookun-loading-state {
  width: min(100%, 390px);
  margin: auto;
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  text-align: center;
  color: #5f4c6a;
}

.dookun-loading-state strong {
  font-size: 1.05rem;
  color: #3b234a;
}

.dookun-loading-state
> span:last-child {
  color: #817587;
  font-size: 0.9rem;
}

.hero-visual.is-loading {
  cursor: progress;
}


/* =========================================================
   LEARNINGAI BRIDGE
   ========================================================= */

.learn-more-section {
  padding: 1rem 0 4rem;
}

.learn-more-card {
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 2.2rem;
  border-radius: 26px;
  border:
    1px solid
    rgba(142, 93, 193, 0.16);
  background:
    radial-gradient(
      circle at 10% 30%,
      rgba(255, 230, 156, 0.55),
      transparent 28%
    ),
    linear-gradient(
      135deg,
      #fffaf2,
      #f2e7ff
    );
}

.learn-more-card h2 {
  margin: 0.45rem 0 0.6rem;
  max-width: 720px;
}

.learn-more-card p {
  max-width: 760px;
  color: #726579;
}

.button-secondary {
  flex: 0 0 auto;
  padding: 0.85rem 1.15rem;
  border-radius: 14px;
  border:
    1px solid
    rgba(115, 63, 180, 0.2);
  background: #fff;
  color: #60318f;
  font-weight: 800;
  text-decoration: none;
}


/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
  border-top:
    1px solid
    rgba(57, 36, 71, 0.08);
  background:
    rgba(255, 255, 255, 0.42);
}

.footer-inner {
  min-height: 120px;
  padding-block: 1.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.footer-brand p {
  margin: 0.35rem 0 0;
  color: #766a7b;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.15rem;
}

.footer-links a {
  color: #573276;
  font-weight: 700;
  text-decoration: none;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {
  .words-hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero-visual,
  .hero-result,
  .hero-not-found {
    min-height: auto;
  }

  .words-hero-left h1 {
    max-width: none;
  }
}

@media (max-width: 760px) {
  body {
    padding-top: 66px;
  }

  .shell {
    width:
      min(
        calc(100% - 28px),
        1180px
      );
  }

  .header-inner {
    min-height: 66px;
    gap: 0.65rem;
  }

  .brand-logo {
    width: 105px;
    max-width: 105px;
  }

  .brand-product {
    font-size: 0.82rem;
  }

  .site-nav {
    display: none;
  }

  .language-switch {
    margin-left: auto;
  }

  .footer-inner {
    display: grid;
    align-items: start;
  }
}

@media (max-width: 640px) {
  .words-hero {
    padding-top: 2.5rem;
  }

  .words-hero-left h1 {
    font-size:
      clamp(3rem, 15vw, 4.4rem);
  }

  .search-row {
    display: grid;
  }

  .button-primary {
    width: 100%;
  }

  .hero-result-grid {
    grid-template-columns: 1fr;
  }

  .hero-result {
    padding: 1.3rem;
  }

  .learn-more-card {
    display: grid;
  }

  .button-secondary {
    width: fit-content;
  }

  .coffee-note {
    position: static;
    margin-top: 1rem;
  }
}

/* ============================================================
   DOOKUN AI — SHARED HERO TITLE STANDARD
   Matches Prompt Builder
   ============================================================ */

.words-hero-left h1 {
  font-family: var(--dai-font) !important;
  font-weight: 800 !important;
  font-size: clamp(2rem, 3.6vw, 3.05rem) !important;
  line-height: .98 !important;
  letter-spacing: -0.055em !important;
}
