/* =========================================================================
   镜界手记 — personal filing site styles
   Warm-ink, token-driven, referencing ../www/landing.css aesthetic.
   ========================================================================= */

:root {
  --site-max: 1100px;
  --site-gutter: 28px;
  --header-h: 56px;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  z-index: 100;
  padding: 8px 14px;
  background: var(--accent);
  color: var(--on-accent);
  font: var(--type-ui-medium-weight) var(--type-ui-size)/1 var(--font-sans);
  transition: top 120ms ease;
}
.skip-link:focus { top: 0; }

.wrap {
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 0 var(--site-gutter);
}

/* ---- Header ------------------------------------------------------------- */

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

.site-header__inner {
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 0 var(--site-gutter);
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: inherit;
  text-decoration: none;
  flex: none;
}
.brand__mark {
  display: block;
  width: 28px;
  height: 28px;
}
.brand__name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-left: var(--space-2xl);
}
.site-nav a {
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-medium);
  font: var(--type-ui-medium-weight) var(--type-ui-size)/1 var(--font-sans);
  color: var(--text-secondary);
  text-decoration: none;
  transition: background-color 120ms ease, color 120ms ease;
}
.site-nav a:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.theme-toggle {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-large);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, transform 0.2s ease;
}
.theme-toggle:hover {
  background: var(--hover);
  color: var(--text-primary);
  transform: scale(1.05);
}
.theme-toggle__icon {
  font-size: 16px;
  line-height: 1;
}

/* ---- Hero --------------------------------------------------------------- */

.hero {
  position: relative;
  padding: 110px 0 90px;
  text-align: center;
  overflow: hidden;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero__aurora {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.hero__aurora-ring {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.45;
  mix-blend-mode: multiply;
}
[data-theme="dark"] .hero__aurora-ring { mix-blend-mode: screen; opacity: 0.35; }
.hero__aurora-ring--1 {
  width: 460px; height: 460px; top: -120px; left: -80px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%);
  animation: aurora1 24s ease-in-out infinite alternate;
}
.hero__aurora-ring--2 {
  width: 400px; height: 400px; top: -40px; right: -90px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent-amber) 50%, transparent), transparent 70%);
  animation: aurora2 28s ease-in-out infinite alternate;
}
.hero__aurora-ring--3 {
  width: 520px; height: 520px; bottom: -200px; left: 30%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent-warm) 45%, transparent), transparent 70%);
  animation: aurora3 32s ease-in-out infinite alternate;
}
@keyframes aurora1 { from { transform: translate(0,0) scale(1); } to { transform: translate(50px,30px) scale(1.12); } }
@keyframes aurora2 { from { transform: translate(0,0) scale(1.08); } to { transform: translate(-40px,25px) scale(0.95); } }
@keyframes aurora3 { from { transform: translate(0,0) scale(1); } to { transform: translate(35px,-40px) scale(1.08); } }

.hero__grain {
  position: absolute;
  inset: 0;
  opacity: 0.4;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
}

.hero__content {
  position: relative;
  z-index: 1;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-lg);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface-container-high) 80%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-secondary);
  font: var(--type-ui-medium-weight) var(--type-ui-small-size)/1 var(--font-sans);
  margin-bottom: var(--space-4xl);
}

.hero__title {
  font-family: var(--font-serif);
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 auto var(--space-2xl);
  text-wrap: balance;
}

.hero__lede {
  max-width: 54ch;
  margin: 0 auto;
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-secondary);
  text-wrap: pretty;
}

.hero__actions {
  margin-top: var(--space-5xl);
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.hero__btn {
  height: 44px;
  padding: 0 var(--space-4xl);
  font-size: var(--type-body-small-size);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hero__btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(196, 149, 106, 0.2); }

/* ---- Sections ----------------------------------------------------------- */

.section { padding: 90px 0; }
.section--tint {
  background: var(--surface-dim);
  border-block: 1px solid var(--border-subtle);
}

.section__head { max-width: 720px; margin-bottom: var(--space-6xl); }
.section__kicker {
  font: 600 var(--type-ui-tiny-size)/1.3 var(--font-sans);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--accent-warm);
  margin-bottom: var(--space-lg);
}
.section__title {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin: 0;
}
.section__lede {
  margin-top: var(--space-2xl);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-secondary);
  text-wrap: pretty;
}

/* ---- About cards -------------------------------------------------------- */

.about-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2xl);
}

.about-card {
  background: var(--surface);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-large);
  padding: var(--space-4xl);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.about-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(44, 36, 24, 0.05);
}
.about-card__icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-large);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent) 18%, var(--surface)),
    color-mix(in srgb, var(--accent-amber) 14%, var(--surface)));
  color: var(--accent-warm);
  margin-bottom: var(--space-2xl);
}
.about-card h3 {
  font: var(--type-ui-semibold-weight) 16px/1.3 var(--font-sans);
  color: var(--text-primary);
  margin: 0 0 var(--space-sm);
}
.about-card p {
  font-family: var(--font-serif);
  font-size: var(--type-body-small-size);
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0;
}

/* ---- Post cards --------------------------------------------------------- */

.post-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2xl);
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-large);
  padding: var(--space-4xl);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.post-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(44, 36, 24, 0.05);
}
.post-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
  font: var(--type-ui-medium-weight) var(--type-ui-small-size)/1 var(--font-sans);
  color: var(--text-muted);
}
.post-card__tag {
  padding: 2px 8px;
  border-radius: var(--radius-small);
  background: rgba(196, 149, 106, 0.12);
  color: var(--accent-warm);
  font: 500 var(--type-ui-tiny-size)/1.4 var(--font-sans);
}
.post-card__title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin: 0 0 var(--space-sm);
}
.post-card__summary {
  font-family: var(--font-serif);
  font-size: var(--type-body-small-size);
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0 0 var(--space-2xl);
}

/* Expandable full text */
.post-card__full {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease;
}
.post-card.is-expanded .post-card__full {
  grid-template-rows: 1fr;
}
.post-card__full-inner {
  overflow: hidden;
}
.post-card__body {
  padding-top: var(--space-2xl);
  font-family: var(--font-serif);
  font-size: var(--type-body-small-size);
  line-height: 1.8;
  color: var(--text-secondary);
}
.post-card__body p {
  margin: 0 0 var(--space-2xl);
  text-wrap: pretty;
}
.post-card__body p:last-child { margin-bottom: 0; }
.post-card__body strong {
  color: var(--text-primary);
  font-weight: 600;
}

.post-card__toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin-top: auto;
  padding: var(--space-xs) 0;
  background: transparent;
  border: none;
  font: var(--type-ui-medium-weight) var(--type-ui-size)/1 var(--font-sans);
  color: var(--accent-warm);
  cursor: pointer;
  transition: color 0.15s ease;
}
.post-card__toggle:hover { color: var(--accent); }
.post-card__toggle-icon {
  transition: transform 0.25s ease;
}
.post-card.is-expanded .post-card__toggle-icon {
  transform: rotate(180deg);
}

/* ---- Timeline ----------------------------------------------------------- */

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
}
.timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 11px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-warm), var(--accent));
  opacity: 0.35;
}

.timeline__item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3xl);
  padding-left: var(--space-6xl);
}
.timeline__dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
  flex: none;
}
.timeline__content {
  background: var(--surface);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-large);
  padding: var(--space-3xl);
  flex: 1;
  transition: border-color 0.2s ease;
}
.timeline__content:hover { border-color: var(--accent); }
.timeline__date {
  display: inline-block;
  margin-bottom: var(--space-sm);
  font: var(--type-ui-medium-weight) var(--type-ui-small-size)/1 var(--font-sans);
  color: var(--accent-warm);
}
.timeline__title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin: 0 0 var(--space-sm);
}
.timeline__desc {
  font-family: var(--font-serif);
  font-size: var(--type-body-small-size);
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0;
}

/* ---- Footer ------------------------------------------------------------- */

.site-footer {
  padding: 56px 0 40px;
  background: var(--surface-container);
  border-top: 1px solid var(--border);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xl);
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}
.site-footer__brand img { width: 22px; height: 22px; }

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg) var(--space-4xl);
}
.site-footer__links a {
  font: 400 var(--type-ui-size)/1.5 var(--font-sans);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}
.site-footer__links a:hover { color: var(--text-primary); }

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-lg) var(--space-4xl);
  padding-top: var(--space-3xl);
  border-top: 1px solid var(--border-subtle);
  font: 400 var(--type-ui-small-size)/1.4 var(--font-sans);
  color: var(--text-muted);
}
.site-footer__legal a {
  color: var(--text-muted);
  text-decoration: none;
}
.site-footer__legal a:hover { color: var(--text-primary); text-decoration: underline; }

/* ---- Reduced motion ----------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .hero__aurora-ring { animation: none !important; }
}

/* ---- Responsive --------------------------------------------------------- */

@media (max-width: 860px) {
  .site-nav { display: none; }
  .hero { min-height: 420px; padding: 80px 0 70px; }
  .about-cards,
  .post-list { grid-template-columns: 1fr; }
  .section { padding: 70px 0; }
  .section__title { font-size: 26px; }
}

@media (max-width: 480px) {
  :root { --site-gutter: 20px; }
  .hero__title { font-size: 30px; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__btn { width: 100%; }
  .post-list { grid-template-columns: 1fr; }
  .timeline__item { padding-left: var(--space-5xl); }
  .site-footer__legal { flex-direction: column; align-items: flex-start; gap: var(--space-sm); }
}
