:root {
  --ink: #141b19;
  --muted: #66736f;
  --paper: #f5f5f2;
  --white: #ffffff;
  --green: #2f6a54;
  --deep: #14211d;
  --blue: #3f6f8f;
  --brass: #a8894f;
  --line: rgba(255, 255, 255, 0.28);
  --line-dark: rgba(20, 27, 25, 0.14);
  --grid: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 50px rgba(8, 17, 14, 0.2);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --t: 180ms;
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

a { color: inherit; }

.home-gate,
.quiet-page {
  min-height: 100vh;
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(20, 33, 29, 0.94), rgba(20, 33, 29, 0.62) 48%, rgba(20, 33, 29, 0.26)),
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    url("/assets/quiet-desk.png") center / cover no-repeat fixed;
  background-size: auto, 96px 96px, 96px 96px, cover;
  position: relative;
  overflow-x: hidden;
}

.home-gate::before,
.quiet-page::before,
.home-gate::after,
.quiet-page::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

.home-gate::before,
.quiet-page::before {
  inset: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(168, 137, 79, 0.12);
}

.home-gate::after,
.quiet-page::after {
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--deep), var(--brass), var(--blue));
}

.gate-shell,
.gate-footer,
.quiet-shell {
  position: relative;
  z-index: 1;
}

.gate-shell {
  width: min(1120px, calc(100% - 48px));
  min-height: calc(100vh - 76px);
  margin: 0 auto;
  padding: 74px 0 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 392px);
  gap: 58px;
  align-items: center;
}

.gate-copy {
  max-width: 680px;
}

.gate-kicker,
.gate-note {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gate-kicker::after {
  content: "";
  display: block;
  width: 54px;
  height: 2px;
  margin-top: 14px;
  background: linear-gradient(90deg, var(--brass), rgba(168, 137, 79, 0));
}

h1 {
  margin: 22px 0 0;
  max-width: 760px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 1.03;
  letter-spacing: 0;
  font-weight: 820;
  overflow-wrap: anywhere;
}

.gate-lead {
  max-width: 620px;
  margin: 26px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(18px, 2vw, 22px);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.gate-note {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
  letter-spacing: 0;
  text-transform: none;
}

.gate-note::before {
  content: "";
  width: 36px;
  height: 1px;
  background: rgba(255, 255, 255, 0.34);
}

.login-panel,
.quiet-card {
  position: relative;
  width: 100%;
  padding: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-panel::before,
.quiet-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(20, 27, 25, 0.07);
  pointer-events: none;
}

.login-panel::after,
.quiet-card::after {
  content: "";
  position: absolute;
  left: 26px;
  right: 26px;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--brass), transparent);
}

.login-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 20px;
}

.login-head h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.1;
}

.login-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field span {
  color: #45534f;
  font-size: 13px;
  font-weight: 740;
}

.field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #d3ddd8;
  border-bottom-color: rgba(47, 106, 84, 0.34);
  border-radius: 8px;
  font: inherit;
  outline: none;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 106, 84, 0.18);
}

.submit,
.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--white);
  background: var(--green);
  text-decoration: none;
  font: inherit;
  font-weight: 760;
  cursor: pointer;
  transition: transform var(--t) var(--ease), background var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.submit {
  width: 100%;
  margin-top: 4px;
  border: 0;
}

.submit::after,
.button::after {
  content: ">";
  margin-left: 10px;
  transform: translateX(-2px);
  transition: transform var(--t) var(--ease);
}

.submit:hover,
.button:hover {
  background: #245843;
  box-shadow: 0 0 0 1px rgba(168, 137, 79, 0.35);
}

.submit:hover::after,
.button:hover::after {
  transform: translateX(2px);
}

.submit:active,
.button:active {
  transform: translateY(1px);
}

.reset-link,
.gate-footer a {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 1px;
  transition: color var(--t) var(--ease), background-size var(--t) var(--ease);
}

.reset-link {
  display: inline-flex;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.reset-link:hover {
  color: var(--ink);
  background-size: 100% 1px;
}

.gate-footer {
  width: min(1120px, calc(100% - 48px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
}

.gate-footer a {
  color: rgba(255, 255, 255, 0.72);
}

.gate-footer a:hover {
  color: var(--white);
  background-size: 100% 1px;
}

.quiet-shell {
  width: min(760px, calc(100% - 48px));
  min-height: calc(100vh - 76px);
  margin: 0 auto;
  padding: 72px 0 42px;
  display: grid;
  align-content: center;
}

.quiet-card {
  padding: 34px;
}

.quiet-card h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.05;
}

.quiet-card p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.quiet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.button {
  padding: 10px 15px;
}

.button.secondary {
  color: var(--ink);
  background: #eef2ef;
}

.button.secondary::after {
  color: var(--green);
}

@media (max-width: 820px) {
  .home-gate,
  .quiet-page {
    background-attachment: scroll;
  }

  .gate-shell {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 34px;
    padding-top: 58px;
  }

  .login-panel {
    max-width: 460px;
  }
}

@media (max-width: 560px) {
  .home-gate::before,
  .quiet-page::before {
    inset: 12px;
  }

  .gate-shell,
  .gate-footer,
  .quiet-shell {
    width: min(calc(100% - 28px), 1120px);
  }

  .gate-shell {
    padding-top: 42px;
  }

  h1 {
    font-size: clamp(34px, 10vw, 42px);
    line-height: 1.08;
  }

  .gate-lead {
    font-size: 17px;
  }

  .login-panel,
  .quiet-card {
    padding: 22px;
  }

  .login-panel::after,
  .quiet-card::after {
    left: 22px;
    right: 22px;
  }

  .login-head {
    display: grid;
    gap: 4px;
  }

  .gate-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
