:root {
  --bg-page: #EDF2EE;
  --bg-surface: #FCFDF9;
  --bg-guide: #E3EBE5;
  --primary: #365F50;
  --primary-hover: #284A3D;
  --ink: #263F38;
  --ink-muted: #596D64;
  --bronze: #98815B;
  --border-jade: #CCD8CE;
  --border-jade-strong: #A6BAB0;
  --error: #A13333;
  --error-bg: #FDF3F2;
  --success: #286747;
  --success-bg: #EBF4EE;
  --font-serif: "Noto Serif", "Times New Roman", "Cambria", serif;
  --font-sans: "Noto Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius-card: 12px;
  --radius-control: 8px;
  --shadow-card: 0 12px 32px rgba(38, 63, 56, 0.06);
}

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

html {
  -webkit-text-size-adjust: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-page);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: clip;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

button, input {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-jade);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  height: 72px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
  flex: 1 1 auto;
}

.brand:hover {
  text-decoration: none;
  color: var(--ink);
}

.brand-seal {
  width: 42px;
  height: 42px;
  border: 1.5px solid var(--bronze);
  border-radius: 7px;
  background: var(--bg-surface);
  color: var(--bronze);
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.2px;
}

.brand-sub {
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--bronze);
  margin-top: 2px;
  font-weight: 600;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 15px;
  border-radius: 8px;
  color: var(--ink-muted);
  font-weight: 500;
  font-size: 15px;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--bg-guide);
  color: var(--ink);
  text-decoration: none;
}

.nav-link.is-active {
  color: var(--primary);
  background: var(--bg-guide);
  font-weight: 600;
}

.nav-account {
  margin-left: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border-jade-strong);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nav-account:hover,
.nav-account.is-active {
  background: var(--bg-guide);
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--bg-page);
  border: 1px solid var(--border-jade-strong);
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.mobile-drawer {
  display: none;
  border-top: 1px solid var(--border-jade);
  background: var(--bg-surface);
  padding: 12px 20px 16px;
}

.mobile-drawer.is-open {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-drawer a {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 500;
}

.mobile-drawer a.is-active {
  background: var(--bg-guide);
  color: var(--primary);
  font-weight: 600;
}

/* Hero Landscape Strip (kept untouched in framing) */
.hero-strip {
  position: relative;
  width: 100%;
  height: 184px;
  overflow: hidden;
  border-bottom: 1px solid var(--border-jade);
  background: var(--bg-surface);
}

.hero-strip picture,
.hero-strip img {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-strip img {
  object-fit: cover;
  object-position: center 52%;
}

.hero-strip::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(252, 253, 249, 0.16) 0%,
    rgba(252, 253, 249, 0) 22%,
    rgba(237, 242, 238, 0) 78%,
    rgba(237, 242, 238, 0.42) 100%
  );
}

/* Main Content Containers */
.main-shell {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 28px 24px;
  position: relative;
  z-index: 2;
}

/* Home 2-column Layout */
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) 460px;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 12px;
}

.hero-heading {
  font-family: var(--font-serif);
  font-size: 40px;
  line-height: 1.26;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--ink);
}

.hero-lead {
  margin: 0 0 26px;
  font-size: 17px;
  line-height: 1.72;
  color: var(--ink-muted);
  max-width: 560px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 22px;
  border-radius: var(--radius-control);
  font-weight: 600;
  font-size: 15.5px;
  border: 1px solid transparent;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #FFFFFF;
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: wait;
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-jade-strong);
}

.btn-secondary:hover {
  background: var(--bg-guide);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-full {
  width: 100%;
}

/* Unified 3-step onboarding strip on pale jade background */
.steps-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--bg-guide);
  border: 1px solid var(--border-jade);
  border-radius: 10px;
  margin-bottom: 24px;
  overflow: hidden;
}

.step-col {
  padding: 18px 20px;
  position: relative;
}

.step-col + .step-col {
  border-left: 1px solid var(--border-jade);
}

.step-num {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--bronze);
  margin-bottom: 6px;
}

.step-col h3 {
  font-family: var(--font-serif);
  font-size: 16.5px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--ink);
}

.step-col p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-muted);
}

.section-rule {
  height: 1px;
  background: linear-gradient(to right, var(--bronze), var(--border-jade) 45%, transparent);
  opacity: 0.45;
  margin: 0 0 18px;
}

.community-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.community-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-right: 4px;
}

.chip-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  min-height: 38px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border-jade-strong);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
}

.chip-link:hover {
  border-color: var(--primary);
  background: var(--bg-guide);
  color: var(--primary);
  text-decoration: none;
}

/* Surface Cards (lighter than #EDF2EE background, subtle shadow, crisp jade border, no heavy bronze top bar) */
@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-jade);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 32px 34px;
  animation: cardReveal 280ms ease-out 1;
}

.card-narrow {
  max-width: 460px;
  margin: 12px auto 0;
}

.card-medium {
  max-width: 640px;
  margin: 12px auto 0;
}

.card-wide {
  max-width: 960px;
  margin: 0 auto;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 27px;
  line-height: 1.3;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--ink);
}

.card-sub {
  margin: 0 0 22px;
  font-size: 15px;
  color: var(--ink-muted);
}

/* Auth Tabs */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-jade);
  margin-bottom: 22px;
  gap: 26px;
}

.auth-tab {
  padding: 10px 2px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.auth-tab:hover {
  color: var(--ink);
  text-decoration: none;
}

.auth-tab.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* Forms */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.form-hint {
  margin: 5px 0 0;
  font-size: 13px;
  color: var(--ink-muted);
}

.form-hint-spaced {
  margin: 4px 0 18px;
}

.form-input {
  width: 100%;
  height: 48px;
  padding: 10px 14px;
  background: #FFFFFF;
  border: 1px solid var(--border-jade);
  border-radius: var(--radius-control);
  color: var(--ink);
  font-size: 15.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input::placeholder {
  color: #82948B;
  font-size: 14px;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(54, 95, 80, 0.14);
}

.form-input.has-error {
  border-color: var(--error);
}

.password-wrap {
  position: relative;
}

.password-wrap .form-input {
  padding-right: 64px;
}

.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 48px;
  height: 36px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 600;
}

.pw-toggle:hover {
  background: var(--bg-guide);
  color: var(--ink);
}

.field-error {
  margin: 5px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--error);
}

.form-links-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 4px 0 20px;
  font-size: 14px;
}

.card-footer-link {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-jade);
  text-align: center;
  font-size: 14px;
  color: var(--ink-muted);
}

/* Alerts */
.alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert-error {
  background: var(--error-bg);
  border-color: #E7C2BF;
  color: var(--error);
}

.alert-success {
  background: var(--success-bg);
  border-color: #BED9C5;
  color: var(--success);
}

.alert-info {
  background: var(--bg-guide);
  border-color: var(--border-jade);
  color: var(--ink);
}

.is-hidden {
  display: none !important;
}

/* Download Page */
.page-header {
  max-width: 960px;
  margin: 0 auto 26px;
}

.download-grid {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.download-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-jade);
  border-radius: var(--radius-card);
  padding: 26px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.download-card h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  margin: 0 0 6px;
  color: var(--ink);
}

.download-card p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-muted);
}

.download-guide {
  max-width: 960px;
  margin: 24px auto 0;
  background: var(--bg-guide);
  border: 1px solid var(--border-jade);
  border-radius: var(--radius-card);
  padding: 24px 28px;
}

.download-guide h2 {
  font-family: var(--font-serif);
  font-size: 21px;
  margin: 0 0 12px;
}

.guide-list {
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.8;
}

.download-guide .community-strip {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-jade);
}

/* Account Dashboard */
.account-layout {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.profile-rows {
  margin: 18px 0 22px;
  border-top: 1px solid var(--border-jade);
}

.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-jade);
  font-size: 14.5px;
}

.profile-row-label {
  color: var(--ink-muted);
}

.profile-row-value {
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
  text-align: right;
}

.side-box {
  margin-top: 18px;
  background: var(--bg-guide);
  border: 1px solid var(--border-jade);
  border-radius: var(--radius-card);
  padding: 20px;
}

.side-box h3 {
  font-family: var(--font-serif);
  font-size: 17px;
  margin: 0 0 10px;
}

.side-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14.5px;
}

.action-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.action-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  background: var(--bg-guide);
  border: 1px solid var(--border-jade);
  border-radius: 10px;
  color: var(--ink);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.action-item:hover {
  border-color: var(--primary);
  background: #DCE7DF;
  text-decoration: none;
}

.action-item strong {
  display: block;
  font-size: 15.5px;
  color: var(--ink);
  margin-bottom: 3px;
}

.action-item span {
  font-size: 13.5px;
  color: var(--ink-muted);
}

.action-arrow {
  font-size: 18px;
  color: var(--primary);
  flex-shrink: 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--primary);
}

/* Footer Scenic Decoration (bottom of page content, above footer) */
.footer-scenic {
  position: relative;
  width: 100%;
  height: clamp(180px, 16vw, 240px);
  margin-top: 8px;
  background-color: var(--bg-page);
  background-image:
    linear-gradient(to bottom, #EDF2EE 0%, rgba(237, 242, 238, 0.72) 24%, rgba(237, 242, 238, 0) 56%),
    url('/static/img/footer-landscape.webp');
  background-size: 100% 100%, min(100%, 1920px) auto;
  background-position: center top, center bottom;
  background-repeat: no-repeat;
  pointer-events: none;
  overflow: hidden;
  user-select: none;
}

@keyframes mistDrift {
  0% {
    transform: translate3d(-4%, 0, 0);
  }
  100% {
    transform: translate3d(4%, 0, 0);
  }
}

.mist-layer {
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: 0;
  height: 76px;
  background: radial-gradient(ellipse 46% 80% at 28% 100%, rgba(252, 253, 249, 0.34), transparent 72%),
              radial-gradient(ellipse 44% 85% at 74% 100%, rgba(252, 253, 249, 0.30), transparent 72%);
  animation: mistDrift 42s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes leafGlideLeft {
  0% {
    opacity: 0;
    transform: translate3d(0, -18px, 0) rotate(-10deg);
  }
  15% {
    opacity: 0.45;
  }
  80% {
    opacity: 0.35;
  }
  100% {
    opacity: 0;
    transform: translate3d(44px, 190px, 0) rotate(28deg);
  }
}

@keyframes leafGlideRight {
  0% {
    opacity: 0;
    transform: translate3d(0, -16px, 0) rotate(12deg);
  }
  18% {
    opacity: 0.4;
  }
  82% {
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: translate3d(-38px, 185px, 0) rotate(-26deg);
  }
}

.leaf-item {
  position: absolute;
  top: 10px;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.leaf-1 {
  left: 4%;
  animation: leafGlideLeft 24s linear infinite;
}

.leaf-2 {
  left: 9%;
  animation: leafGlideLeft 29s linear 7s infinite;
}

.leaf-3 {
  right: 5%;
  animation: leafGlideRight 26s linear 3s infinite;
}

.leaf-4 {
  right: 10%;
  animation: leafGlideRight 32s linear 12s infinite;
}

body.effects-paused .mist-layer,
body.effects-paused .leaf-item {
  animation-play-state: paused !important;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-jade);
  background: var(--bg-surface);
  position: relative;
  z-index: 2;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  font-size: 13.5px;
  color: var(--ink-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links a {
  color: var(--ink-muted);
}

.footer-links a:hover {
  color: var(--primary);
}

/* Large Desktop Polish (100% zoom 1920x1080) */
@media (min-width: 1500px) {
  .main-shell {
    padding-top: 48px;
    padding-bottom: 20px;
  }
}

/* Responsive Breakpoints */
@media (max-width: 960px) {
  .home-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    align-items: start;
  }

  .account-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  body {
    font-size: 15px;
  }

  .header-inner {
    height: 60px;
    padding: 0 16px;
    gap: 10px;
  }

  .brand {
    gap: 10px;
  }

  .brand-seal {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .brand-title {
    font-size: 14.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-sub {
    font-size: 9px;
    letter-spacing: 0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .site-nav {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    flex-shrink: 0;
  }

  .hero-strip {
    height: 104px;
  }

  .hero-strip img {
    object-position: 22% 52%;
  }

  .main-shell {
    padding: 24px 16px 18px;
  }

  .footer-scenic {
    height: 112px;
    background-image:
      linear-gradient(to bottom, #EDF2EE 0%, rgba(237, 242, 238, 0.78) 28%, rgba(237, 242, 238, 0) 62%),
      url('/static/img/footer-landscape-mobile.webp');
    background-size: 100% 100%, 100% auto;
    background-position: center top, center bottom;
  }

  .mist-layer,
  .leaf-item {
    display: none;
  }

  .intro-col,
  .card,
  .steps-strip,
  .download-card,
  .download-guide,
  .form-group,
  .password-wrap {
    min-width: 0;
    max-width: 100%;
  }

  .hero-heading {
    font-size: 27px;
  }

  .hero-lead {
    font-size: 15.5px;
  }

  .steps-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .step-col + .step-col {
    border-left: 0;
    border-top: 1px solid var(--border-jade);
  }

  .download-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-grid-2 {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .card {
    padding: 24px 18px;
  }

  .form-input {
    font-size: 16px;
    height: 48px;
  }

  .footer-inner {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .mist-layer,
  .leaf-item {
    animation: none !important;
    transition: none !important;
  }

  .mist-layer,
  .leaf-item {
    display: none;
  }
}
