:root {
  --bg: #121116;
  --panel: rgba(30, 27, 35, 0.82);
  --panel-strong: rgba(38, 33, 43, 0.95);
  --line: rgba(255, 255, 255, 0.09);
  --text: #f4edf1;
  --muted: #a99da5;
  --pink: #d9a7b8;
  --pink-soft: #f1d6df;
  --charcoal: #28242c;
  --success: #9dd4b5;
  --danger: #ed9caa;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

/* HTML hidden 속성은 컴포넌트의 display 규칙보다 항상 우선한다. */
[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 15%, rgba(134, 90, 122, 0.18), transparent 33%),
    radial-gradient(circle at 85% 30%, rgba(70, 73, 111, 0.18), transparent 30%),
    linear-gradient(145deg, #0d0c11, #19161d 48%, #111017);
  font-family:
    Pretendard,
    "Noto Sans KR",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.2;
  pointer-events: none;
}

.ambient-one {
  top: -180px;
  right: -100px;
  background: #9d718d;
}

.ambient-two {
  bottom: -240px;
  left: -120px;
  background: #52577b;
}

.site-header,
footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-moon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--pink-soft);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.025);
  font-size: 24px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  letter-spacing: 0.04em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 13px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 12px rgba(157, 212, 181, 0.7);
}

.landing-shell {
  width: min(1180px, calc(100% - 40px));
  min-height: calc(100vh - 180px);
  margin: 18px auto 44px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 36px;
  align-items: center;
}

.hero-panel {
  padding: 28px 10px 28px 0;
}

.eyebrow,
.mini-label {
  color: var(--pink);
  font-weight: 700;
  letter-spacing: 0.16em;
  font-size: 11px;
}

.hero-panel h1,
.dashboard-heading h1 {
  margin: 18px 0;
  font-size: clamp(40px, 6vw, 74px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.hero-panel h1 span {
  color: var(--pink-soft);
}

.hero-copy {
  max-width: 570px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.sayuki-card {
  max-width: 590px;
  margin-top: 34px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.028);
  backdrop-filter: blur(18px);
}

.portrait-wrap {
  position: relative;
  flex: 0 0 66px;
  width: 66px;
  height: 66px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 20px;
  background: linear-gradient(145deg, #61505e, #28242d);
}

.portrait-fallback,
.portrait-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.portrait-fallback {
  display: grid;
  place-items: center;
  color: var(--pink-soft);
  font-size: 26px;
}

.portrait-image {
  object-fit: cover;
}

.character-name {
  margin: 0 0 5px;
  font-weight: 700;
}

.character-line {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.feature-row {
  max-width: 620px;
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.feature-row div {
  padding: 14px;
  border-top: 1px solid var(--line);
}

.feature-row strong,
.feature-row span {
  display: block;
}

.feature-row strong {
  margin-bottom: 5px;
  font-size: 13px;
}

.feature-row span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.auth-panel {
  min-height: 600px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px);
}

.tab-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 5px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.19);
}

.tab-button {
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.tab-button.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.auth-form {
  display: none;
  margin-top: 26px;
}

.auth-form.active {
  display: block;
}

.form-heading {
  margin-bottom: 24px;
}

.form-heading h2,
.welcome-card h2,
.dashboard-card h2 {
  margin: 8px 0;
  font-size: 26px;
  letter-spacing: -0.035em;
}

.form-heading p,
.welcome-card p,
.dashboard-card p,
.dashboard-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.auth-form label {
  display: block;
  margin: 15px 0;
}

.auth-form label > span {
  display: block;
  margin-bottom: 7px;
  color: #d7ccd2;
  font-size: 13px;
}

.auth-form input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: rgba(10, 9, 13, 0.44);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.auth-form input:focus {
  border-color: rgba(217, 167, 184, 0.58);
  box-shadow: 0 0 0 3px rgba(217, 167, 184, 0.08);
}

.auth-form small {
  display: block;
  margin-top: 6px;
  color: #81767d;
  font-size: 11px;
}

.primary-button,
.ghost-button {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  cursor: pointer;
}

.primary-button {
  margin-top: 12px;
  border: 0;
  color: #221a20;
  background: linear-gradient(135deg, var(--pink-soft), var(--pink));
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(160, 103, 128, 0.17);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.link-button {
  display: grid;
  place-items: center;
}

.ghost-button {
  margin-top: 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
}

.ghost-button.compact {
  width: auto;
  min-height: 38px;
  padding: 0 16px;
  margin: 0;
}

.form-message {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 13px;
  line-height: 1.5;
}

.form-message.success {
  color: var(--success);
  border-color: rgba(157, 212, 181, 0.22);
}

.form-message.error {
  color: var(--danger);
  border-color: rgba(237, 156, 170, 0.22);
}

.welcome-card {
  padding-top: 80px;
}

.dashboard-shell {
  width: min(1040px, calc(100% - 40px));
  min-height: calc(100vh - 180px);
  margin: 42px auto;
}

.dashboard-heading h1 {
  font-size: clamp(38px, 6vw, 66px);
}

.dashboard-grid {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-card {
  min-height: 230px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.dashboard-card dl {
  margin: 24px 0 0;
}

.dashboard-card dl div {
  padding: 10px 0;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.dashboard-card dt {
  color: var(--muted);
}

.dashboard-card dd {
  margin: 0;
}

.owner-card {
  background:
    radial-gradient(circle at 80% 20%, rgba(217, 167, 184, 0.13), transparent 35%),
    var(--panel-strong);
}

.owner-card code {
  display: inline-block;
  margin-top: 18px;
  color: var(--pink-soft);
}

footer {
  min-height: 70px;
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  color: #716970;
  font-size: 11px;
}

@media (max-width: 860px) {
  .landing-shell {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    padding-right: 0;
  }

  .auth-panel {
    min-height: auto;
  }

  .feature-row,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .welcome-card {
    padding-top: 16px;
  }
}

@media (max-width: 520px) {
  .site-header,
  footer,
  .landing-shell,
  .dashboard-shell {
    width: min(100% - 24px, 1180px);
  }

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

  .status-pill {
    display: none;
  }

  .hero-panel h1 {
    font-size: 39px;
  }

  .hero-copy {
    font-size: 15px;
  }

  .auth-panel {
    padding: 19px;
    border-radius: 22px;
  }

  .sayuki-card {
    align-items: flex-start;
  }

  footer {
    display: block;
    line-height: 1.8;
  }
}

/* Web 1.1.1 landing polish */
.brand-quiet .brand-copy {
  display: flex;
  align-items: center;
}

.brand-quiet .brand-copy small {
  margin: 0;
  color: #d8ccd3;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.landing-title {
  font-size: clamp(34px, 4vw, 48px) !important;
  line-height: 1.12 !important;
}

.landing-title-line {
  display: block;
  color: var(--text) !important;
  white-space: nowrap;
  word-break: keep-all;
}

.landing-title-accent {
  margin-top: 4px;
  color: var(--pink-soft) !important;
}

@media (max-width: 860px) {
  .landing-title {
    font-size: clamp(34px, 6.2vw, 48px) !important;
  }
}

@media (max-width: 520px) {
  .landing-title {
    font-size: clamp(22px, 6.7vw, 34px) !important;
    letter-spacing: -0.06em !important;
  }
}


/* Public legal pages */
.footer-legal-links {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.footer-legal-links a {
  color: #8d8189;
  text-decoration: none;
  transition: color 0.18s ease;
}

.footer-legal-links a:hover,
.footer-legal-links a:focus-visible {
  color: var(--pink-soft);
}

.legal-shell {
  width: min(980px, calc(100% - 40px));
  margin: 44px auto 88px;
}

.legal-hero {
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 86% 12%, rgba(217, 167, 184, 0.13), transparent 36%),
    var(--panel-strong);
  box-shadow: var(--shadow);
}

.legal-eyebrow {
  margin: 0 0 12px;
  color: var(--pink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.legal-hero h1 {
  margin: 0;
  font-size: clamp(38px, 7vw, 70px);
  letter-spacing: -0.055em;
}

.legal-hero > p:not(.legal-eyebrow) {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
  word-break: keep-all;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.legal-meta span {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #a99ca4;
  background: rgba(255, 255, 255, 0.025);
  font-size: 11px;
}

.legal-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.legal-summary-grid article {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

.legal-summary-grid strong,
.legal-summary-grid span {
  display: block;
}

.legal-summary-grid strong {
  margin-bottom: 8px;
  color: var(--pink-soft);
  font-size: 14px;
}

.legal-summary-grid span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.legal-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(17, 15, 21, 0.68);
  backdrop-filter: blur(16px);
}

.legal-toc a {
  padding: 8px 11px;
  border-radius: 999px;
  color: #b3a7ae;
  background: rgba(255, 255, 255, 0.035);
  text-decoration: none;
  font-size: 12px;
  transition:
    color 0.18s ease,
    background 0.18s ease;
}

.legal-toc a:hover,
.legal-toc a:focus-visible {
  color: var(--text);
  background: rgba(217, 167, 184, 0.12);
}

.legal-card-stack {
  display: grid;
  gap: 14px;
}

.legal-card {
  scroll-margin-top: 96px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
}

.legal-card h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  font-size: clamp(20px, 3vw, 27px);
  letter-spacing: -0.035em;
}

.legal-card h2 span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(217, 167, 184, 0.24);
  border-radius: 12px;
  color: var(--pink-soft);
  background: rgba(217, 167, 184, 0.06);
  font-size: 11px;
  letter-spacing: 0;
}

.legal-card h3 {
  margin: 26px 0 10px;
  color: #dacdd4;
  font-size: 15px;
}

.legal-card p,
.legal-card li {
  color: #aaa0a6;
  font-size: 14px;
  line-height: 1.85;
  word-break: keep-all;
}

.legal-card p {
  margin: 12px 0 0;
}

.legal-card ul {
  margin: 12px 0 0;
  padding-left: 21px;
}

.legal-card li + li {
  margin-top: 6px;
}

.legal-card code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--pink-soft);
  background: rgba(255, 255, 255, 0.04);
}

.legal-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.legal-table th,
.legal-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.7;
}

.legal-table th {
  color: #d9ccd3;
  background: rgba(217, 167, 184, 0.06);
}

.legal-table td {
  color: #a99da4;
}

.legal-table tr:last-child td {
  border-bottom: 0;
}

.legal-table td:first-child,
.legal-table th:first-child {
  width: 28%;
}

.legal-note {
  padding: 12px 14px;
  border-left: 3px solid rgba(217, 167, 184, 0.45);
  background: rgba(217, 167, 184, 0.045);
}

.legal-contact-card {
  background:
    radial-gradient(circle at 82% 20%, rgba(217, 167, 184, 0.1), transparent 34%),
    var(--panel-strong);
}

.legal-related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}

.legal-related-links a {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #cdbfc7;
  background: rgba(255, 255, 255, 0.025);
  text-decoration: none;
  font-size: 12px;
  transition:
    border-color 0.18s ease,
    color 0.18s ease;
}

.legal-related-links a:hover,
.legal-related-links a:focus-visible {
  color: var(--pink-soft);
  border-color: rgba(217, 167, 184, 0.32);
}

@media (max-width: 720px) {
  .legal-summary-grid {
    grid-template-columns: 1fr;
  }

  .legal-shell {
    width: min(100% - 24px, 980px);
    margin-top: 24px;
  }

  .legal-hero,
  .legal-card {
    border-radius: 20px;
  }

  .legal-card h2 {
    align-items: flex-start;
  }

  .global-footer {
    gap: 8px;
  }

  .footer-legal-links {
    display: flex;
    margin: 5px 0;
  }
}
