@font-face {
  font-family: "Geist Pixel";
  src: url("./assets/GeistPixel-Square.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root,
html[data-theme="dark"],
html[data-theme="dark"] body {
  color-scheme: dark;
  /* Fonts */
  --font-sans: "Geist Pixel", monospace;

  /* Colors - Dark Mode (Default) */
  --bg-base: #000000;
  --bg-surface-hover: rgba(255, 255, 255, 0.12);

  --border-color: rgba(255, 255, 255, 0.15);
  --border-dashed: rgba(255, 255, 255, 0.25);
  --decor-dots: rgba(255, 255, 255, 0.12);

  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);

  --accent-orange: #cf4500;

  --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --card-shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.6);
  --focus-ring: 0 0 0 2px rgba(207, 69, 0, 0.4);
}

/* Light Theme overrides */
html[data-theme="light"],
html[data-theme="light"] body {
  color-scheme: light;
  --bg-base: #ffffff;
  --bg-surface-hover: rgba(0, 0, 0, 0.06);

  --border-color: rgba(0, 0, 0, 0.12);
  --border-dashed: rgba(0, 0, 0, 0.18);
  --decor-dots: rgba(0, 0, 0, 0.22);

  --text-primary: #000000;
  --text-secondary: rgba(0, 0, 0, 0.7);

  --accent-orange: #cf4500;

  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  --card-shadow-hover: 0 10px 24px rgba(0, 0, 0, 0.05);
  --focus-ring: 0 0 0 2px rgba(207, 69, 0, 0.3);
}

/* System preference light fallback */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]),
  :root:not([data-theme="dark"]) body {
    color-scheme: light;
    --bg-base: #ffffff;
    --bg-surface-hover: rgba(0, 0, 0, 0.06);

    --border-color: rgba(0, 0, 0, 0.12);
    --border-dashed: rgba(0, 0, 0, 0.18);
    --decor-dots: rgba(0, 0, 0, 0.22);

    --text-primary: #000000;
    --text-secondary: rgba(0, 0, 0, 0.7);

    --accent-orange: #cf4500;

    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    --card-shadow-hover: 0 10px 24px rgba(0, 0, 0, 0.05);
    --focus-ring: 0 0 0 2px rgba(207, 69, 0, 0.3);
  }
}

/* --- Reset & Core --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:root:not([data-theme="light"]),
html[data-theme="dark"] {
  background-color: var(--bg-base);
  color: var(--text-primary);
}

html[data-theme="light"] {
  background-color: var(--bg-base);
  color: var(--text-primary);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    background-color: var(--bg-base);
    color: var(--text-primary);
  }
}

body {
  background-color: transparent;
  color: var(--text-primary);
}

/* --- Background Grid System (Dots & Dashed Lines) --- */
.tech-grid-dots {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  pointer-events: none;
}

.background-grid-lines {
  position: fixed;
  top: 0;
  bottom: 0;
  left: calc(50% - 600px);
  width: 1200px;
  z-index: -10;
  pointer-events: none;
}

/* Vertical repeating dashed column guide lines */
.background-grid-lines::before,
.background-grid-lines::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background-image: linear-gradient(
    to bottom,
    var(--border-dashed) 50%,
    transparent 50%
  );
  background-size: 1px 32px;
  background-repeat: repeat-y;
}

.background-grid-lines::before {
  left: 0;
}

.background-grid-lines::after {
  right: 0;
}

/* Interactive Laser Sweeps on guidelines */
.laser-sweep-left,
.laser-sweep-right {
  position: absolute;
  width: 1px;
  height: 140px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--accent-orange),
    transparent
  );
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
}

.laser-sweep-left {
  left: 0;
  animation: laser-slide-1 8s infinite linear;
}

.laser-sweep-right {
  right: 0;
  animation: laser-slide-2 10s infinite linear;
}

@keyframes laser-slide-1 {
  0% {
    transform: translateY(-140px);
  }

  100% {
    transform: translateY(100vh);
  }
}

@keyframes laser-slide-2 {
  0% {
    transform: translateY(-140px);
  }

  100% {
    transform: translateY(100vh);
  }
}

@media (max-width: 1240px) {
  .background-grid-lines {
    left: 0;
    width: 100%;
    padding: 0 16px;
  }
}

/* --- Navbar Header --- */
.navbar {
  position: sticky;
  top: 0;
  width: 100%;
  height: 72px;
  z-index: 100;
}

.navbar::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background-image: linear-gradient(
    to right,
    var(--border-dashed) 50%,
    transparent 50%
  );
  background-size: 32px 1px;
  background-repeat: repeat-x;
}

/* Drafting Ruler Ticks at bottom of navbar */
.navbar::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background-image: repeating-linear-gradient(
    to right,
    var(--border-color) 0,
    var(--border-color) 1px,
    transparent 1px,
    transparent 16px
  );
  background-size: 100% 4px;
  background-repeat: no-repeat;
  background-position: bottom;
  opacity: 0.4;
  pointer-events: none;
}

/* Horizontal Laser scanner sweep */
.navbar-laser {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  z-index: 102;
  opacity: 0.85;
  pointer-events: none;
  overflow: hidden;
}

.navbar-laser::after {
  content: "";
  position: absolute;
  top: 0;
  left: -160px;
  width: 160px;
  height: 100%;
  background: linear-gradient(
    to right,
    transparent,
    var(--accent-orange),
    transparent
  );
  animation: horizontal-scan 7s infinite linear;
}

@keyframes horizontal-scan {
  0% {
    left: -160px;
  }

  100% {
    left: 100%;
  }
}

.nav-tick-left,
.nav-tick-right,
.footer-tick-left,
.footer-tick-right {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--bg-base);
  z-index: 101;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
}

.nav-tick-left,
.nav-tick-right {
  bottom: -7px;
}

.footer-tick-left,
.footer-tick-right {
  top: -7px;
}

.nav-tick-left,
.footer-tick-left {
  left: calc(50% - 600px - 7px);
}

.nav-tick-right,
.footer-tick-right {
  right: calc(50% - 600px - 7px);
}

@media (max-width: 1240px) {
  .nav-tick-left,
  .nav-tick-right,
  .footer-tick-left,
  .footer-tick-right {
    display: none;
  }
}

@media (max-width: 720px) {
  .navbar {
    height: 54px;
  }
}

/* --- Main Layout Wrapper --- */
.main-wrapper {
  max-width: 680px;
  width: 100%;
  padding: 80px 16px;
  margin: auto auto;
  /* Centered in screen viewport */
  display: flex;
  flex-direction: column;
  gap: 56px;
  z-index: 1;
}

/* --- Centered Hero Section --- */
.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.hero h1 {
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--text-primary);
}

.hero p {
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.6;
  letter-spacing: -0.015em;
  max-width: 520px;
}

.hero-socials {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

.social-text-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition:
    color 0.15s ease,
    transform 0.15s ease;
  cursor: pointer;
}

.social-text-link:hover,
.social-text-link:focus-visible {
  color: var(--accent-orange);
  outline: none;
}

.social-text-link:focus-visible {
  box-shadow: var(--focus-ring);
}

.social-separator {
  color: var(--border-color);
  font-size: 0.85rem;
  font-weight: 300;
}

/* --- Portal Menu Stack --- */
.portals-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.portal-card {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  border-radius: 0;
  text-decoration: none;
  color: var(--text-primary);
  box-shadow: var(--card-shadow);
  transition:
    transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: visible;
}

.portal-card:hover,
.portal-card:focus-visible {
  transform: translateY(-2px);
  background: var(--bg-base);
  border-color: var(--accent-orange);
  box-shadow: var(--card-shadow-hover);
  outline: none;
}

.portal-card:focus-visible {
  box-shadow: var(--focus-ring);
}

/* Card corner tick boxes */
.card-tick-tl,
.card-tick-tr,
.card-tick-bl,
.card-tick-br {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  background-color: var(--bg-base);
  z-index: 5;
  pointer-events: none;
  transition:
    border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-tick-tl {
  top: -6px;
  left: -6px;
}

.card-tick-tr {
  top: -6px;
  right: -6px;
}

.card-tick-bl {
  bottom: -6px;
  left: -6px;
}

.card-tick-br {
  bottom: -6px;
  right: -6px;
}

/* Animate ticks on card hover */
.portal-card:hover .card-tick-tl,
.portal-card:hover .card-tick-tr,
.portal-card:hover .card-tick-bl,
.portal-card:hover .card-tick-br {
  border-color: var(--accent-orange);
  background-color: var(--bg-base);
}

.portal-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.portal-title {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

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

.portal-card svg {
  color: var(--text-secondary);
  transform: translateX(0);
  transition:
    transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    color 0.2s ease;
}

.portal-card:hover svg {
  color: var(--accent-orange);
  transform: translateX(4px);
}

/* --- Simplified Minimalist Footer --- */
.footer {
  position: relative;
  z-index: 100;
  width: 100%;
  padding: 48px 0;
  margin-top: 80px;
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background-image: linear-gradient(
    to right,
    var(--border-dashed) 50%,
    transparent 50%
  );
  background-size: 32px 1px;
  background-repeat: repeat-x;
}

.footer-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: var(--accent-orange);
}

/* --- Responsive Layout --- */
@media (max-width: 720px) {
  .background-grid-lines {
    width: 100%;
    padding: 0 16px;
  }

  .main-wrapper {
    padding: 56px 16px;
    gap: 40px;
  }

  .hero h1 {
    font-size: 3.5rem;
  }

  .hero p {
    font-size: 1.15rem;
  }

  .portal-card {
    padding: 20px;
  }

  .footer-container {
    padding: 0 16px;
  }
}

@media (max-width: 480px) {
  .main-wrapper {
    padding: 40px 16px;
    gap: 32px;
  }

  .hero h1 {
    font-size: 2.75rem;
  }

  .hero p {
    font-size: 1.05rem;
    line-height: 1.5;
  }

  .hero-socials {
    gap: 10px 20px;
    margin-top: 12px;
  }

  .social-separator {
    display: none;
    /* Hide separators on small screens to prevent awkward wrap formatting */
  }

  .portal-title {
    font-size: 1.05rem;
  }

  .portal-desc {
    font-size: 0.8rem;
  }

  .footer {
    padding: 32px 0;
    margin-top: 56px;
  }

  .footer-copy {
    font-size: 0.8rem;
  }
}

/* --- Theme Toggle Button --- */
.theme-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 6px;
  transition:
    color 0.15s ease,
    background-color 0.15s ease;
}

.theme-toggle-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-hover);
}

.theme-toggle-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Icon visibility matching active theme states */
.theme-icon-sun {
  display: block;
}

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

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

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

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-icon-sun {
    display: none;
  }

  :root:not([data-theme="dark"]) .theme-icon-moon {
    display: block;
  }
}
