:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #000000;
  --text: #1a1a1a;
  --muted: #666666;
  --faint: #999999;
  --line: #cccccc;
}

/* Auto: follow the device when no choice has been made. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111111;
    --ink: #ffffff;
    --text: #ececec;
    --muted: #a3a3a3;
    --faint: #7a7a7a;
    --line: #3a3a3a;
  }
}

/* Explicit choice wins in both directions. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111111;
  --ink: #ffffff;
  --text: #ececec;
  --muted: #a3a3a3;
  --faint: #7a7a7a;
  --line: #3a3a3a;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.main {
  min-height: calc(100vh - 130px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.container {
  width: 100%;
  min-width: 0;
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.title {
  margin-bottom: 1.5rem;
  line-height: 0;
}

.lockup {
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
  margin: 0 auto;
}

/* Logo swap: light lockup by default, dark lockup on dark ground. */
.lockup-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lockup-light { display: none; }
  :root:not([data-theme="light"]) .lockup-dark { display: block; }
}
:root[data-theme="dark"] .lockup-light { display: none; }
:root[data-theme="dark"] .lockup-dark { display: block; }

.subtitle {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 300;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--ink);
}

.subtitle strong {
  font-weight: 700;
}

.sub-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 1.5rem;
  color: var(--muted);
}

/* Contact toggle button */
.contact-toggle {
  display: inline-block;
  color: var(--ink);
  background: none;
  font-family: inherit;
  font-size: 1.125rem;
  font-weight: 500;
  padding: 0.75rem 2rem;
  border: 2px solid var(--ink);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.contact-toggle:hover,
.contact-toggle.is-active {
  background-color: var(--ink);
  color: var(--bg);
}

.contact-toggle:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* Contact reveal panel */
.contact-reveal {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease 0.1s;
}

.contact-reveal.is-open {
  max-height: 200px;
  opacity: 1;
  margin-top: 2.5rem;
}

.contact-links {
  font-size: 1.1rem;
  color: var(--muted);
}

.contact-links a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

.contact-links a:hover {
  color: var(--muted);
}

.footer {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}

.footer > .container > p {
  margin: 0;
}

/* Appearance setting */
.theme-switch {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--faint);
}

.theme-option {
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  color: var(--faint);
  cursor: pointer;
  padding: 0.25rem 0.1rem;
  transition: color 0.2s ease;
}

.theme-option:hover {
  color: var(--ink);
}

.theme-option[aria-pressed="true"] {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.theme-option:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 2px;
}

.theme-dot {
  color: var(--line);
  margin: 0 0.35rem;
}

@media (max-width: 768px) {
  .main {
    padding: 1.5rem;
  }

  .footer {
    padding: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-toggle,
  .contact-reveal,
  .contact-links a,
  .theme-option {
    transition: none;
  }
}
