:root {
  color-scheme: light;
  --paper: #eeece4;
  --paper-deep: #e5e2d8;
  --ink: #20231f;
  --ink-soft: #65685f;
  --line: rgba(32, 35, 31, 0.2);
  --forest: #33483b;
  --forest-dark: #26372d;
  --cream: #f7f5ef;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --cjk-serif: "Songti SC", "STSong", "Noto Serif CJK SC", "SimSun", serif;
}

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

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.page {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  padding: 0 clamp(24px, 5vw, 76px);
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header {
  min-height: 104px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
  letter-spacing: -0.04em;
}

.family-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-right: 13px;
  border: 1px solid var(--forest);
  color: var(--forest);
  font-family: var(--cjk-serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}

.wordmark-name {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
}

.wordmark-domain {
  margin-left: 3px;
  color: var(--forest);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.privacy-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.privacy-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--forest);
  box-shadow: 0 0 0 4px rgba(51, 72, 59, 0.1);
}

.portal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: stretch;
  width: 100%;
  max-width: 1440px;
  min-height: 580px;
  margin: 0 auto;
}

.introduction {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: clamp(72px, 10vh, 128px) clamp(48px, 8vw, 136px) clamp(72px, 10vh, 128px) 0;
}

.hero-character {
  position: absolute;
  top: 50%;
  right: clamp(20px, 7vw, 110px);
  color: var(--forest);
  font-family: var(--cjk-serif);
  font-size: clamp(250px, 26vw, 410px);
  font-weight: 400;
  line-height: 1;
  opacity: 0.045;
  pointer-events: none;
  transform: translateY(-50%);
  user-select: none;
}

.introduction > :not(.hero-character) {
  position: relative;
  z-index: 1;
}

.section-label {
  margin: 0 0 25px;
  color: var(--forest);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.4;
  text-transform: uppercase;
}

.introduction h1 {
  max-width: 820px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(58px, 7.6vw, 116px);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.88;
}

.introduction-copy {
  max-width: 620px;
  margin: clamp(35px, 5vh, 58px) 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(17px, 1.35vw, 21px);
  line-height: 1.65;
}

.access-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 480px;
  margin: clamp(56px, 8vh, 96px) 0;
  padding: clamp(34px, 4vw, 52px);
  color: var(--cream);
  background: var(--forest);
}

.access-icon,
.dialog-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 50px;
  border: 1px solid rgba(247, 245, 239, 0.28);
  border-radius: 50%;
}

.access-icon svg,
.dialog-icon svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.35;
}

.access-panel .section-label {
  margin-bottom: 18px;
  color: rgba(247, 245, 239, 0.82);
}

.access-panel h2,
.access-dialog h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(34px, 3vw, 48px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1;
}

.access-copy {
  max-width: 280px;
  margin: 22px 0 0;
  color: rgba(247, 245, 239, 0.84);
  font-size: 16px;
  line-height: 1.7;
}

.login-button,
.dialog-action {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 58px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.login-button {
  padding: 0 20px;
  color: var(--forest-dark);
  background: var(--cream);
}

.login-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
  transition: transform 160ms ease;
}

.login-button:hover {
  background: #ffffff;
}

.login-button:hover svg {
  transform: translateX(3px);
}

.site-footer {
  min-height: 78px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.footer-character {
  margin-left: auto;
  padding: 0 14px;
  color: var(--forest);
  font-family: var(--cjk-serif);
  font-size: 13px;
  font-weight: 600;
  opacity: 0.65;
}

.access-dialog {
  width: min(92vw, 470px);
  padding: 46px;
  border: 0;
  color: var(--cream);
  background: var(--forest-dark);
}

.access-dialog::backdrop {
  background: rgba(24, 27, 23, 0.62);
  backdrop-filter: blur(4px);
}

.access-dialog[open] {
  animation: dialog-in 180ms ease-out both;
}

.dialog-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  color: rgba(247, 245, 239, 0.72);
  background: transparent;
  cursor: pointer;
}

.dialog-close svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.4;
}

.dialog-close:hover {
  color: #ffffff;
}

.dialog-icon {
  margin-bottom: 42px;
}

.access-dialog .section-label {
  margin-bottom: 16px;
  color: rgba(247, 245, 239, 0.82);
}

.access-dialog > p:not(.section-label) {
  margin: 24px 0 34px;
  color: rgba(247, 245, 239, 0.86);
  font-size: 16px;
  line-height: 1.75;
}

.dialog-action {
  justify-content: center;
  padding: 0 20px;
  color: var(--cream);
  border-color: rgba(247, 245, 239, 0.3);
  background: transparent;
}

.dialog-action:hover {
  color: var(--forest-dark);
  background: var(--cream);
}

.login-button:focus-visible,
.dialog-close:focus-visible,
.dialog-action:focus-visible,
.wordmark:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px #172019;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 860px) {
  .page {
    padding: 0 clamp(20px, 5vw, 42px);
  }

  .site-header {
    min-height: 88px;
  }

  .portal {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .introduction {
    padding: 82px 0 70px;
  }

  .introduction h1 {
    font-size: clamp(58px, 13vw, 92px);
  }

  .hero-character {
    right: 0;
    font-size: clamp(210px, 42vw, 330px);
  }

  .access-panel {
    min-height: 420px;
    margin: 0 0 72px;
  }
}

@media (max-width: 520px) {
  .page {
    padding: 0 18px;
  }

  .site-header {
    min-height: 76px;
  }

  .wordmark-name {
    font-size: 23px;
  }

  .family-mark {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    font-size: 18px;
  }

  .privacy-mark {
    gap: 8px;
    font-size: 9px;
    letter-spacing: 0.09em;
  }

  .privacy-dot {
    width: 6px;
    height: 6px;
  }

  .introduction {
    padding: 66px 0 55px;
  }

  .section-label {
    margin-bottom: 20px;
    font-size: 10px;
  }

  .introduction h1 {
    font-size: clamp(52px, 17vw, 72px);
    line-height: 0.93;
  }

  .hero-character {
    top: 45%;
    right: -20px;
    font-size: 190px;
    opacity: 0.04;
  }

  .introduction-copy {
    margin-top: 30px;
    font-size: 17px;
    line-height: 1.55;
  }

  .desktop-break {
    display: none;
  }

  .access-panel {
    min-height: 400px;
    margin-bottom: 48px;
    padding: 30px;
  }

  .access-icon {
    margin-bottom: 40px;
  }

  .access-panel h2 {
    font-size: 38px;
  }

  .site-footer {
    min-height: 68px;
  }

  .access-dialog {
    padding: 42px 28px 28px;
  }
}

@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;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #1d211d;
    --paper-deep: #252a25;
    --ink: #f0eee7;
    --ink-soft: #a8aba3;
    --line: rgba(240, 238, 231, 0.17);
    --forest: #405948;
    --forest-dark: #172019;
    --cream: #f4f2ea;
  }
}
