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

:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
  --max-width: 640px;
  --radius: 6px;
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-card: #141414;
  --border: #262626;
  --text: #e5e5e5;
  --text-muted: #a3a3a3;
  --accent: #d4d4d4;
  --accent-hover: #ffffff;
  --input-bg: #141414;
  --btn-bg: #e5e5e5;
  --btn-text: #0a0a0a;
  --btn-hover: #ffffff;
}

[data-theme="light"] {
  --bg: #fafafa;
  --bg-card: #ffffff;
  --border: #e5e5e5;
  --text: #171717;
  --text-muted: #525252;
  --accent: #404040;
  --accent-hover: #000000;
  --input-bg: #ffffff;
  --btn-bg: #171717;
  --btn-text: #fafafa;
  --btn-hover: #000000;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 3rem;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s;
}

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

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

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
}

h2 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.intro {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tagline {
  font-size: 1.125rem;
  color: var(--text-muted);
}

.bio {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 48ch;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.2s;
}

.project-card:hover {
  border-color: var(--text-muted);
}

.project-name {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}

.project-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.newsletter-form {
  display: flex;
  gap: 0.5rem;
}

.newsletter-form input[type="email"] {
  flex: 1;
  padding: 0.625rem 0.875rem;
  font-size: 0.9rem;
  font-family: var(--font);
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}

.newsletter-form input[type="email"]::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.newsletter-form input[type="email"]:focus {
  border-color: var(--text-muted);
}

.newsletter-form button {
  padding: 0.625rem 1.25rem;
  font-size: 0.9rem;
  font-family: var(--font);
  font-weight: 500;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.newsletter-form button:hover {
  background: var(--btn-hover);
}

.subscribe-btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  font-size: 0.9rem;
  font-family: var(--font);
  font-weight: 500;
  background: var(--btn-bg);
  color: var(--btn-text);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.2s;
}

.subscribe-btn:hover {
  background: var(--btn-hover);
}

button.subscribe-btn {
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

button.subscribe-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.subscribe-row {
  display: flex;
  gap: 0.5rem;
}

.subscribe-row input[type="email"] {
  flex: 1;
  padding: 0.625rem 0.875rem;
  font-size: 0.9rem;
  font-family: var(--font);
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}

.subscribe-row input[type="email"]::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.subscribe-row input[type="email"]:focus {
  border-color: var(--text-muted);
}

/* Honeypot: kept in the layout for bots but off-screen and out of tab order for humans. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  font-size: 0.85rem;
  min-height: 1.2em;
  margin: 0;
}

.form-status.is-ok {
  color: var(--text-muted);
}

.form-status.is-error {
  color: #ef4444;
}

.newsletter p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  color: var(--text-muted);
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.social-links a:hover {
  color: var(--text);
}

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

footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (min-width: 480px) {
  .page {
    padding: 3rem 2rem;
  }

  h1 {
    font-size: 2.5rem;
  }
}

@media (min-width: 640px) {
  .page {
    padding: 4rem 2rem;
  }
}
