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

:root {
  --color-bg: #06060e;
  --color-bg-header: #0e0c1a;
  --color-bg-card: #080810;
  --color-bg-visual: #0a0916;
  --color-wordmark: #FFB000;
  --color-primary: #FFB000;
  --color-accent: #FF4500;
  --color-btn-ghost: #FF8C00;
  --color-text-dim: #7a7080;
  --color-heading: #FFD060;
  --color-footer: #6a6070;
  --color-border: #FFB00022;
  --color-border-mid: #FFB00033;
  --color-scanline: rgba(0, 0, 0, 0.08);
  --color-vignette: rgba(0, 0, 0, 0.5);
}

body {
  font-family: 'Share Tech Mono', monospace;
  background: var(--color-bg);
  color: var(--color-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Scanlines */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    var(--color-scanline) 3px,
    var(--color-scanline) 4px
  );
  pointer-events: none;
  z-index: 100;
}

/* Vignette */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 70%, var(--color-vignette) 100%);
  pointer-events: none;
  z-index: 99;
}

a {
  text-decoration: none;
}

/* ── Accessibility utilities ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -999px;
  left: 1rem;
  padding: 0.45rem 1.1rem;
  background: var(--color-primary);
  color: var(--color-bg);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  z-index: 200;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* ── Header ── */
header {
  background: linear-gradient(180deg, var(--color-bg-header) 0%, var(--color-bg) 100%);
  padding: 1.5rem 3rem;
  border-bottom: 1px solid var(--color-border-mid);
  position: relative;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, #FFB000 25%, #FF4500 75%, transparent 100%);
}

.wordmark {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--color-wordmark);
  letter-spacing: -0.01em;
  line-height: 1;
  text-shadow:
    0 0 6px #FFB000aa,
    0 0 16px #FFB00033;
}

.wordmark a {
  color: inherit;
}

.wordmark span {
  color: var(--color-accent);
  text-shadow:
    0 0 6px #FF4500aa,
    0 0 16px #FF450033;
}

.header-links {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.header-links a {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  padding: 0.45rem 1.1rem;
  border: 1px solid;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: #FFB00011;
  text-shadow: 0 0 6px #FFB00077;
}

.btn-ghost {
  color: var(--color-btn-ghost);
  border-color: color-mix(in srgb, var(--color-btn-ghost) 33%, transparent);
  text-shadow: 0 0 5px color-mix(in srgb, var(--color-btn-ghost) 33%, transparent);
}

/* ── Main section ── */
.section {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 3rem 3rem;
}

.section h2 {
  font-size: 0.7rem;
  color: var(--color-accent);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-shadow: 0 0 6px #FF450044;
  font-weight: normal;
}

.section h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, #FF450044, transparent);
}

/* ── Section body text ── */
.section-body {
  font-size: 0.9rem;
  color: var(--color-text-dim);
  line-height: 1.75;
  margin-bottom: 0.75rem;
}

.section-body a {
  color: var(--color-primary);
  text-shadow: 0 0 5px #FFB00066;
}

.section-body a:hover {
  text-shadow: 0 0 10px #FFB000cc;
}

.section-body:last-of-type {
  margin-bottom: 2.5rem;
}

/* ── Project cards ── */
.project-card {
  display: grid;
  grid-template-columns: 130px 1fr;
  border: 1px solid var(--color-border);
  margin-bottom: 1.25rem;
  background: var(--color-bg-card);
  overflow: hidden;
  position: relative;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
}

.project-card:last-child {
  margin-bottom: 0;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, #FFB00055, #FF450022 50%, transparent);
  z-index: 1;
}

.project-visual {
  background: var(--color-bg-visual);
  border-right: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.6rem;
  padding: 2rem 1rem;
}

.project-visual .icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 0 6px #FFB00044);
}


.project-body {
  padding: 1.6rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-sub {
  font-size: 0.62rem;
  color: var(--color-accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  text-shadow: 0 0 5px #FF450044;
}

.project-body h3 {
  font-size: 1.15rem;
  font-weight: normal;
  color: var(--color-heading);
  margin-bottom: 0.6rem;
  text-shadow: 0 0 6px #FFB00066;
  letter-spacing: 0.03em;
}

.project-body p {
  font-size: 0.75rem;
  color: var(--color-text-dim);
  line-height: 1.75;
  margin-bottom: 0.9rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.tag {
  font-size: 0.58rem;
  color: var(--color-primary);
  background: #FFB00011;
  padding: 0.18rem 0.5rem;
  border: 1px solid #FFB00033;
  letter-spacing: 0.05em;
}

.project-links {
  display: flex;
  gap: 1.1rem;
}

.project-links a {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.link-primary {
  color: var(--color-primary);
  text-shadow: 0 0 5px #FFB00066;
}


/* ── Hover / focus states ── */
.btn-primary:hover {
  background: #FFB00022;
  box-shadow: 0 0 10px #FFB00033;
}

.btn-ghost:hover {
  background: color-mix(in srgb, var(--color-btn-ghost) 7%, transparent);
  border-color: color-mix(in srgb, var(--color-btn-ghost) 67%, transparent);
}

.link-primary:hover {
  text-shadow: 0 0 10px #FFB000cc;
}


a:focus-visible,
button:focus-visible {
  outline: 1px solid var(--color-primary);
  outline-offset: 3px;
}

/* ── Footer ── */
footer {
  padding: 1.5rem 3rem;
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, #FFB000 25%, #FF4500 75%, transparent 100%);
}

.footer-inner {
  width: 100%;
  font-size: 0.65rem;
  color: var(--color-footer);
  letter-spacing: 0.12em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  header {
    padding: 1.25rem;
  }

  .header-inner {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .header-links {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .header-links a {
    font-size: 0.72rem;
    padding: 0.4rem 0.75rem;
  }

  .section {
    padding: 2rem 1.25rem 2rem;
  }

  .project-card {
    grid-template-columns: 1fr;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  }

  .project-visual {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding: 1.25rem 1.5rem;
    flex-direction: row;
    gap: 1rem;
    min-height: unset;
  }

  .project-visual .icon {
    font-size: 2rem;
  }

  .contact-form {
    padding: 1.25rem;
  }

  footer {
    padding: 1.25rem;
  }
}

/* ── Contact form ── */
.contact-form {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  padding: 2rem;
  position: relative;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
}

.contact-form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, #FFB00055, #FF450022 50%, transparent);
  z-index: 1;
}

.form-field {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.62rem;
  color: var(--color-accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  text-shadow: 0 0 5px #FF450044;
}

.form-input {
  width: 100%;
  background: var(--color-bg-visual);
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.82rem;
  padding: 0.6rem 0.75rem;
  outline: none;
}

.form-input:focus {
  border-color: #FFB00066;
  box-shadow: 0 0 8px #FFB00022;
}

textarea.form-input {
  resize: vertical;
  min-height: 120px;
}

.btn-submit {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  padding: 0.45rem 1.1rem;
  border: 1px solid;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  cursor: pointer;
  background: none;
  display: inline-block;
  text-decoration: none;
}

.form-honeypot {
  display: none;
}

.btn-back {
  margin-top: 1.5rem;
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Thanks page ── */
.thanks-section {
  text-align: center;
  padding-top: 5rem;
}

.thanks-icon {
  font-size: 3rem;
  filter: drop-shadow(0 0 8px #FFB00066);
  margin-bottom: 1rem;
}

.thanks-heading {
  font-size: 1.4rem;
  font-weight: normal;
  color: var(--color-heading);
  text-shadow: 0 0 6px #FFB00066;
  letter-spacing: 0.03em;
  margin-bottom: 0.75rem;
}

/* ── Light mode (dimmed dark): same amber palette, lighter backgrounds only ── */
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) {
    --color-bg: #1c1830;
    --color-bg-header: #241e3c;
    --color-bg-card: #201c38;
    --color-bg-visual: #261e40;
    --color-vignette: rgba(0, 0, 0, 0.3);
  }
}

html[data-theme="light"] {
  --color-bg: #1c1830;
  --color-bg-header: #241e3c;
  --color-bg-card: #201c38;
  --color-bg-visual: #261e40;
  --color-vignette: rgba(0, 0, 0, 0.3);
}

/* ── Theme toggle button ── */
.theme-toggle {
  width: 1.6rem;
  height: 1.6rem;
  background: transparent;
  border: 1px solid var(--color-border-mid);
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 4px) 0, 100% 4px, 100% 100%, 4px 100%, 0 calc(100% - 4px));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s;
  padding: 0;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--color-bg-visual);
  border-color: var(--color-primary);
}

/* 🌑 = currently dark (full), click to go dimmed */
.theme-toggle::before {
  content: '🌑';
}

/* ☀️ = currently dimmed, click to go full dark */
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) .theme-toggle::before {
    content: '☀️';
  }
}

html[data-theme="light"] .theme-toggle::before {
  content: '☀️';
}
