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

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ac-bg);
  color: var(--ac-text);
  font-family: var(--ac-sans);
  font-size: 16px;
  line-height: 1.7;
}

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

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--ac-accent);
  outline-offset: 3px;
}

.ac-skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--ac-paper);
  padding: 8px 12px;
  z-index: 50;
}
.ac-skip:focus { top: 12px; }

header[data-cta-section="nav"] {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--ac-bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ac-line);
}

header[data-cta-section="nav"] > div {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.ac-logo,
header[data-cta-section="nav"] a[aria-label] {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.ant-brand { display: flex; flex-direction: column; line-height: 1.05; }
.ant-brand-zh { font-family: var(--ac-serif); font-size: 15px; }
.ant-brand-en { font-size: 11px; letter-spacing: .08em; color: var(--ac-muted); }
footer .ant-brand-en { color: #f5f4ed; }

header[data-cta-section="nav"] nav[aria-label="Main"],
.ac-nav {
  display: flex;
  gap: 18px;
  align-items: center;
}

header[data-cta-section="nav"] nav[aria-label="Main"] a,
.ac-nav-link {
  text-decoration: none;
  font-size: 14px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

header[data-cta-section="nav"] .ac-cta,
header[data-cta-section="nav"] [class*="ctaButtons"] {
  display: flex;
  gap: 8px;
  align-items: center;
}

button.ac-burger {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  padding: 10px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}
.ac-line {
  display: block;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
}

#ant-mobile {
  display: none;
  background: var(--ac-paper);
  border-bottom: 1px solid var(--ac-line);
  padding: 8px 16px 16px;
}
#ant-mobile[data-open="true"] { display: block; }
#ant-mobile a {
  display: flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  border-bottom: 1px solid var(--ac-line);
}

.ac-btn,
button[data-ant],
.ant-more a,
.ant-more button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--ac-fast) var(--ac-ease), opacity var(--ac-fast) var(--ac-ease);
}
.ac-btn-primary,
button[data-ant="compose"] {
  background: var(--ac-accent);
  color: #141413;
}
.ac-btn-quiet,
button[data-ant="lang"],
button[data-ant="random"],
button[data-ant="theme"],
button[data-ant="wander"] {
  border-color: var(--ac-line);
  background: var(--ac-paper);
}
.ac-btn:hover,
button[data-ant]:hover { transform: translateY(-1px); }

main { display: block; }

html {
  text-spacing-trim: space-all;
  line-break: strict;
}

p, li {
  text-wrap: pretty;
  hanging-punctuation: allow-end;
  line-break: strict;
}

.ac-display,
h1 {
  font-family: var(--ac-serif);
  font-weight: 500;
  font-size: clamp(1.75rem, 3.4vw, 3.5rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0;
}

h2, .ac-title {
  font-family: var(--ac-serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.2;
  text-wrap: balance;
  margin: 0;
}

section { padding: 48px 0 16px; }

section > header,
.ac-hero-copy {
  width: min(40rem, calc(100% - 32px));
  margin: 0 auto;
  text-align: center;
}

.ac-quiet, .text-caption, .ac-kicker { color: var(--ac-muted); font-size: 14px; }

[data-orbit-live] {
  position: relative;
  min-height: 760px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

[data-ring] {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
[data-ring]::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 680px;
  height: 420px;
  margin: -210px 0 0 -340px;
  border: 1px dashed color-mix(in srgb, var(--ac-accent) 55%, var(--ac-line));
  border-radius: 50%;
  opacity: .7;
}
[data-ring="inner"]::before {
  width: 420px;
  height: 260px;
  margin: -130px 0 0 -210px;
}
@media (prefers-reduced-motion: no-preference) {
  [data-ring="outer"]::before {
    animation: ac-orbit 48s linear infinite;
  }
  [data-tile] {
    animation: ac-float 7s var(--ac-ease) infinite;
  }
}
@keyframes ac-orbit {
  to { transform: rotate(360deg); }
}
@keyframes ac-float {
  50% { opacity: .86; }
}

[data-tile] {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--tsz, 120) * 1px);
  height: calc(var(--tsz, 120) * 1px);
  margin-left: calc(var(--tsz, 120) * -0.5px);
  margin-top: calc(var(--tsz, 120) * -0.5px);
  border-radius: 16px;
  background: var(--ac-glow);
  box-shadow: var(--ac-shadow);
  pointer-events: auto;
  display: flex;
  align-items: flex-end;
  padding: 8px;
  overflow: hidden;
  cursor: pointer;
}

[data-tile][data-cat="headwind"] { background: var(--ac-headwind); }
[data-tile][data-cat="idea"] { background: var(--ac-idea); }
[data-tile][data-cat="coordinate"] { background: var(--ac-coordinate); }
[data-tile][data-cat="glow"] { background: var(--ac-glow); }

.ac-tile-caption {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  background: color-mix(in srgb, var(--ac-paper) 88%, transparent);
  border-radius: 8px;
  padding: 4px 6px;
}

.ac-hero-copy,
[data-orbit-live] > div:last-child,
[data-orbit-live] .ac-hero-copy {
  position: relative;
  z-index: 2;
  width: min(40rem, calc(100% - 32px));
  max-width: none;
  background: color-mix(in srgb, var(--ac-bg) 86%, transparent);
  border-radius: 24px;
  padding: 28px 22px;
}
h1 .ac-hword { display: block; }

.ac-intro {
  width: min(1120px, calc(100% - 32px));
  margin: 12px auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.ac-intro .ac-tile {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  display: block;
}
.ac-intro h3 { font-size: 1.35rem; }
@media (max-width: 800px) {
  .ac-intro { grid-template-columns: 1fr; }
}

.ac-tilecard {
  position: absolute;
  z-index: 3;
  width: 220px;
  padding: 16px;
  border-radius: 16px;
  background: var(--ac-paper);
  box-shadow: var(--ac-shadow);
  transition: opacity var(--ac-mid) var(--ac-ease), transform var(--ac-mid) var(--ac-ease);
}
.ac-tilecard[hidden] { display: none; }
.ac-swatch { height: 72px; border-radius: 12px; background: var(--ac-glow); margin: 8px 0; }

.ant-card-grid {
  width: min(1120px, calc(100% - 32px));
  margin: 28px auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.ac-card {
  display: flex;
  flex-direction: column;
  background: var(--ac-paper);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  min-height: 100%;
  border: 1px solid var(--ac-line);
}
.ac-plate { min-height: 84px; }
.ac-card-body { padding: 14px 16px 16px; }
.ac-card-title { margin: 4px 0; font-size: 16px; line-height: 1.4; font-family: var(--ac-serif); font-weight: 500; }
.ac-card-text { margin: 0; }

.ant-more { width: min(1120px, calc(100% - 32px)); margin: 20px auto; }
.ant-kicker { letter-spacing: .04em; margin: 0 0 8px; }
.ant-essay { font-family: var(--ac-serif); font-size: 1.125rem; line-height: 1.8; max-width: 40rem; }
.ant-essay p { margin: 0 0 1em; }

.ant-star-frame, #ant-constellation, .ac-stars {
  position: relative;
  margin: 24px auto;
  width: min(1120px, calc(100% - 32px));
  min-height: 280px;
  border-radius: 16px;
  overflow: hidden;
  background: #221e19;
}
.ant-star-frame canvas, #ant-constellation canvas { width: 100%; height: 420px; display: block; }
.ant-tip {
  position: absolute;
  z-index: 2;
  max-width: 240px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--ac-paper);
  color: var(--ac-text);
  pointer-events: none;
}

footer {
  margin-top: 64px;
  background: #141413;
  color: #f3efe4;
  padding: 40px 0 24px;
}
footer a { color: inherit; text-decoration: none; }
footer .ac-footer-grid,
footer > div {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}
footer .ac-footer-compact,
footer .desktopLinks { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
footer .desktopLinks { display: none; }
@media (min-width: 900px) {
  footer .ac-footer-compact { display: none; }
  footer .desktopLinks { display: grid; }
}
footer ul { list-style: none; padding: 0; margin: 0; }
footer li { margin: 6px 0; }
footer h2 { font-family: var(--ac-sans); font-size: 12px; letter-spacing: .06em; color: #c4bdb0; }

#ant-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 19, .4);
  z-index: 30;
}
#ant-backdrop[hidden] { display: none; }
#ant-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 40;
  width: min(440px, 100%);
  height: 100%;
  background: var(--ac-paper);
  color: var(--ac-text);
  box-shadow: var(--ac-shadow);
  overflow: auto;
  padding: 20px;
}
#ant-drawer[hidden] { display: none; }
.ac-drawer-head, #ant-drawer > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.ant-field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; font-size: 14px; }
.ant-field input, .ant-field textarea, .ant-field select, .ant-inline-input {
  width: 100%;
  border: 1px solid var(--ac-line);
  background: var(--ac-bg);
  color: inherit;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  min-height: 44px;
}
.ant-field textarea { min-height: 140px; resize: vertical; font-family: var(--ac-serif); line-height: 1.7; }
.ant-hint { min-height: 1.4em; color: var(--ac-muted); }
.ant-hint.ant-warn { color: #a85b2a; }
.ant-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.ant-comment { border-top: 1px solid var(--ac-line); padding: 12px 0; }
.ant-dialog {
  width: min(720px, calc(100vw - 24px));
  border: 1px solid var(--ac-line);
  border-radius: 16px;
  background: var(--ac-paper);
  color: var(--ac-text);
  padding: 0;
}
.ant-dialog::backdrop { background: rgba(20, 20, 19, .45); }
.ant-dialog-body { padding: 24px; }
.ac-cmd { padding: 12px; }
.ac-cmd input { width: 100%; min-height: 44px; border-radius: 12px; border: 1px solid var(--ac-line); background: var(--ac-bg); color: inherit; padding: 8px 12px; font: inherit; }

#ant-empty[hidden] { display: none !important; }

@media (max-width: 900px) {
  header[data-cta-section="nav"] nav[aria-label="Main"] { display: none; }
  button.ac-burger { display: inline-flex; }
  [data-ring="outer"] { display: none; }
  [data-orbit-live] { min-height: 280px; }
  [data-tile] { width: 105px; height: 105px; margin-left: -52px; margin-top: -52px; }
  .ac-tile-caption { display: none; }
}

.ac-burger { display: none; }
@media (max-width: 900px) {
  .ac-burger { display: inline-flex; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ac-btn, button[data-ant], .ac-tilecard, [data-tile], [data-ring]::before { transition: none; animation: none; }
}

/* Fixed status chip: avoid CLS when API is away. */
.ac-readonly-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 25;
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--ac-paper) 94%, transparent);
  border: 1px solid var(--ac-line);
  box-shadow: var(--ac-shadow);
  color: var(--ac-muted);
  font-size: 13px;
  line-height: 1.45;
  pointer-events: none;
}
#home-ideas { min-height: 320px; }
/* Hero text must paint immediately (LCP); never translate (CLS). */
[data-orbit-live] .ac-hero-copy,
.ac-hero-copy [data-lcp="hero"] {
  opacity: 1;
  transform: none;
}

[data-main-shell] { overflow-anchor: none; }
header[data-cta-section="nav"] > div { min-height: 64px; }

.ac-hero-lead {
  font-family: var(--ac-serif);
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  line-height: 1.55;
  margin: 14px auto 0;
  max-width: 28rem;
}
/* Mobile first screen: shorter stage so hero+lead stay largest in-viewport paint. */
@media (max-width: 900px) {
  [data-orbit-live] { min-height: 360px; }
}




/* cls-mobile-header: one row from first paint so main shell does not jump */
header[data-cta-section="nav"] > div {
  min-height: 64px;
  flex-wrap: nowrap;
}
@media (max-width: 900px) {
  header[data-cta-section="nav"] [data-ant="random"],
  header[data-cta-section="nav"] [data-ant="compose"],
  header[data-cta-section="nav"] [data-ant="theme"],
  header[data-cta-section="nav"] #ac-theme-slot {
    display: none !important;
  }
}

/* hide-breadcrumb: leftover template chrome; was sitting in the sticky header */
header[data-cta-section="nav"] > nav[aria-label="Breadcrumb"] {
  display: none !important;
}
.transition-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 60;
}
.transition-overlay.ac-busy {
  opacity: 1;
  pointer-events: auto;
  background: color-mix(in srgb, var(--ac-bg) 80%, transparent);
}

/* hero-sans-stable */
[data-orbit-live] .ac-display,
[data-orbit-live] .ac-hero-lead,
[data-orbit-live] .ac-hword {
  font-family: var(--ac-sans) !important;
  font-weight: 600;
}
