/* he-lo.world — global styles */

:root {
  --color-bg: #fafafa;
  --color-text: #1a1a1a;
  --color-muted: #666;
  --color-border: #e0e0e0;
  --color-focus: #0066cc;
  --font-system: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 600px;
  --spacing: 1.5rem;
}

[data-theme="dark"] {
  --color-bg: #0f0f0f;
  --color-text: #e8e8e8;
  --color-muted: #888;
  --color-border: #2a2a2a;
  --color-focus: #4d9fff;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding: var(--spacing);
  font-family: var(--font-system);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  transition: background 0.2s, color 0.2s;
}

/* Theme toggle */

.theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  cursor: pointer;
  color: var(--color-muted);
  transition: color 0.15s, border-color 0.15s;
  z-index: 1000;
}

.theme-toggle:hover {
  color: var(--color-text);
  border-color: var(--color-muted);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

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

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

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding: var(--spacing);
  font-family: var(--font-system);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 0;
}

/* Typography */

h1 {
  font-size: 1.5rem;
  font-weight: 400;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1rem 0;
}

.tagline {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin-bottom: 3rem;
}

/* Questions (DIY) */

.questions {
  list-style: none;
  padding: 0;
  margin: 0 0 4rem 0;
}

.questions li {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 1.1rem;
}

.questions li:first-child {
  border-top: 1px solid var(--color-border);
}

/* Links */

a {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

a:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* Footer */

footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

footer a {
  color: var(--color-muted);
  font-size: 0.85rem;
  margin-right: 1.5rem;
}

/* CFY Form */

.cfy-form {
  margin-top: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

input[type="email"],
input[type="url"],
textarea {
  width: 100%;
  padding: 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-bg);
  color: var(--color-text);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-focus);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Drop zone */

.drop-zone {
  border: 2px dashed var(--color-border);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--color-muted);
  background: var(--color-border);
}

.drop-zone p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.drop-zone input[type="file"] {
  display: none;
}

.file-name {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--color-text);
}

/* Buttons */

button[type="submit"] {
  padding: 0.75rem 2rem;
  font-family: inherit;
  font-size: 1rem;
  color: #fff;
  background: var(--color-text);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

button[type="submit"]:hover {
  background: #333;
}

button[type="submit"]:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

button[type="submit"]:disabled {
  background: var(--color-muted);
  cursor: not-allowed;
}

/* Microcopy */

.microcopy {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 0.5rem;
}

/* Success/Error states */

.message {
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.message.success {
  background: #e8f5e9;
  color: #2e7d32;
}

.message.error {
  background: #ffebee;
  color: #c62828;
}

[data-theme="dark"] .message.success {
  background: #1b4332;
  color: #95d5b2;
}

[data-theme="dark"] .message.error {
  background: #4a1515;
  color: #f5a5a5;
}

/* Honeypot */

.hp-field {
  position: absolute;
  left: -9999px;
}

/* Systems page */

.systems-header {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.systems-subhead {
  font-size: 1.1rem;
  color: var(--color-muted);
  margin-bottom: 2rem;
}

/* Footnote */

.footnote {
  margin-top: 4rem;
  font-size: 0.75rem;
  color: #999;
  letter-spacing: 0.01em;
}

.footnote a {
  color: #999;
  text-decoration-color: #bbb;
}

.footnote a:hover {
  color: #777;
}

[data-theme="dark"] .footnote {
  color: #555;
}

[data-theme="dark"] .footnote a {
  color: #555;
  text-decoration-color: #444;
}

[data-theme="dark"] .footnote a:hover {
  color: #777;
}

/* Responsive */

@media (max-width: 480px) {
  body {
    padding: var(--spacing) 1rem;
  }
  
  main {
    padding: 2rem 0;
  }
  
  .questions li {
    font-size: 1rem;
  }
}
