/* F1 Web UI kit · Wenxin canonical responsive site
   ------------------------------------------------- */

/* Pulls tokens.css via index.html.
   This stylesheet adds F1-specific layout primitives:
   header, hero, section rhythm, three-col grids, footer. */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg-1);
  color: var(--fg-2);
  font-family: var(--serif-body);
  font-size: var(--t-md);
  line-height: var(--lh-relaxed);
  min-height: 100vh;
}

a {
  color: var(--fg-2);
  text-decoration: none;
  transition: color var(--d-fast) var(--ease-default);
}
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

img { max-width: 100%; display: block; }

/* --- layout primitives --- */
.container {
  width: 100%;
  max-width: var(--w-showcase);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.eyebrow {
  font-family: var(--sans-ui);
  font-size: var(--t-sm);
  letter-spacing: var(--tr-wider);
  text-transform: uppercase;
  color: var(--fg-4);
  display: block;
  margin-bottom: var(--s-3);
}

.section-title {
  font-family: var(--serif-display);
  font-size: var(--t-2xl);
  font-weight: 700;
  color: var(--fg-1);
  line-height: var(--lh-snug);
  margin-bottom: var(--s-10);
}

.section-desc {
  font-family: var(--serif-body);
  font-size: var(--t-md);
  color: var(--fg-3);
  line-height: var(--lh-relaxed);
  max-width: 60ch;
}

.section {
  padding-block: clamp(80px, 10vh, 120px);
}

.section + .section { border-top: 1px solid var(--line-1); }

/* --- header --- */
.site-header {
  padding-block: var(--s-6);
  position: relative;
  z-index: 10;
  animation: fadeInDown var(--d-slow) var(--ease-out) both;
}
.header-inner {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s-4); flex-wrap: wrap;
}
.brand {
  display: flex; align-items: baseline; gap: var(--s-3);
}
.brand-seal-svg {
  width: 32px; height: 32px;
  align-self: center; flex-shrink: 0;
}
.brand-name {
  font-family: var(--serif-display);
  font-size: var(--t-xl);
  font-weight: 700;
  color: var(--fg-1);
  line-height: 1;
}
.site-nav {
  display: flex; gap: var(--s-6); list-style: none; flex-wrap: wrap;
}
.site-nav a, .site-nav button {
  font-family: var(--sans-ui);
  font-size: var(--t-sm);
  letter-spacing: var(--tr-wider);
  text-transform: uppercase;
  color: var(--fg-3);
  background: none; border: 0; padding: 0; cursor: pointer;
}
.site-nav a.is-current, .site-nav button.is-current { color: var(--fg-1); }

/* --- hero --- */
.hero {
  padding-block: clamp(80px, 12vh, 160px);
  text-align: center;
}
.hero-inner { animation: fadeUp var(--d-slow) var(--ease-out) 0.15s both; }
.hero-title {
  font-family: var(--serif-display);
  font-size: var(--t-5xl);
  font-weight: 700;
  color: var(--fg-1);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-cjk);
}
.hero-sub {
  font-family: var(--serif-display);
  font-size: var(--t-xl);
  font-style: italic;
  font-weight: 400;
  color: var(--fg-3);
  margin-top: var(--s-6);
  line-height: var(--lh-snug);
}
.hero-rule {
  width: 40px; height: 2px; background: var(--fg-1);
  margin: var(--s-8) auto 0;
}
.hero-desc {
  font-family: var(--serif-body);
  font-size: var(--t-lg);
  color: var(--fg-2);
  line-height: var(--lh-relaxed);
  margin: var(--s-8) auto 0;
  max-width: 540px;
}
.hero-cta {
  margin-top: var(--s-12);
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-family: var(--sans-ui);
  font-size: var(--t-sm);
  letter-spacing: var(--tr-wide);
  color: var(--fg-3);
  border-bottom: 1px solid var(--line-1);
  padding-bottom: var(--s-1);
  transition: color var(--d-fast), border-color var(--d-fast);
}
.hero-cta:hover { color: var(--fg-1); border-color: var(--line-2); }
.hero-cta-arrow { display: inline-block; transition: transform var(--d-fast); }
.hero-cta:hover .hero-cta-arrow { transform: translateY(2px); }

/* --- three-up grids --- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-16);
  margin-top: var(--s-16);
}
.grid-3-tight {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-6);
  margin-top: var(--s-16);
}

.phil {
  padding-top: var(--s-8);
  border-top: 2px solid var(--line-1);
}
.phil-num {
  font-family: var(--sans-ui);
  font-size: var(--t-xs);
  letter-spacing: var(--tr-wider);
  text-transform: uppercase;
  color: var(--fg-4);
  display: block;
  margin-bottom: var(--s-4);
}
.phil-title {
  font-family: var(--serif-display);
  font-size: var(--t-xl);
  font-weight: 700;
  color: var(--fg-1);
  line-height: var(--lh-snug);
  margin-bottom: var(--s-4);
}
.phil-desc {
  font-family: var(--serif-body);
  font-size: var(--t-md);
  line-height: var(--lh-relaxed);
  color: var(--fg-3);
}

.form-item {
  padding: var(--s-6) var(--s-8);
  border-left: 1px solid var(--line-1);
  transition: border-color var(--d-fast);
  cursor: pointer;
}
.form-item:hover { border-left-color: var(--line-2); }
.form-item.is-current { border-left-color: var(--accent); }
.form-item-code {
  font-family: var(--sans-ui);
  font-size: var(--t-xs);
  letter-spacing: var(--tr-wider);
  color: var(--fg-4);
  display: block;
  margin-bottom: var(--s-3);
}
.form-item-name {
  font-family: var(--serif-display);
  font-size: var(--t-lg);
  font-weight: 700;
  color: var(--fg-1);
  line-height: var(--lh-snug);
  margin-bottom: var(--s-2);
}
.form-item-desc {
  font-family: var(--serif-body);
  font-size: var(--t-base);
  line-height: var(--lh-normal);
  color: var(--fg-3);
}

/* --- list (B archetype) --- */
.post-list { list-style: none; margin-top: var(--s-12); }
.post-list li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--s-6);
  padding-block: var(--s-5);
  border-bottom: 1px solid var(--line-1);
  align-items: baseline;
}
.post-list li:last-child { border-bottom: 0; }
.post-date {
  font-family: var(--sans-ui);
  font-size: var(--t-sm);
  color: var(--fg-3);
  letter-spacing: var(--tr-wide);
}
.post-link {
  font-family: var(--serif-display);
  font-size: var(--t-lg);
  font-weight: 700;
  color: var(--fg-1);
}
.post-link:hover { color: var(--accent); }
.post-meta {
  font-family: var(--sans-ui);
  font-size: var(--t-sm);
  color: var(--fg-4);
  margin-top: var(--s-1);
  letter-spacing: var(--tr-wide);
}

/* --- article view --- */
.article {
  max-width: var(--w-article);
  margin-inline: auto;
}
.article h1 {
  font-family: var(--serif-display);
  font-size: var(--t-3xl);
  font-weight: 700;
  color: var(--fg-1);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-cjk);
  margin-bottom: var(--s-6);
}
.article .lede {
  font-family: var(--serif-body);
  font-size: var(--t-lg);
  color: var(--fg-3);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--s-12);
  font-style: italic;
}
.article .meta-line {
  font-family: var(--sans-ui);
  font-size: var(--t-sm);
  color: var(--fg-3);
  letter-spacing: var(--tr-wide);
  margin-bottom: var(--s-12);
}
.article p {
  margin-bottom: var(--s-5);
  text-wrap: pretty;
}
.article h2 {
  font-family: var(--serif-body);
  font-weight: 700;
  font-size: var(--t-2xl);
  color: var(--fg-1);
  margin-top: var(--s-16);
  margin-bottom: var(--s-6);
  line-height: var(--lh-snug);
}
.article blockquote {
  font-family: var(--serif-body);
  font-style: italic;
  font-size: var(--t-md);
  color: var(--fg-3);
  background: var(--bg-4);
  border-left: 2px solid var(--accent);
  padding: var(--s-4) var(--s-6);
  margin: var(--s-8) 0;
}
.article pre {
  font-family: var(--mono);
  font-size: var(--t-sm);
  background: var(--bg-4);
  border-left: 3px solid var(--line-2);
  padding: var(--s-4);
  border-radius: var(--r-md);
  overflow-x: auto;
  margin-block: var(--s-8);
}
.article code:not(pre code) {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--bg-4);
  padding: 2px 6px;
  border-radius: 3px;
}

/* --- footer --- */
.site-footer {
  padding-block: var(--s-16);
  border-top: 1px solid var(--line-1);
  margin-top: var(--s-24);
}
.footer-inner {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s-4); flex-wrap: wrap;
}
.footer-brand {
  font-family: var(--serif-display);
  font-size: var(--t-base);
  color: var(--fg-3);
}
.footer-tag {
  font-family: var(--serif-body);
  font-style: italic;
  font-size: var(--t-sm);
  color: var(--fg-4);
}
.footer-copy {
  font-family: var(--sans-ui);
  font-size: var(--t-xs);
  color: var(--fg-4);
  letter-spacing: var(--tr-wide);
}

/* --- animations --- */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* stagger on form-item children */
.grid-3-tight .form-item { animation: fadeUp var(--d-slow) var(--ease-out) both; }
.grid-3-tight .form-item:nth-child(1) { animation-delay:  0ms; }
.grid-3-tight .form-item:nth-child(2) { animation-delay: 60ms; }
.grid-3-tight .form-item:nth-child(3) { animation-delay:120ms; }
.grid-3-tight .form-item:nth-child(4) { animation-delay:180ms; }
.grid-3-tight .form-item:nth-child(5) { animation-delay:240ms; }
.grid-3-tight .form-item:nth-child(6) { animation-delay:300ms; }
.grid-3-tight .form-item:nth-child(7) { animation-delay:360ms; }
.grid-3-tight .form-item:nth-child(8) { animation-delay:420ms; }
.grid-3-tight .form-item:nth-child(9) { animation-delay:480ms; }

/* --- responsive --- */
@media (max-width: 1024px) {
  .grid-3, .grid-3-tight { grid-template-columns: 1fr 1fr; gap: var(--s-12); }
}
@media (max-width: 640px) {
  .grid-3, .grid-3-tight { grid-template-columns: 1fr; gap: var(--s-8); }
  .hero-title { font-size: var(--t-4xl); }
  .post-list li { grid-template-columns: 1fr; gap: var(--s-1); }
}
