:root {
  color-scheme: light;
  --paper: #f4f4f1;
  --ink: #141414;
  --muted: #5c5c56;
  --line: #e3e3dd;
  --card: #fcfcfb;
  --field: #f6f6f3;
  --track: #ecece7;
  --slider: #fcfcfb;
  --on-accent: #f7f7f5;
  --danger: #9f2d22;
  --shadow: 0 22px 48px rgba(20, 20, 18, 0.07);
  --ring: rgba(20, 20, 18, 0.14);
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app { position: relative; z-index: 1; }

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(720px 420px at 0% 0%, rgba(20, 20, 18, 0.045), transparent 60%),
    radial-gradient(640px 380px at 100% 100%, rgba(20, 20, 18, 0.04), transparent 55%);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

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

.skip {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 2;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  background: var(--ink);
  color: var(--on-accent);
  text-decoration: none;
  transform: translateY(-160%);
}

.skip:focus { transform: none; }

.stage {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem 2.4rem;
}

.identity {
  width: max-content;
  max-width: 100%;
  display: grid;
  grid-template-columns: max-content minmax(340px, 400px);
  justify-content: center;
  gap: clamp(3rem, 5vw, 6rem);
  align-items: center;
}

.brand-pane { animation: rise 0.6s cubic-bezier(.32, .72, 0, 1) both; }

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.35rem;
}

.word {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
}

.domain {
  margin: 0.28rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.slogan {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0;
  font-size: clamp(2.75rem, 4.4vw, 4.35rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.96;
}

.slogan span { white-space: nowrap; }

.translations {
  position: relative;
  height: 3.05em;
  margin: 0.95rem 0 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 1.42rem;
  line-height: 1.38;
}

.translation {
  position: absolute;
  left: 0;
  top: 0;
  width: max-content;
  max-width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  transform: translateY(110%);
  opacity: 0;
  transition:
    transform 0.72s cubic-bezier(.32, .72, 0, 1),
    opacity 0.32s linear;
}

.translation span { white-space: nowrap; }

.translation.is-current {
  transform: none;
  opacity: 1;
}

.translation.is-leaving {
  transform: translateY(-110%);
  opacity: 0;
}

.translation.is-prep {
  transition: none;
  transform: translateY(110%);
  opacity: 0;
}

.translation[lang="vi"] { font-family: "Be Vietnam Pro", "Plus Jakarta Sans", sans-serif; font-weight: 600; }
.translation[lang="en"] { font-family: Outfit, "Plus Jakarta Sans", sans-serif; font-weight: 600; letter-spacing: -0.035em; }
.translation[lang="fr"] { font-family: Newsreader, Georgia, serif; font-weight: 560; font-style: italic; }
.translation[lang="es"] { font-family: Manrope, "Plus Jakarta Sans", sans-serif; font-weight: 700; letter-spacing: -0.03em; }
.translation[lang="de"] { font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif; font-weight: 500; }
.translation[lang="pt"] { font-family: Literata, Georgia, serif; font-weight: 600; }
.translation[lang="it"] { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-style: italic; }
.translation[lang="id"] { font-family: Figtree, "Plus Jakarta Sans", sans-serif; font-weight: 600; }
.translation[lang="ja"] { font-family: "Shippori Mincho", "Hiragino Mincho ProN", serif; font-weight: 600; }
.translation[lang="ko"] { font-family: "IBM Plex Sans KR", "Apple SD Gothic Neo", sans-serif; font-weight: 500; }
.translation[lang="zh-Hans"] { font-family: "Noto Serif SC", "Songti SC", serif; font-weight: 600; }
.translation[lang="th"] { font-family: "Noto Sans Thai", Thonburi, sans-serif; font-weight: 600; }

.shell:focus { outline: none; }

.shell {
  padding: 6px;
  border-radius: 28px;
  background: rgba(20, 20, 18, 0.045);
  animation: rise 0.7s 0.06s cubic-bezier(.32, .72, 0, 1) both;
}

.auth-form {
  padding: 1.35rem 1.3rem 1.2rem;
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.auth-form h1 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
  text-wrap: balance;
}

.step {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.sub {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.mode {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.2rem;
  margin-bottom: 1.15rem;
  padding: 0.22rem;
  background: var(--track);
  border-radius: 14px;
}

.mode::before {
  content: "";
  position: absolute;
  top: 0.22rem;
  bottom: 0.22rem;
  left: 0.22rem;
  width: calc(50% - 0.22rem);
  border-radius: 11px;
  background: var(--slider);
  box-shadow: 0 1px 2px rgba(20, 20, 18, 0.08);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(.32, .72, 0, 1);
}

.mode[data-mode="login"]::before { transform: translateX(0); }

.mode button {
  position: relative;
  z-index: 1;
  min-height: 40px;
  border: 0;
  background: transparent;
  border-radius: 11px;
  padding: 0.55rem 0.4rem;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.2s ease;
}

.mode button:hover { color: var(--ink); }

.mode button[aria-selected="true"] {
  color: var(--ink);
  font-weight: 600;
}

.field {
  display: grid;
  gap: 0.4rem;
  margin-top: 1rem;
}

.auth-form label {
  display: block;
  margin: 0.95rem 0 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.auth-form .field label { margin: 0; }

.auth-form input,
.auth-form select {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  padding: 0 0.85rem;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-form input::placeholder { color: #5e5e58; }

.auth-form input:focus,
.auth-form select:focus {
  border-color: var(--ink);
  background: var(--card);
  box-shadow: 0 0 0 4px var(--ring);
  outline: none;
}

.auth-form input:focus-visible,
.auth-form select:focus-visible { outline: none; }

.auth-form input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 1000px var(--field) inset;
}

.split { display: grid; gap: 0.15rem; }

.choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.choices label {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  font-weight: 500;
}

.choices label:has(input:checked) {
  border-color: var(--ink);
  background: var(--card);
  box-shadow: 0 0 0 1px var(--ink);
}

.auth-form .choices input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  padding: 0;
  accent-color: var(--ink);
  border: 0;
  background: transparent;
  box-shadow: none;
}

#code {
  letter-spacing: 0.32em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.providers { display: grid; gap: 0.45rem; }

.provider {
  display: grid;
  grid-template-columns: 1.25rem 1fr 1.25rem;
  align-items: center;
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 0 0.9rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.provider span { text-align: center; font-weight: 600; }

.provider svg { width: 18px; height: 18px; }

.provider:hover {
  border-color: #c8c8c0;
  background: var(--field);
}

.or {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.or::before,
.or::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.fine {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.mark {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  color: var(--ink);
}

.logo {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 13px;
  color: #141414;
}

.logo-dot { fill: #f7f7f5; }

.home .logo { width: 36px; height: 36px; border-radius: 10px; }
.home .word { font-size: 1.15rem; }

.intro h1,
.feed h1,
.panel h2 {
  font-weight: 700;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.intro h1 {
  margin: 0;
  max-width: 11ch;
  font-size: clamp(3rem, 5vw, 5rem);
  line-height: 0.96;
}

.note { color: var(--muted); line-height: 1.5; font-size: 0.95rem; }
.note strong { color: var(--ink); font-weight: 650; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.15rem;
  align-items: center;
}

button.primary,
button.quiet,
button.linkish {
  border: 0;
  background: transparent;
  padding: 0.75rem 0.2rem;
}

.auth-form .primary {
  width: 100%;
  height: 48px;
  margin-top: 0.85rem;
  background: var(--ink);
  color: var(--on-accent);
  border-radius: 12px;
  padding: 0 1rem;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}

.auth-form .primary:hover { background: color-mix(in srgb, var(--ink) 86%, #6d6d68); }

button.primary {
  background: var(--ink);
  color: var(--on-accent);
  border-radius: 12px;
  padding: 0.78rem 1.1rem;
  font-weight: 600;
}

button.quiet,
button.linkish {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

.auth-form .quiet {
  display: block;
  width: 100%;
  margin: 0.85rem auto 0;
  text-align: center;
}

button:disabled { opacity: 0.55; cursor: wait; }

.hint {
  margin: 0.4rem 0 0;
  min-height: 1.2em;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.hint.ok { color: var(--ink); }

.hint.bad { color: var(--danger); }

.error {
  margin: 0;
  color: var(--danger);
  font-size: 0.875rem;
  line-height: 1.4;
}

.home {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.4rem 1.4rem 4rem;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding-bottom: 1.2rem;
}

.clock { margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 680px) minmax(220px, 280px);
  gap: 3.5rem;
  align-items: start;
}

.kicker {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top .actions { margin-top: 0; }

.feed h1 {
  margin: 0 0 1.4rem;
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: 0.98;
  max-width: 14ch;
}

.post { padding: 1.15rem 0; border-top: 1px solid var(--line); }
.post .who { font-weight: 600; }
.post p { margin: 0.35rem 0 0; font-size: 1.12rem; line-height: 1.55; white-space: pre-wrap; }
.post time { color: var(--muted); font-size: 0.85rem; }
.end { color: var(--muted); }
.aside { padding-top: 4.5rem; color: var(--muted); line-height: 1.5; }
.aside strong { color: var(--ink); font-weight: 600; }

textarea {
  width: 100%;
  min-height: 7rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  resize: vertical;
  font: inherit;
  padding: 0.7rem 0;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #121211;
    --ink: #f3f3f0;
    --muted: #b0b0a6;
    --line: #343430;
    --card: #1c1c1a;
    --field: #141413;
    --track: #2a2a27;
    --slider: #3a3a36;
    --on-accent: #141414;
    --danger: #ffb4ab;
    --shadow: 0 22px 48px rgba(0, 0, 0, 0.35);
    --ring: rgba(243, 243, 240, 0.16);
  }

  body::before {
    background:
      radial-gradient(720px 420px at 0% 0%, rgba(255, 255, 255, 0.04), transparent 60%),
      radial-gradient(640px 380px at 100% 100%, rgba(255, 255, 255, 0.03), transparent 55%);
  }

  .shell { background: rgba(255, 255, 255, 0.04); }

  .auth-form input::placeholder { color: #b0b0a6; }

  .provider:hover { border-color: #5a5a54; }

  .logo { color: #f3f3f0; }
  .logo-dot { fill: #141414; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }

  .translations { height: auto; overflow: visible; }
  .translation { display: none; position: static; transform: none; opacity: 1; }
  .translation.is-current { display: flex; }
}

@media (max-width: 860px) {
  .stage { padding: 1.25rem 1rem 1.6rem; align-items: start; }
  .identity {
    width: min(440px, 100%);
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .brand-row { margin-bottom: 0.85rem; }
  .logo { width: 40px; height: 40px; border-radius: 12px; }
  .slogan { font-size: 2.15rem; }
  .translations { font-size: 1.24rem; margin-top: 0.65rem; }
  .identity.is-quiet .slogan,
  .identity.is-quiet .lede { display: none; }
  .identity.is-quiet .brand-row { margin-bottom: 0; }
  .auth-form { padding: 1.1rem 1rem 1rem; }
  .auth-form h1 { font-size: 1.5rem; }
  .layout { grid-template-columns: 1fr; }
  .aside { padding-top: 0; }
  .top { flex-wrap: wrap; }
}

@media (max-width: 380px) {
  .slogan { font-size: 1.9rem; }
}
