/* ==========================================================================
   OLD BARN LIMITED — site stylesheet
   Text-first, no images, no external dependencies.
   ========================================================================== */

:root {
  --bg:        #ffffff;
  --bg-soft:   #f7f6f3;
  --fg:        #191817;
  --fg-soft:   #55524d;
  --muted:     #8a8580;
  --rule:      #e3e0da;
  --rule-soft: #efede8;
  --accent:    #a8480a;
  --accent-sf: #fdf3ea;
  --link:      #a8480a;

  --measure: 44rem;
  --wide:    66rem;
  --radius:  3px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #131211;
    --bg-soft:   #1b1a18;
    --fg:        #eceae6;
    --fg-soft:   #b8b4ad;
    --muted:     #837e78;
    --rule:      #2e2c29;
    --rule-soft: #262421;
    --accent:    #e08a3c;
    --accent-sf: #241a10;
    --link:      #e08a3c;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* ---------- layout ---------- */

.wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.narrow { max-width: var(--measure); }

section { padding: 3.5rem 0; }

section + section { border-top: 1px solid var(--rule-soft); }

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  z-index: 10;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: .9rem;
  padding-bottom: .9rem;
}

.brand { text-decoration: none; color: inherit; display: block; }

.brand .en {
  font-family: var(--mono);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .1em;
}

.brand .cn {
  display: block;
  font-size: .75rem;
  color: var(--muted);
  letter-spacing: .16em;
  margin-top: .1rem;
}

.site-nav {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  font-size: .875rem;
}

.site-nav a {
  color: var(--fg-soft);
  text-decoration: none;
  padding: .25rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover { color: var(--fg); }

.site-nav a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- type ---------- */

h1, h2, h3, h4 { line-height: 1.25; margin: 0; }

h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  letter-spacing: -.02em;
  font-weight: 700;
}

h2 {
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  letter-spacing: -.01em;
  margin-bottom: 1rem;
}

h3 { font-size: 1.05rem; margin-bottom: .5rem; }

h4 {
  font-size: .8rem;
  font-family: var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .6rem;
}

p { margin: 0 0 1rem; }

p:last-child { margin-bottom: 0; }

.lead {
  font-size: clamp(1.02rem, 2.1vw, 1.2rem);
  line-height: 1.65;
  color: var(--fg-soft);
}

.eyebrow {
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .9rem;
}

a { color: var(--link); }

.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- hero ---------- */

.hero {
  padding: 4.5rem 0 4rem;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--rule);
}

.hero h1 { max-width: 30ch; }

.hero .lead {
  max-width: 52ch;
  margin-top: 1.4rem;
}

.hero-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  padding: .65rem 1.3rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: .02em;
}

.btn:hover { filter: brightness(1.08); }

.btn.ghost {
  background: transparent;
  color: var(--accent);
}

.btn.ghost:hover { background: var(--accent-sf); filter: none; }

/* ---------- grids & cards ---------- */

.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.grid.two { grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); }

.card {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.4rem 1.3rem;
  background: var(--bg);
}

.card h3 { margin-bottom: .55rem; }

.card p { font-size: .925rem; color: var(--fg-soft); }

.card ul {
  margin: .8rem 0 0;
  padding-left: 1.1rem;
  font-size: .9rem;
  color: var(--fg-soft);
}

.card li { margin-bottom: .35rem; }

/* ---------- numbered list ---------- */

.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; }

.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.6rem 3rem;
  border-left: 1px solid var(--rule);
  margin-left: .9rem;
}

.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }

.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: -1.05rem;
  top: .05rem;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--accent-sf);
  color: var(--accent);
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.steps h3 { margin-bottom: .35rem; }

.steps p { font-size: .925rem; color: var(--fg-soft); }

/* ---------- plain lists ---------- */

.ticks { list-style: none; margin: 0; padding: 0; }

.ticks li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: .7rem;
  font-size: .95rem;
}

.ticks li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ---------- facts band ---------- */

.facts {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.fact .k {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: .4rem;
}

.fact .v { font-size: 1.02rem; font-weight: 600; }

/* ---------- table ---------- */

.table { width: 100%; border-collapse: collapse; font-size: .925rem; }

.table th, .table td {
  text-align: left;
  padding: .7rem .8rem;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}

.table th {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  border-bottom-color: var(--rule);
}

/* ---------- prose (legal pages) ---------- */

.prose h2 { margin-top: 2.5rem; }
.prose h3 { margin-top: 1.8rem; }
.prose ul { padding-left: 1.2rem; color: var(--fg-soft); }
.prose li { margin-bottom: .45rem; }
.prose .updated {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--muted);
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.5rem;
}

/* ---------- contact ---------- */

.contact-block {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.6rem;
  background: var(--bg-soft);
}

.contact-block .mail {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 600;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2.5rem 0 3rem;
  background: var(--bg-soft);
  font-size: .85rem;
  color: var(--fg-soft);
}

.footer-grid {
  display: grid;
  gap: 1.8rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  margin-bottom: 2rem;
}

.footer-grid h4 { color: var(--fg-soft); }

.footer-grid a { display: block; color: var(--fg-soft); text-decoration: none; margin-bottom: .4rem; }
.footer-grid a:hover { color: var(--accent); }

.footer-base {
  border-top: 1px solid var(--rule);
  padding-top: 1.3rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .78rem;
  color: var(--muted);
}

/* ---------- utilities ---------- */

.mt-2 { margin-top: 2rem; }
.center { text-align: center; }
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem; top: 1rem; z-index: 50;
  background: var(--bg); padding: .6rem 1rem;
  border: 1px solid var(--accent); border-radius: var(--radius);
}

@media (max-width: 34rem) {
  section { padding: 2.5rem 0; }
  .hero { padding: 3rem 0 2.5rem; }
  .site-header .wrap { gap: .6rem; }
  .site-nav { gap: 1rem; font-size: .82rem; }
}
