:root {
  --bg: #0a0a0f;
  --surface: #13131a;
  --border: #22222c;
  --border-strong: #2f2f3a;
  --divider: #1f1f26;
  --text: #e8e8ea;
  --text-muted: #8a8a92;
  --text-dim: #5a5a62;
  --text-faint: #4a4a52;
  --accent: #2B8EFF;
  --accent-dim: #1e6fd9;
  --accent-hover-bg: rgba(43, 142, 255, 0.08);
  --logo-vector: #b8b8c0;
  --modal-backdrop: rgba(0, 0, 0, 0.7);
  --status-error: #ff6b6b;
  --status-success: #4cd8a3;
  --button-text-on-accent: #0a0a0f;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --surface: #f5f5f7;
    --border: #e5e5e9;
    --border-strong: #cfcfd4;
    --divider: #e8e8eb;
    --text: #1a1a1f;
    --text-muted: #6a6a72;
    --text-dim: #8a8a92;
    --text-faint: #b0b0b5;
    --accent: #1e6fd9;
    --accent-dim: #2B8EFF;
    --accent-hover-bg: rgba(30, 111, 217, 0.08);
    --logo-vector: #414042;
    --modal-backdrop: rgba(20, 20, 28, 0.5);
    --status-error: #d63030;
    --status-success: #0f8a55;
    --button-text-on-accent: #ffffff;
  }
}

[data-theme="dark"] {
  --bg: #0a0a0f;
  --surface: #13131a;
  --border: #22222c;
  --border-strong: #2f2f3a;
  --divider: #1f1f26;
  --text: #e8e8ea;
  --text-muted: #8a8a92;
  --text-dim: #5a5a62;
  --text-faint: #4a4a52;
  --accent: #2B8EFF;
  --accent-dim: #1e6fd9;
  --accent-hover-bg: rgba(43, 142, 255, 0.08);
  --logo-vector: #b8b8c0;
  --modal-backdrop: rgba(0, 0, 0, 0.7);
  --status-error: #ff6b6b;
  --status-success: #4cd8a3;
  --button-text-on-accent: #0a0a0f;
}

[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --border: #e5e5e9;
  --border-strong: #cfcfd4;
  --divider: #e8e8eb;
  --text: #1a1a1f;
  --text-muted: #6a6a72;
  --text-dim: #8a8a92;
  --text-faint: #b0b0b5;
  --accent: #1e6fd9;
  --accent-dim: #2B8EFF;
  --accent-hover-bg: rgba(30, 111, 217, 0.08);
  --logo-vector: #414042;
  --modal-backdrop: rgba(20, 20, 28, 0.5);
  --status-error: #d63030;
  --status-success: #0f8a55;
  --button-text-on-accent: #ffffff;
}

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

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  align-items: safe center;
  justify-content: safe center;
  padding: 2rem 1.25rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.container {
  width: 100%;
  max-width: 720px;
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.1s forwards;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.focus {
  flex: 1;
  border-top: 1px solid var(--divider);
  padding-top: 2rem;
  margin-bottom: 2rem;
}

.hero {
  text-align: center;
  margin-bottom: 3rem;
}

.logo {
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
  margin: 0 auto 2rem;
}

.logo-vector {
  fill: var(--logo-vector);
  transition: fill 0.2s ease;
}

.tagline {
  font-size: clamp(1.0625rem, 1.8vw, 1.375rem);
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 1rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.about {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

.focus-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 1.5rem;
}

.focus-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
}

.focus-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
  opacity: 0;
  animation: fadeInUp 0.5s ease-out forwards;
  animation-delay: calc(0.4s + (var(--stagger, 0) * 0.06s));
}

.focus-card:hover {
  border-color: var(--accent);
  background: var(--accent-hover-bg);
}

.focus-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 4px;
}

.focus-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer {
  border-top: 1px solid var(--divider);
  padding-top: 1.5rem;
  text-align: center;
}

.footer p {
  font-size: 0.7rem;
  color: var(--text-faint);
  letter-spacing: 0.05em;
}

.corner-controls {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.theme-toggle,
.contact-trigger {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.contact-trigger {
  padding: 8px 16px;
  font-size: 0.875rem;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover,
.contact-trigger:hover {
  border-color: var(--accent);
  background: var(--accent-hover-bg);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }

@media (prefers-color-scheme: light) {
  .theme-toggle .icon-sun { display: none; }
  .theme-toggle .icon-moon { display: block; }
}

[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.contact-modal[hidden] {
  display: none;
}

.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.contact-modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--modal-backdrop);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.contact-modal-panel {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  animation: modalIn 0.2s ease-out;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.contact-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
}

.contact-modal-close:hover {
  color: var(--text);
  background: var(--surface);
}

.contact-modal h2 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.contact-modal label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  margin-top: 1rem;
}

.contact-modal label:first-of-type {
  margin-top: 0;
}

.contact-modal input,
.contact-modal textarea {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.9375rem;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.contact-modal input:focus,
.contact-modal textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-modal textarea {
  resize: vertical;
  min-height: 100px;
}

.contact-modal .honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.contact-modal #turnstile-widget {
  margin-top: 1.25rem;
}

.contact-form-actions {
  margin-top: 1.25rem;
  display: flex;
  justify-content: flex-end;
}

.contact-form-actions button {
  background: var(--accent);
  color: var(--button-text-on-accent);
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.contact-form-actions button:hover:not(:disabled) {
  background: var(--accent-dim);
}

.contact-form-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.contact-form-status {
  margin-top: 1rem;
  font-size: 0.875rem;
  min-height: 1.2em;
}

.contact-form-status.error {
  color: var(--status-error);
}

.contact-form-status.success {
  color: var(--status-success);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 768px) {
  body {
    display: block;
    padding: 5rem 3rem 3.5rem;
  }

  .footer {
    padding-bottom: 1.5rem;
  }

  .focus-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  body {
    padding: 5rem 1.25rem 3.5rem;
  }

  .logo {
    max-width: 240px;
  }
}

@media (max-width: 420px) {
  .focus-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .container,
  .focus-card,
  .contact-modal-panel {
    animation: none;
    opacity: 1;
  }
}
