.hero { position: relative; z-index: 3; padding: clamp(40px, 8vh, 104px) 20px clamp(44px, 7vh, 80px); text-align: center; }
.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.hero-bg::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Cpath d='M13 10.6 16 12.3 13 14 10 12.3Z' fill='%23f8f6f1' fill-opacity='.16'/%3E%3C/svg%3E");
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 70% 62% at 50% 42%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 70% 62% at 50% 42%, #000 20%, transparent 78%);
}
.hero-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 46% 36% at 50% 68%, rgba(196, 101, 74, 0.16), transparent 70%); }

.mode { display: inline-flex; max-width: 100%; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(23, 24, 27, 0.85); border: 1px solid var(--line-2); margin-bottom: clamp(22px, 4vh, 36px); }
.mode-tab { display: inline-flex; align-items: center; gap: 7px; min-width: 0; min-height: 34px; padding: 0 14px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.mode-tab svg { width: 14px; height: 14px; }
.mode-tab:hover { color: var(--ink); }
.mode-tab[aria-current="true"] { background: var(--panel-3); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.mode-tab[aria-current="true"] svg { color: var(--accent-2); }

.hero-title {
  margin: 0 auto; max-width: 15.5em; font: 700 clamp(2.5rem, 5.7vw, 6.4rem)/0.98 var(--font-display); text-transform: uppercase; letter-spacing: 0.002em;
  background: linear-gradient(180deg, #ffffff 10%, #d8d2c8 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-wrap: balance;
}
.hero-title .line { display: block; }
.hero-title .mark { display: inline-block; height: 0.74em; width: auto; vertical-align: -0.02em; margin: 0 0.06em 0 0.02em; }
.hero-sub { max-width: 36rem; margin: clamp(14px, 2.4vh, 22px) auto 0; color: var(--muted); font-size: clamp(0.95rem, 1.1vw, 1.08rem); line-height: 1.55; text-wrap: balance; }

/* Composer */
.composer {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: stretch;
  width: min(780px, 100%); margin: clamp(26px, 4.4vh, 40px) auto 0; padding: 12px; text-align: left;
  border-radius: 22px; background: linear-gradient(180deg, #1c1d21, #17181b); border: 1px solid var(--line-2);
  box-shadow: 0 0 0 6px rgba(15, 16, 18, 0.6), 0 30px 80px -30px rgba(0, 0, 0, 0.9);
}
.composer:focus-within { border-color: rgba(226, 144, 111, 0.55); }
.composer-main { display: flex; flex-direction: column; gap: 6px; padding: 8px 4px 4px 12px; min-width: 0; }
.composer-label { color: var(--dim); font-size: 0.8rem; font-weight: 600; }
.composer-input { width: 100%; border: 0; outline: none; background: transparent; text-overflow: ellipsis; padding: 2px 0 8px; font-size: clamp(1.1rem, 1.5vw, 1.3rem); font-weight: 600; }
.composer-input::placeholder { color: rgba(248, 246, 241, 0.42); }
.composer-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }

.pick { position: relative; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; max-width: 100%; padding: 0 10px 0 11px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(248, 246, 241, 0.05); font-size: 0.85rem; font-weight: 600; white-space: nowrap;
}
.chip svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.chip .caret { width: 13px; height: 13px; }
.chip > span { overflow: hidden; text-overflow: ellipsis; }
.chip:hover, .chip[aria-expanded="true"] { background: rgba(248, 246, 241, 0.1); }
.chip.is-set { border-color: rgba(226, 144, 111, 0.5); background: rgba(196, 101, 74, 0.14); }

.menu {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 20; min-width: 190px; margin: 0; padding: 6px; list-style: none;
  border-radius: 14px; background: #1d1e22; border: 1px solid var(--line-2); box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.85);
}
.menu:focus { outline: none; }
.menu-formats { width: 330px; max-height: min(400px, 60vh); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.menu-head { padding: 6px 10px 6px; color: var(--dim); font-size: 0.75rem; font-weight: 600; }
.opt { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 7px 10px; border-radius: 9px; cursor: pointer; font-size: 0.9rem; outline: none; }
.opt:hover, .opt:focus { background: rgba(248, 246, 241, 0.07); }
.opt:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-2); }
.opt[aria-selected="true"] { background: rgba(248, 246, 241, 0.1); }
.opt-num { width: 22px; color: var(--dim); font-size: 0.75rem; font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }
.opt-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.opt-name { font-weight: 600; }
.opt-engine { color: var(--dim); font-size: 0.75rem; }
.opt-check { margin-left: auto; width: 15px; height: 15px; color: var(--accent-2); opacity: 0; flex: none; }
.opt[aria-selected="true"] .opt-check { opacity: 1; }

.composer .go { min-width: 168px; padding: 0 22px; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.15; }
.go-label { display: block; }
.go-break { display: block; }

.hero-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.pill-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 16px; border-radius: 999px; text-decoration: none;
  border: 1px solid var(--line-2); background: rgba(15, 16, 18, 0.7); color: var(--ink); font-size: 0.875rem; font-weight: 600;
}
.pill-link svg { width: 15px; height: 15px; color: var(--muted); }
.pill-link:hover { border-color: rgba(248, 246, 241, 0.3); }

@media (max-width: 40rem) {
  .hero { padding: 26px 14px 44px; }
  .mode { margin-bottom: 20px; }
  .hero-sub { font-size: 0.95rem; }
  .composer { margin-top: 22px; }
  .hero-title { font-size: clamp(2.3rem, 11.4vw, 3.4rem); }
  .hero-title .line { display: inline; }
  .composer { grid-template-columns: 1fr; padding: 10px; border-radius: 20px; }
  .composer-main { padding: 6px 6px 2px; }
  .composer .go { min-height: 54px; }
  .go-break { display: inline; }
  .menu { position: fixed; left: 8px; right: 8px; top: auto; bottom: max(8px, env(safe-area-inset-bottom)); width: auto; max-height: 62vh; overflow-y: auto; box-shadow: 0 0 0 100vmax rgba(6, 6, 8, 0.6), 0 24px 60px -16px rgba(0, 0, 0, 0.85); }
  .menu-formats { width: auto; }
  .opt { min-height: 46px; }
  .hero-links { flex-direction: column; align-items: center; }
}
/* Narrow phones: "Sign up" / "and copy prompt ↗" on two lines rather than a ragged wrap.
   At a large default font the two section tabs wrap inside the pill instead of running off screen. */
@media (max-width: 25rem) {
  .go-break { display: block; }
  .mode-tab { white-space: normal; line-height: 1.15; padding: 6px 12px; }
}
/* Touch screens: the pickers and section tabs get a 40 px target. */
@media (pointer: coarse) {
  .chip, .mode-tab { min-height: 40px; }
}
/* Short screens (a phone held sideways): the composer and its button fit the first screen. */
@media (max-height: 32rem) {
  .hero { padding-top: 12px; padding-bottom: 32px; }
  .mode { display: none; }
  .hero-title { font-size: clamp(1.8rem, 4.6vw, 2.6rem); }
  .hero-sub { margin-top: 8px; font-size: 0.9rem; line-height: 1.45; }
  .composer { margin-top: 14px; }
}
/* Very short screens (a small phone held sideways): the button sits beside the idea and the line
   under the title gives way. */
@media (max-height: 22.5rem) {
  .hero-sub { display: none; }
  .composer { grid-template-columns: minmax(0, 1fr) auto; }
  .composer .go { min-height: 0; }
  .go-break { display: block; }
}
