:root {
  --bg: #f4eee6;
  --paper: #fffdf8;
  --ink: #2c241f;
  --dark: #2c241f;
  --muted: #6f6259;
  --muted2: #6b5d54;
  --line: #dfd2c4;
  --accent: #c77f57;
  --accent2: #8c432e;
  --danger: #a83832;
}

html { background: var(--bg); }
body {
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 4%, rgba(221, 170, 124, .18), transparent 32rem),
    radial-gradient(circle at 8% 85%, rgba(181, 119, 81, .11), transparent 30rem),
    var(--bg);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid #b45d3d;
  outline-offset: 3px;
}
.skip-link {
  position: fixed;
  z-index: 200;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  transform: translateY(-160%);
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
}
.skip-link:focus { transform: translateY(0); }

.page {
  width: min(1600px, 100%);
  padding: 0 clamp(20px, 3.6vw, 60px) 20px;
}
.nav {
  min-height: 86px;
  border-color: rgba(83, 62, 47, .14);
}
.brand { gap: 12px; }
.mark {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 11px;
  background: #2d2420;
  box-shadow: none;
}
.brand-copy strong { font-size: 15px; letter-spacing: .16em; }

.main {
  grid-template-columns: minmax(0, 1.5fr) minmax(350px, .8fr);
  gap: 20px;
  align-items: stretch;
  padding: 24px 0 26px;
}
.story {
  position: relative;
  isolation: isolate;
  min-height: 618px;
  max-width: none;
  padding: clamp(32px, 4vw, 58px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  border-radius: 28px;
  color: #fff8ee;
  background:
    radial-gradient(circle at 88% 24%, rgba(197, 123, 81, .24), transparent 27rem),
    linear-gradient(140deg, #3b2b24 0%, #312823 58%, #443025 100%);
}
.story::before {
  position: absolute;
  z-index: -1;
  width: 620px;
  height: 620px;
  top: -190px;
  right: -210px;
  border: 1px solid rgba(255, 233, 204, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 84px rgba(255, 233, 204, .035), 0 0 0 168px rgba(255, 233, 204, .026);
  content: "";
}
.story::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image: linear-gradient(115deg, transparent 48%, rgba(255, 245, 231, .035) 48.1%, transparent 48.2%);
  pointer-events: none;
  content: "";
}
.story-core { position: relative; z-index: 1; margin: auto 0; }
h1 {
  max-width: 880px;
  margin: 0;
  color: #fffaf2;
  font-size: clamp(58px, 6.4vw, 104px);
  line-height: 1.12;
  letter-spacing: -.075em;
  text-wrap: balance;
}
h1 em { color: #dfaa84; white-space: normal; }
.lead {
  max-width: 530px;
  margin-top: 30px;
  color: #dfd0c1;
  font-size: clamp(16px, 1.35vw, 19px);
  line-height: 1.7;
}
.story-actions { margin-top: 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.story-actions a { min-height: 52px; padding: 0 22px; display: inline-flex; align-items: center; gap: 22px; border-radius: 999px; font-size: 14px; font-weight: 700; transition: background .18s, border-color .18s; }
.story-secondary { border: 1px solid rgba(255, 239, 218, .35); color: #fff4e8; }
.story-secondary:hover { border-color: rgba(255, 239, 218, .7); background: rgba(255, 255, 255, .06); }
.story-actions a:active, .primary:active, .secondary:active { filter: brightness(.9); }
.story-actions span { font-size: 18px; }

.auth {
  min-height: 618px;
  max-width: none;
  padding: clamp(28px, 3vw, 42px);
  display: flex;
  flex-direction: column;
  border: 1px solid #e3d8cb;
  border-radius: 28px;
  background: rgba(255, 253, 248, .92);
  box-shadow: 0 16px 60px rgba(78, 54, 35, .07);
}
.auth::before { display: none; }
#guest-view, #member-view { display: flex; flex: 1; flex-direction: column; }
.auth-head { margin: 14px 0 30px; }
.auth-head h2 { color: #30251e; font-size: clamp(29px, 2.5vw, 36px); }
.auth-head p { margin-top: 12px; color: #6b5d54; font-size: 14px; }
.tabs { margin-bottom: 28px; background: #f2ebe3; }
.tab { min-height: 46px; color: #6e5c4e; font-size: 14px; }
.tab[aria-selected=true] { background: #fffdf8; box-shadow: 0 2px 9px rgba(74, 54, 37, .08); }
.form { gap: 17px; }
label { color: #3d3129; font-size: 13px; }
.field-top a { font-size: 12px; }
input[type=email], input[type=password], input[type=text] { min-height: 52px; border-color: #d4c6b8; background: #fffefa; font-size: 16px; }
.pass { width: 44px; height: 44px; right: 4px; color: #6b5141; font-size: 12px; }
.agreement { color: #64564e; font-size: 12px; }
.agreement input { width: 18px; height: 18px; }
.agreement a { color: #82412f; }
.primary, .secondary { min-height: 54px; border-radius: 12px; font-size: 14px; }
.primary { background: #34251e; }
.primary:hover { background: #543726; transform: none; }
.secondary { border-color: #cdb9a8; }
.register-panel { padding-top: 0; }
.register-intro { margin: 0 0 20px; color: #6a5a50; font-size: 14px; line-height: 1.6; }
.register-notes { margin-top: 16px; }
.register-notes li { color: #6c5c51; font-size: 12px; }
.register-notes li::before { color: #9c5939; }
.auth-help { margin-top: auto; padding-top: 24px; border-top: 1px solid #e7dcd0; color: #77685d; font-size: 12px; line-height: 1.6; }
.support-trigger { min-height: 44px; padding: 0; border: 0; color: #89442e; background: none; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.support-dialog { width: min(360px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 26px; border: 1px solid #e3d8cb; border-radius: 22px; color: #30251e; background: #fffdf8; box-shadow: 0 24px 80px rgba(35, 24, 18, .22); }
.support-dialog::backdrop { background: rgba(35, 24, 18, .52); backdrop-filter: blur(3px); }
.support-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.support-dialog h2 { margin: 0; font-size: 23px; line-height: 1.3; }
.support-close { width: 44px; height: 44px; flex: 0 0 44px; padding: 0; border: 0; border-radius: 50%; color: #5b4a3e; background: #f4eee6; font-size: 26px; line-height: 1; cursor: pointer; }
.support-close:hover { background: #eaded0; }
.support-dialog p { margin: 22px 0 10px; color: #6b5d54; font-size: 14px; }
.support-group { min-height: 52px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #e2cdbb; border-radius: 12px; color: #85432e; background: #fff7ef; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.support-group:hover { background: #f9eee4; }
.support-copy { min-height: 44px; padding: 8px; border: 0; border-radius: 8px; color: inherit; background: transparent; font: inherit; cursor: pointer; }
.support-copy:hover { background: #eaded0; }
.support-copy:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.support-dialog .support-copy-status { margin: 8px 0 0; line-height: 1.5; }
.member-state { background: #f9eee4; border-color: #e4cbb7; }
.member-state div { min-width: 0; overflow-wrap: anywhere; }
.member-dot { background: #ba774f; box-shadow: 0 0 0 5px rgba(186, 119, 79, .13); }
.member-links { margin-top: auto; }
#member-view .auth-help { margin-top: 24px; }

.footer { min-height: 66px; border-color: rgba(83, 62, 47, .14); color: #6d5d51; font-size: 12px; }
.modal { background: rgba(25, 18, 15, .76); }
.modal-card { background: #fffaf2; }

@media (max-width: 1030px) {
  .page { padding-inline: 22px; }
  .main { grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr); gap: 16px; }
  .story { min-height: 590px; padding: 38px; }
  .auth { min-height: 590px; padding: 32px; }
  h1 { font-size: clamp(54px, 7vw, 82px); }
}
@media (max-width: 800px) {
  .main { grid-template-columns: 1fr; gap: 16px; padding: 18px 0 24px; }
  .story { min-height: 540px; }
  .auth { width: 100%; min-height: auto; }
  .auth-head { margin-top: 14px; }
  .auth-help { margin-top: 32px; }
  .member-links { margin-top: 28px; }
}
@media (max-width: 640px) {
  .page { padding: 0 14px 16px; }
  .nav { min-height: 72px; }
  .brand-copy strong { font-size: 12px; letter-spacing: .1em; }
  .main { display: grid; gap: 14px; padding: 14px 0 24px; }
  .story { display: flex; min-height: 500px; padding: 28px 24px; border-radius: 23px; }
  .story::before { width: 370px; height: 370px; top: -82px; right: -205px; box-shadow: 0 0 0 55px rgba(255, 233, 204, .035), 0 0 0 110px rgba(255, 233, 204, .026); }
  .story-core { margin: auto 0; }
  h1 { margin: 0; font-size: clamp(49px, 12.8vw, 66px); line-height: 1.13; }
  .lead { margin-top: 22px; font-size: 16px; line-height: 1.55; }
  .story-actions { margin-top: 27px; gap: 10px; }
  .story-actions a { min-height: 48px; padding: 0 16px; gap: 12px; font-size: 13px; }
  .auth { padding: 27px 22px; border-radius: 23px; }
  .auth-head { margin: 8px 0 24px; }
  .auth-head h2 { font-size: 30px; }
  .footer { align-items: flex-start; gap: 13px; }
}
@media (max-width: 360px) {
  .story { padding-inline: 20px; }
  h1 { font-size: 46px; }
  .story-actions a { padding-inline: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
