:root {
  /* Color Palette - Midnight Theme */
  --bg-body: #020617;
  /* Slate 950 */
  --bg-surface: #0f172a;
  /* Slate 900 */
  --bg-surface-elevated: #1e293b;
  /* Slate 800 */

  --text-main: #f8fafc;
  /* Slate 50 */
  --text-muted: #94a3b8;
  /* Slate 400 */
  --text-accent: #38bdf8;
  /* Sky 400 */

  --border-subtle: rgba(148, 163, 184, 0.1);
  --border-highlight: rgba(148, 163, 184, 0.2);

  --primary: #0ea5e9;
  /* Sky 500 */
  --primary-glow: rgba(14, 165, 233, 0.4);
  --secondary: #6366f1;
  /* Indigo 500 */

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --glow: 0 0 20px var(--primary-glow);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.08), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(14, 165, 233, 0.08), transparent 25%);
  background-attachment: fixed;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

h1 {
  font-size: 2.75rem;
  line-height: 1.1;
  background: linear-gradient(to right, #f8fafc, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
}

.home h1 {
  font-size: 3.5rem;
}

h2 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.5rem;
  color: var(--text-accent);
}

p {
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: 1.125rem;
}

strong {
  color: var(--text-main);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  text-decoration: none;
  filter: brightness(1.2);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--primary-glow);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  display: block;
}

/* Layout Utils */
.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  top: -999px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 1rem;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 0;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 9999px;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text-main);
  background: rgba(148, 163, 184, 0.08);
}

.site-nav a.button {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-highlight);
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  color: var(--text-main);
  transition: transform 0.2s, box-shadow 0.2s;
}

.site-nav a.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
  background: #2563eb;
  border-color: #2563eb;
}

/* Main Content */
main#main {
  padding-top: 4rem;
  padding-bottom: 6rem;
}

/* Hero Section Styles (applied to first part of page) */
.page {
  background: transparent;
  padding: 2.5rem 0;
  text-align: left;
}

.home .page {
  text-align: center;
}

.page > p:not(.lead) {
  max-width: 70ch;
  margin-left: auto;
  margin-right: auto;
}

.page > ul:not(.callouts),
.page > ol {
  max-width: 70ch;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.page > ul:not(.callouts) {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.page > ul:not(.callouts) > li {
  margin: 0;
}

.page > ul:not(.callouts) > li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.6);
  box-shadow: var(--shadow-sm);
  color: var(--text-main);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.page > ul:not(.callouts) > li > a::after {
  content: "→";
  color: var(--text-muted);
}

.page > ul:not(.callouts) > li > a:hover {
  transform: translateY(-2px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-lg);
}

/* Specific component tweaks */
.lead {
  font-size: 1.5rem;
  color: var(--text-muted);
  max-width: 70ch;
  margin: 0 auto 2rem;
}

.home .lead {
  max-width: 800px;
}

.lead strong {
  color: var(--text-main);
  font-weight: 500;
}

/* Cards / Sections */
section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin: 2.75rem 0;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  text-align: left;
}

section > :last-child {
  margin-bottom: 0;
}

/* Add subtle top highlight to cards */
section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-highlight), transparent);
}

section h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

/* Callouts List */
.callouts {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
  text-align: left;
}

.callouts li {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.callouts li:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.callouts strong {
  color: var(--primary);
}

/* Link Row (Hero Buttons) */
.link-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 3rem;
}

.link-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 1.1rem;
}

.link-row a.primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--glow);
}

.link-row a.primary:hover {
  background: #0284c7;
  box-shadow: var(--glow);
}

.link-row a:not(.primary) {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.link-row a:not(.primary):hover {
  border-color: var(--text-muted);
}

/* Lists inside sections */
section ul,
section ol {
  padding-left: 1.5rem;
  color: var(--text-muted);
}

section li {
  margin-bottom: 0.75rem;
}

section li::marker {
  color: var(--primary);
}

.contact-form {
  width: 100%;
  max-width: 720px;
  margin: 1.5rem auto 0;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.6);
  display: grid;
  gap: 1rem;
}

.contact-form label {
  display: grid;
  gap: 0.5rem;
  color: var(--text-main);
  font-weight: 600;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  font: inherit;
}

.contact-form textarea {
  min-height: 160px;
  resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-muted);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 3px solid var(--primary-glow);
  outline-offset: 2px;
}

.contact-form button[type="submit"] {
  justify-self: start;
  background: var(--primary);
  color: #ffffff;
  border: 0;
  border-radius: 9999px;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.contact-form button[type="submit"]:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.contact-form button[type="submit"]:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.contact-form-status {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
}

.contact-form-status.is-success {
  color: #a7f3d0;
}

.contact-form-status.is-error {
  color: #fecaca;
}

.contact-form-hp {
  display: none;
}

/* HR */
hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-highlight), transparent);
  margin: 3rem 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0;
  margin-top: auto;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  h1 {
    font-size: 2.2rem;
  }

  .home h1 {
    font-size: 2.5rem;
  }

  .header-inner {
    flex-direction: column;
    gap: 1rem;
  }

  .site-nav {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  section {
    padding: 2rem;
  }

  .link-row {
    flex-direction: column;
  }
}