.landing-body {
  --landing-gold: #f4c77d;
  --landing-gold-strong: #e7ae55;
  --landing-ink: #171815;
  --landing-paper: #f8f4ed;
  --landing-panel: rgba(26, 25, 22, 0.42);
  --landing-panel-border: rgba(244, 199, 125, 0.4);
  --landing-header-height: 68px;
}

.landing-body main#top {
  overflow: clip;
}

.home-header {
  position: fixed;
  inset: 0 0 auto;
  min-height: var(--landing-header-height);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(14, 14, 12, 0.84), rgba(14, 14, 12, 0.2));
  box-shadow: none;
  backdrop-filter: blur(14px) saturate(0.9);
  transition: background-color 240ms ease, border-color 240ms ease, box-shadow 240ms ease;
}

.home-header .home-brand strong,
.home-header .home-nav a,
.home-header .button--ghost {
  color: #f8f4ed;
}

.home-header .home-nav a:hover,
.home-header .button--ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.home-header .button--primary {
  border-color: var(--landing-gold);
  color: #211c15;
  background: var(--landing-gold);
  box-shadow: 0 10px 26px rgba(11, 10, 8, 0.24);
}

.home-header .button--primary:hover {
  border-color: #ffd99b;
  background: #ffd99b;
}

.home-header :focus-visible {
  outline-color: var(--landing-gold);
}

.landing-body.is-past-hero .home-header {
  border-bottom-color: var(--theme-border);
  background: var(--theme-card-glass);
  box-shadow: 0 8px 28px rgba(23, 25, 29, 0.05);
  backdrop-filter: blur(18px);
}

.landing-body.is-past-hero .home-header .home-brand strong,
.landing-body.is-past-hero .home-header .home-nav a,
.landing-body.is-past-hero .home-header .button--ghost {
  color: var(--theme-strong);
}

.landing-body.is-past-hero .home-header .home-nav a:hover,
.landing-body.is-past-hero .home-header .button--ghost:hover {
  color: var(--theme-primary);
  background: rgba(0, 0, 0, 0.04);
}

.landing-body.is-past-hero .home-header .button--primary {
  border-color: var(--theme-primary);
  color: var(--theme-on-primary);
  background: var(--theme-primary);
  box-shadow: 0 12px 28px rgba(35, 37, 41, 0.14);
}

.landing-body.is-past-hero .home-header .button--primary:hover {
  border-color: var(--theme-primary-hover);
  background: var(--theme-primary-hover);
}

.landing-hero {
  position: relative;
  min-height: max(680px, 100svh);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
  padding: calc(var(--landing-header-height) + clamp(64px, 9vh, 112px)) clamp(16px, 3vw, 32px) clamp(78px, 11vh, 122px);
  background: #171614;
}

.landing-hero::before,
.landing-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.landing-hero::before {
  z-index: 1;
  background: linear-gradient(180deg, rgba(9, 9, 8, 0.42) 0%, rgba(13, 12, 10, 0.08) 31%, rgba(12, 11, 9, 0.08) 58%, rgba(8, 8, 7, 0.36) 100%);
}

.landing-hero::after {
  z-index: 1;
  opacity: 0.12;
  background: linear-gradient(115deg, transparent 22%, rgba(244, 199, 125, 0.12) 48%, transparent 73%);
  mix-blend-mode: soft-light;
}

.landing-hero__scroll {
  position: absolute;
  z-index: 2;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 9px 24px;
  color: var(--landing-paper);
  font-size: 19.5px;
  line-height: 1.5;
  letter-spacing: 1.5px;
  text-decoration: none;
  white-space: nowrap;
}
.landing-hero__scroll svg { width: 33px; height: 33px; }
@media (prefers-reduced-motion: no-preference) {
  .landing-hero__scroll svg { animation: landing-scroll-arrow 1.8s ease-in-out infinite; }
  @keyframes landing-scroll-arrow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
  }
}
.landing-hero__scroll:hover { color: var(--landing-gold); }
.landing-hero__scroll:focus-visible { outline: 2px solid var(--landing-gold); outline-offset: 4px; border-radius: 6px; }
.landing-body #introduction { scroll-margin-top: calc(var(--landing-header-height) + 20px); }

.landing-hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: #201c18;
  background-image: url("./fashion-editorial-poster.webp?v=20261110-first-paint1");
  background-position: center 44%;
  background-size: cover;
}

.landing-hero__video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 44%;
  /* Keep the fallback poster from bleeding through moving video frames. */
  opacity: 1;
  filter: saturate(0.92) contrast(0.98) brightness(0.98);
  transform: scale(1.015);
  transition: opacity 500ms ease;
}

.landing-hero.has-video-error .landing-hero__video {
  opacity: 0;
}

.landing-hero__icons {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.landing-hero__inner {
  position: relative;
  z-index: 2;
  width: min(960px, 100%);
  margin-inline: auto;
  transform: translateY(-2.5vh);
  animation: landing-hero-rise 720ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (min-width: 681px) {
  /* Keep the entry cards in place and reserve room for the bottom scroll hint. */
  .landing-hero:not(.is-chat-open) .landing-chat-entry {
    transform: translateY(clamp(0px, calc(50svh - 220px - 50%), 24svh));
  }
}

.landing-prompt {
  width: 100%;
  padding: 22px 24px 16px;
  border: 1px solid var(--landing-panel-border);
  border-radius: 20px;
  color: #fff;
  background: var(--landing-panel);
  box-shadow:
    0 16px 44px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px) saturate(1.08);
  -webkit-backdrop-filter: blur(10px) saturate(1.08);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.landing-prompt:focus-within {
  border-color: rgba(244, 199, 125, 0.55);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.18),
    0 0 0 3px rgba(244, 199, 125, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.landing-prompt textarea {
  width: 100%;
  min-height: 64px;
  max-height: 168px;
  display: block;
  overflow-y: auto;
  resize: none;
  border: 0;
  padding: 3px 3px 15px;
  color: #fffdf8;
  background: transparent;
  caret-color: var(--landing-gold);
  font: 500 clamp(16px, 1.45vw, 19px)/1.65 var(--theme-font);
  letter-spacing: -0.012em;
  outline: none;
}

.landing-prompt textarea::placeholder {
  color: #d4cdc2;
  opacity: 1;
}

.landing-prompt textarea::selection {
  color: #201a12;
  background: #f5ce90;
}

#landingComposerHome .landing-prompt {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}

#landingComposerHome .landing-prompt textarea::placeholder {
  color: #f1eade;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}

#landingComposerHome .landing-modes button.is-active {
  border-color: rgba(244, 199, 125, 0.7);
  color: #ffe0ad;
  background: rgba(40, 32, 20, 0.6);
}

#landingComposerHome .landing-modes button.is-active:hover {
  background: rgba(61, 46, 25, 0.76);
}

#landingComposerHome .landing-attach {
  border-color: rgba(255, 245, 227, 0.42);
  color: #fff8ed;
  background: rgba(24, 23, 20, 0.44);
}

#landingComposerHome .landing-attach:hover {
  border-color: rgba(244, 199, 125, 0.7);
  background: rgba(24, 23, 20, 0.64);
}

.landing-hero:not(.is-chat-open) .home-chat__resume {
  border-color: rgba(244, 199, 125, 0.52);
  color: #ffdda5;
  background: rgba(26, 25, 22, 0.58);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.landing-hero:not(.is-chat-open) .home-chat__resume:hover {
  border-color: rgba(244, 199, 125, 0.76);
  background: rgba(26, 25, 22, 0.72);
}

.landing-suggestions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin: 2px 0 5px;
}

.landing-suggestions button {
  min-width: 0;
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  color: #e9e2d7;
  background: rgba(255, 255, 255, 0.055);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.landing-suggestions button:hover {
  border-color: rgba(244, 199, 125, 0.32);
  color: #fff7eb;
  background: rgba(255, 255, 255, 0.1);
}

.landing-suggestions button:active {
  transform: translateY(1px);
}

.landing-attachment-summary {
  margin: 8px 3px 0;
  overflow: hidden;
  color: #ded6c9;
  font-size: 12px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.landing-prompt__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  margin-top: 9px;
}

.landing-modes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.landing-modes button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  padding: 8px 13px;
  color: #e8e2d8;
  background: rgba(255, 255, 255, 0.055);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.landing-modes button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.landing-modes button > span {
  display: grid;
  gap: 1px;
  text-align: left;
}

.landing-modes button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.landing-modes button.is-active {
  border-color: rgba(244, 199, 125, 0.58);
  color: #ffdb9f;
  background: rgba(244, 199, 125, 0.12);
}

.landing-prompt__tools {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}

.landing-attach,
.landing-send {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.landing-attach svg,
.landing-send svg {
  width: 21px;
  height: 21px;
}

.landing-attach {
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #eee7dc;
  background: rgba(255, 255, 255, 0.06);
}

.landing-attach:hover {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.12);
}

.landing-send {
  border: 1px solid var(--landing-gold);
  color: #251d13;
  background: var(--landing-gold);
  box-shadow: 0 8px 24px rgba(9, 8, 6, 0.24);
}

.landing-send:hover {
  border-color: #ffdaa0;
  background: #ffdaa0;
  transform: translateY(-1px) rotate(-2deg);
}

.landing-send[aria-busy="true"] {
  cursor: wait;
  opacity: 0.72;
}

.landing-prompt__status {
  min-height: 18px;
  margin: 7px 3px 0;
  color: #d9d0c3;
  font-size: 12px;
  line-height: 1.5;
}

.landing-prompt__status.is-error {
  color: #ffd1a1;
}

.landing-hero__note {
  margin: 14px 4px 0;
  color: rgba(245, 238, 226, 0.9);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.landing-entries {
  width: 100%;
  margin: 0 0 24px;
}

.landing-entries__buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.landing-entries__buttons button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  min-height: 64px;
  padding: 14px 12px;
  border: 1px solid rgba(255, 245, 227, 0.4);
  border-radius: 16px;
  color: #fff8ed;
  background: linear-gradient(130deg, rgba(30, 28, 23, 0.54), rgba(30, 28, 23, 0.42));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 245, 227, 0.14);
  backdrop-filter: blur(24px) saturate(1.25);
  -webkit-backdrop-filter: blur(24px) saturate(1.25);
  font: 600 15px/1.4 var(--theme-font);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  letter-spacing: .04em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.landing-entries__buttons button:hover {
  border-color: rgba(244, 199, 125, 0.72);
  color: #fff;
  background-color: rgba(26, 25, 22, 0.2);
}

.landing-entries__buttons button:focus-visible {
  outline: 2px solid #fff9ed;
  outline-offset: 4px;
}

.landing-entries__buttons button[aria-busy="true"] { cursor: wait; opacity: 0.7; }
.landing-entries .entry-icon { flex: 0 0 21px; width: 21px; height: 21px; color: #ffdaa0; }
.landing-entries > p { margin: 10px 0 0; color: #ffdb9f; font-size: 13px; line-height: 1.5; text-align: center; }
.landing-entries > p:empty { display: none; }
.login-dialog__hint { margin: 8px 0 0; color: var(--theme-muted); font-size: 13px; line-height: 1.5; }
.landing-hero.is-chat-open .landing-entries { display: none; }

.landing-hero__motion {
  position: absolute;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 3;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  padding: 0;
  color: #f6f0e7;
  background: rgba(20, 19, 16, 0.62);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.landing-hero__motion:hover {
  border-color: rgba(244, 199, 125, 0.52);
  background: rgba(33, 31, 27, 0.86);
}

.landing-hero__motion:focus-visible {
  outline: 2px solid var(--landing-gold);
  outline-offset: 3px;
}

.landing-motion-icon {
  width: 18px;
  height: 18px;
  grid-area: 1 / 1;
}

.landing-motion-icon--play,
.landing-hero__motion.is-paused .landing-motion-icon--pause {
  display: none;
}

.landing-hero__motion.is-paused .landing-motion-icon--play {
  display: block;
  transform: translateX(1px);
}

.landing-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.hero-section--legacy {
  scroll-margin-top: var(--landing-header-height);
}

@keyframes landing-hero-rise {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(-2.5vh) scale(1);
  }
}

@media (max-width: 900px) {
  .landing-body {
    --landing-header-height: 60px;
  }

  .landing-hero {
    padding-top: calc(var(--landing-header-height) + clamp(54px, 8vh, 88px));
  }

  .landing-suggestions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .landing-body {
    --landing-header-height: 60px;
  }

  .home-header {
    padding: 8px 12px;
  }

  .landing-hero {
    min-height: max(620px, 100svh);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: calc(var(--landing-header-height) + 42px) 12px max(154px, calc(env(safe-area-inset-bottom) + 126px));
  }

  .landing-hero__inner {
    transform: none;
  }

  .landing-entries { margin-bottom: 16px; }
  .landing-entries__buttons { gap: 8px; }
  .landing-entries__buttons button { flex-direction: column; min-height: 64px; gap: 6px; padding: 10px 6px; border-radius: 14px; font-size: 13px; }
  .landing-entries .entry-icon { flex-basis: 18px; width: 18px; height: 18px; }

  .landing-prompt {
    padding: 16px 14px 12px;
    border-radius: 18px;
  }

  .landing-prompt textarea {
    min-height: 58px;
    max-height: 126px;
    padding-bottom: 10px;
    font-size: 16px;
  }

  .landing-suggestions {
    gap: 7px;
  }

  .landing-suggestions button {
    min-height: 42px;
    padding: 7px 10px;
    font-size: 11.5px;
  }

  .landing-prompt__footer {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
  }

  .landing-modes {
    display: flex;
    gap: 7px;
  }

  .landing-modes button {
    justify-content: center;
    gap: 4px;
    padding-inline: 13px;
    font-size: 12px;
  }

  .landing-prompt__tools {
    justify-content: flex-end;
    padding-top: 9px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .landing-prompt__status {
    min-height: 16px;
    margin-top: 6px;
    font-size: 11.5px;
  }

  .landing-hero__note {
    margin-top: 10px;
    font-size: 11px;
  }

  .landing-hero__motion {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  @keyframes landing-hero-rise {
    from {
      opacity: 0;
      transform: translateY(12px) scale(0.994);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

@media (max-width: 380px) {
  .home-brand strong {
    display: none;
  }

  .landing-hero {
    padding-inline: 8px;
  }

  .landing-prompt {
    padding-inline: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-hero:not(.is-manual-play) .landing-hero__video {
    display: none;
  }

  .landing-hero__inner,
  .landing-body .reveal {
    animation: none;
  }

  .landing-hero__inner {
    transform: none;
  }

  .landing-send,
  .landing-suggestions button,
  .landing-modes button,
  .landing-entries__buttons button,
  .landing-attach {
    transition: none;
  }
}

/* Keep the original-upload control paired with the attachment surface after
   the form moves into homeChat. ID scope overrides the shared CSS loaded later. */
#landingPromptForm {
  --original-surface: rgba(255, 255, 255, 0.06);
  --original-border: rgba(255, 255, 255, 0.18);
  --original-text: #eee7dc;
  --original-hover-surface: rgba(255, 255, 255, 0.12);
  --original-hover-border: rgba(255, 255, 255, 0.32);
}

#landingComposerHome #landingPromptForm {
  --original-surface: rgba(24, 23, 20, 0.44);
  --original-border: rgba(255, 245, 227, 0.42);
  --original-text: #fff8ed;
  --original-hover-surface: rgba(24, 23, 20, 0.64);
  --original-hover-border: rgba(244, 199, 125, 0.7);
}

#landingPromptForm .dayuan-original-toggle {
  height: 44px;
  border-color: var(--original-border);
  color: var(--original-text);
  background: var(--original-surface);
  box-shadow: none;
}

#landingPromptForm .dayuan-original-toggle:hover:not(:disabled) {
  border-color: var(--original-hover-border);
  background: var(--original-hover-surface);
}

#landingPromptForm .dayuan-original-toggle .dayuan-original-toggle__track {
  border-color: var(--original-border);
  background: rgba(255, 245, 227, 0.16);
}

#landingPromptForm .dayuan-original-toggle__track > i {
  background: var(--landing-paper);
}

#landingPromptForm .dayuan-original-toggle[aria-pressed="true"] {
  border-color: var(--landing-gold);
  color: var(--landing-gold);
}

#landingPromptForm .dayuan-original-toggle[aria-pressed="true"] .dayuan-original-toggle__track {
  border-color: var(--landing-gold);
  background: var(--landing-gold);
}

#landingPromptForm .dayuan-original-toggle:focus-visible {
  outline: 2px solid var(--landing-gold);
  outline-offset: 3px;
}

#landingPromptForm .dayuan-original-toggle:disabled {
  opacity: 0.5;
  cursor: default;
}

.home-chat__composer #landingPromptForm .dayuan-original-toggle {
  height: 38px;
}

@media (max-width: 760px) {
  .home-chat__composer #landingPromptForm .dayuan-original-toggle {
    height: 34px;
  }
}

@media (pointer: coarse) {
  /* Expand only vertically: the compact chat toolbar has a 5px gap. */
  #landingPromptForm .dayuan-original-toggle::after {
    inset: 50% 0 auto;
    height: 44px;
    transform: translateY(-50%);
  }
}
