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

/* ---- Smooth Scroll ---- */

html {
  scroll-behavior: smooth;
}

/* ---- Selection ---- */

::selection {
  background: rgba(74, 158, 255, 0.25);
  color: #fff;
}

/* ---- Skip to Content (Accessibility) ---- */

.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  text-decoration: none;
}

.skip-link:focus {
  position: fixed;
  top: 0;
  left: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: #4a9eff;
  color: #0a0a0a;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 0 0 6px 6px;
  z-index: 1000;
}

/* ---- Focus Visible ---- */

:focus-visible {
  outline: 2px solid #4a9eff;
  outline-offset: 2px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
  color: #e0e0e0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
}

a {
  color: #4a9eff;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #6db3ff;
}

/* ---- Navigation ---- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

.nav-logo {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #e0e0e0;
  text-decoration: none;
}

.nav-logo:hover {
  color: #fff;
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.8rem;
  color: #777;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: #e0e0e0;
}

/* ---- Main Content ---- */

.page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.container {
  max-width: 640px;
  width: 100%;
}

.container--wide {
  max-width: 800px;
}

/* ---- Homepage ---- */

.home-container {
  text-align: center;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #c0c0c0 0%, #ffffff 50%, #c0c0c0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  color: #777;
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

.divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #555, transparent);
  margin: 0 auto 2rem;
}

.home-nav-cards {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 3rem;
}

.home-nav-card {
  display: block;
  padding: 0.7rem 1.5rem;
  border: 1px solid #1a1a1a;
  border-radius: 8px;
  background: #0f0f0f;
  color: #999;
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  transition: border-color 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.home-nav-card:hover {
  border-color: #333;
  background: #141414;
  color: #e0e0e0;
}

/* ---- Section Labels ---- */

.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 1.25rem;
}

.home-container .section-label {
  text-align: center;
}

/* ---- Project Cards ---- */

.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.projects--stacked {
  grid-template-columns: 1fr;
}

.project-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  padding: 1.25rem 1.5rem;
  border: 1px solid #1a1a1a;
  border-radius: 10px;
  background: #0f0f0f;
  transition: border-color 0.3s ease, background 0.3s ease;
  text-align: left;
}

.project-card:hover {
  border-color: #333;
  background: #141414;
}

.project-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: #e0e0e0;
  margin-bottom: 0.35rem;
}

.project-type {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #4a9eff;
  margin-bottom: 0.5rem;
}

.project-desc {
  font-size: 0.85rem;
  color: #777;
  line-height: 1.5;
}

.project-note {
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.75rem;
  line-height: 1.5;
}

.project-note a {
  color: #4a9eff;
}

.project-preview {
  width: 100%;
  border-radius: 6px;
  margin-top: 1rem;
  border: 1px solid #1a1a1a;
}

.project-card--upcoming {
  opacity: 0.75;
  position: relative;
}

.project-card--upcoming .project-type {
  color: #888;
}

.view-all {
  display: inline-block;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: #4a9eff;
  text-decoration: none;
}

.view-all:hover {
  color: #6db3ff;
}

/* ---- Page Header (for inner pages) ---- */

.page-header {
  margin-bottom: 2.5rem;
}

.page-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: #e0e0e0;
  margin-bottom: 0.5rem;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  -webkit-text-fill-color: unset;
}

/* ---- About Page ---- */

.about-content p {
  font-size: 0.95rem;
  color: #bbb;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.about-content a {
  color: #4a9eff;
}

.cta-link {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.65rem 1.5rem;
  border: 1px solid #333;
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 0.85rem;
  text-decoration: none;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.cta-link:hover {
  border-color: #4a9eff;
  background: rgba(74, 158, 255, 0.05);
  color: #fff;
}

/* ---- Contact Page ---- */

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

.contact-card {
  padding: 1.25rem 1.5rem;
  border: 1px solid #1a1a1a;
  border-radius: 10px;
  background: #0f0f0f;
}

.contact-card-label {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #4a9eff;
  margin-bottom: 0.5rem;
}

.contact-card-text {
  font-size: 0.9rem;
  color: #777;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.contact-card-text a {
  color: #4a9eff;
}

.contact-email {
  font-size: 1.05rem;
  font-weight: 600;
  color: #e0e0e0;
  text-decoration: none;
  display: inline-block;
  transition: color 0.2s ease;
}

.contact-email:hover {
  color: #4a9eff;
}

.contact-links {
  list-style: none;
}

.contact-links li {
  font-size: 0.9rem;
  color: #bbb;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.contact-links a {
  color: #e0e0e0;
  font-weight: 600;
  font-size: 0.95rem;
}

.contact-link-handle {
  font-size: 0.8rem;
  color: #555;
}

/* ---- Footer ---- */

.footer {
  padding: 1.5rem 2rem;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #1a1a1a;
}

.footer-text {
  font-size: 0.75rem;
  color: #444;
}

.footer-socials {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.footer-socials a {
  color: #555;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
}

.footer-socials a:hover {
  color: #e0e0e0;
}

.footer-socials svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ---- Contact Form ---- */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #666;
}

.form-input,
.form-textarea {
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: #e0e0e0;
  font-family: inherit;
  transition: border-color 0.3s ease;
  outline: none;
}

.form-input:focus,
.form-textarea:focus {
  border-color: #4a9eff;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #444;
}

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

.form-submit {
  align-self: flex-start;
  padding: 0.7rem 2rem;
  border: 1px solid #333;
  border-radius: 8px;
  background: transparent;
  color: #e0e0e0;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.form-submit:hover {
  border-color: #4a9eff;
  background: rgba(74, 158, 255, 0.05);
  color: #fff;
}

.form-status {
  font-size: 0.85rem;
  color: #4a9eff;
  display: none;
}

.form-status.visible {
  display: block;
}

.form-status.error {
  color: #ff6b6b;
}

/* ---- Mobile ---- */

@media (max-width: 600px) {
  .nav {
    padding: 1rem 1.25rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .page {
    padding: 1.5rem 1.25rem;
    align-items: flex-start;
  }

  .home-nav-cards {
    flex-direction: column;
    align-items: center;
  }

  .home-nav-card {
    width: 100%;
    max-width: 200px;
    text-align: center;
  }

  .projects {
    grid-template-columns: 1fr;
  }
}

/* ---- Reduced Motion ---- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Print Styles ---- */

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .nav,
  .footer,
  .skip-link,
  .home-nav-cards,
  .form-submit,
  .contact-form {
    display: none;
  }

  .page {
    padding: 0;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555;
  }

  a[href^="/"]::after {
    content: " (beargleindustries.com" attr(href) ")";
  }

  a[href^="mailto:"]::after {
    content: " (" attr(href) ")";
  }

  .project-card {
    border-color: #ccc;
    background: #fff;
    break-inside: avoid;
  }

  .project-name {
    color: #000;
  }

  .project-type {
    color: #333;
  }

  .project-desc,
  .about-content p {
    color: #333;
  }

  h1, .page-title {
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: #000;
    color: #000;
  }
}
