/* */
:root {
  --bg: #1f242d;
  --bg-alt: #323946;
  --accent: #0ef;
  --text: #fff;
  --text-soft: rgba(255, 255, 255, 0.92);
  --text-muted: rgba(255, 255, 255, 0.7);
  --footer-bg: #161a21;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --on-accent: #1f242d;
  --glow: #0ef;
  --footer-glow: rgba(0, 238, 255, 0.12);
  --ok: #22c55e;
  --err: #ff6b6b;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --pixel: "Press Start 2P", "Segoe UI", sans-serif;
  --body: ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}

:root.light-mode {
  --bg: #f6f7f9;
  --bg-alt: #e9edf2;
  --accent: #0c6781;
  --text: #14181f;
  --text-soft: rgba(20, 24, 31, 0.86);
  --text-muted: rgba(20, 24, 31, 0.7);
  --footer-bg: #e1e6ed;
  --line: rgba(20, 24, 31, 0.12);
  --line-strong: rgba(20, 24, 31, 0.3);
  --on-accent: #fff;
  --glow: rgba(12, 103, 129, 0.35);
  --footer-glow: rgba(12, 103, 129, 0.1);
  --ok: #15803d;
  --err: #b91c1c;
  color-scheme: light;
}

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

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
  scroll-padding-top: 8rem;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--pixel);
  font-synthesis: none;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.accent {
  color: var(--accent);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  padding: 1rem 1.6rem;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 1.2rem;
  border-radius: 0.8rem;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

section {
  min-height: 100vh;
  padding: 10rem 9% 2rem;
}

p {
  font-family: var(--body);
  line-height: 1.43;
  color: var(--text-soft);
}

.heading,
.logo,
.navbar a,
.hero-line,
.hero-title,
.about-role,
.btn,
.footer-title,
.footer-copy {
  word-spacing: -0.5em;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  width: 100%;
  padding: 2rem 9%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
}

.logo {
  font-size: 1.6rem;
}

.header-actions {
  display: flex;
  align-items: center;
}

.navbar a {
  margin-left: 4rem;
  font-size: 1.2rem;
  transition: color 150ms ease;
}

.navbar a.active {
  color: var(--accent);
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: max(4rem, 38px);
  height: max(4rem, 38px);
  margin-left: 3rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transition:
    transform 160ms ease-out,
    color 150ms ease,
    border-color 150ms ease;
}

.theme-toggle:active {
  transform: scale(0.97);
}

.theme-toggle i {
  grid-area: 1 / 1;
  font-size: max(2rem, 18px);
  transition:
    opacity 200ms ease,
    transform 200ms var(--ease),
    filter 200ms ease;
}

.theme-toggle .bx-moon,
:root.light-mode .theme-toggle .bx-sun {
  opacity: 0;
  filter: blur(2px);
  transform: scale(0.9) rotate(30deg);
}

:root.light-mode .theme-toggle .bx-moon {
  opacity: 1;
  filter: none;
  transform: none;
}

.menu-toggle {
  display: none;
  font-size: 3.6rem;
  line-height: 1;
}

:where(.theme-transition, .theme-transition *) {
  transition:
    background-color 200ms ease,
    color 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease;
}

/* Hero */
.home {
  --hero-img: url("../images/lab.jpg");
  --text: #fff;
  --text-soft: rgba(255, 255, 255, 0.92);
  --hero-accent: #0ef;
  --hero-base: #1f242d;

  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 10rem 9%;
  text-align: center;
  color: var(--text);
  background:
    linear-gradient(
      180deg,
      rgba(31, 36, 45, 0.82) 0%,
      rgba(31, 36, 45, 0.72) 50%,
      rgba(31, 36, 45, 0.92) 100%
    ),
    var(--hero-img) center / cover no-repeat,
    var(--hero-base);
}

/* Smaller hero file for phones: export css-ready copy as images/lab-800.jpg */
@media (max-width: 800px) {
  .home {
    --hero-img: url("../images/lab.jpg");
  }
}

.home-content {
  max-width: 80rem;
}

.hero-line,
.hero-title {
  font-family: var(--pixel);
  font-weight: 400;
  line-height: 1.5;
  min-height: 1.5em; /* reserves the line before typing starts */
  color: var(--text);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.45);
}

.hero-line {
  font-size: 1.6rem;
}

.hero-title {
  font-size: 3.2rem;
}

.hero-name {
  margin-bottom: 2rem;
}

.hero-name .accent {
  color: var(--hero-accent);
}

.hero-copy {
  max-width: 58ch;
  margin: 0 auto;
  font-size: max(1.6rem, 14px);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.45);
}

.btn {
  display: inline-block;
  padding: 1.2rem 2.8rem;
  background: var(--accent);
  border-radius: 4rem;
  box-shadow: 0 0 1rem var(--glow);
  font-size: 1.2rem;
  color: var(--on-accent);
  transition:
    box-shadow 200ms ease,
    transform 160ms ease-out;
}

.btn:active {
  transform: scale(0.97);
}

.social-media {
  display: flex;
  justify-content: center;
}

.social-media a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 4.4rem;
  height: 4.4rem;
  margin: 3rem 0.75rem;
  border: 2px solid var(--hero-accent);
  border-radius: 50%;
  font-size: 2rem;
  color: var(--hero-accent);
  transition:
    background-color 200ms ease,
    color 200ms ease,
    box-shadow 200ms ease;
}

.social-media a:focus-visible {
  outline-color: #fff;
}

/* Typing effect: characters keep their final position, only opacity changes */
.js [data-type]:not(.is-typing) {
  visibility: hidden;
}

[data-type] {
  --cursor-w: max(2px, 0.2rem);
}

[data-type] .tw-char {
  opacity: 0;
  transition: opacity 90ms ease-out;
  border-right: var(--cursor-w) solid transparent;
  margin-right: calc(var(--cursor-w) * -1);
}

[data-type] .tw-char.is-on {
  opacity: 1;
}

[data-type] .tw-char.is-cursor {
  border-right-color: var(--hero-accent);
}

[data-type] .tw-char.is-blinking {
  animation: tw-blink 1s step-end infinite;
}

[data-type] .tw-char.is-fading {
  animation: tw-fade 500ms ease-out forwards;
}

@keyframes tw-blink {
  50% {
    border-right-color: transparent;
  }
}

@keyframes tw-fade {
  from {
    border-right-color: var(--hero-accent);
  }
  to {
    border-right-color: transparent;
  }
}

/* About */
.about {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  background: var(--bg-alt);
}

.about-img img {
  display: block;
  width: 35vw;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: 50% 0;
  border-radius: 15%;
}

.about-content {
  margin-left: 50px;
}

.heading {
  text-align: center;
  font-size: 3.2rem;
  font-weight: 400;
  line-height: 1.4;
}

.about-content .heading {
  text-align: left;
}

.about-role {
  font-family: var(--pixel);
  font-size: 2rem;
  line-height: 1.5;
}

.about-copy {
  margin: 2rem 0 3rem;
  font-size: max(1.6rem, 14px);
}

/* Services */
.services {
  background: var(--bg);
}

.services .heading {
  margin-bottom: 5rem;
}

.services-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(28rem, 100%), 1fr));
  gap: 2.5rem;
}

.service-card {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  padding: 3rem 2.6rem;
  background: var(--bg-alt);
  border: 2px solid transparent;
  border-radius: 2rem;
  transition:
    border-color 200ms ease,
    box-shadow 200ms ease,
    transform 200ms var(--ease);
}

.service-card i {
  display: block;
  height: 1em; /* holds the space while the icon font loads */
  font-size: 4.4rem;
  line-height: 1;
  color: var(--accent);
}

.service-card h3 {
  font-size: 2.2rem;
  font-weight: 400;
  line-height: 1.3;
}

.service-card p {
  font-size: max(1.4rem, 14px);
}

.service-tag,
.service-stat {
  font-family: var(--mono);
  color: var(--accent);
}

.service-tag {
  font-size: 1.2rem;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
}

.service-stat {
  margin-top: auto;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  font-size: 1.3rem;
  font-weight: 500;
}

/* Footer */
.footer {
  padding: 5rem 9% 2.4rem;
  background: var(--footer-bg);
  border-top: 1px solid var(--accent);
  box-shadow: 0 -0.4rem 2rem var(--footer-glow);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4rem;
}

.footer-title {
  margin-bottom: 2rem;
  font-size: max(1.1rem, 10px);
  font-weight: 400;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--accent);
}

.footer-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.4rem;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem 1.2rem;
}

.footer-link,
.footer-info {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--body);
  font-size: max(1.5rem, 14px);
  line-height: 1.4;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}

.footer-link {
  transition: color 150ms ease;
}

.footer-link i,
.footer-info i {
  flex-shrink: 0;
  font-size: max(2rem, 18px);
  color: var(--accent);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3.2rem;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--line-strong);
  border-radius: 4rem;
  font-family: var(--mono);
  font-size: max(1.2rem, 12px);
  line-height: 1.2;
  color: var(--text-muted);
  transition:
    transform 160ms ease-out,
    color 150ms ease,
    border-color 150ms ease;
}

.copy-btn i {
  font-size: max(1.4rem, 14px);
}

.copy-btn:active {
  transform: scale(0.97);
}

.copy-btn.is-copied {
  color: var(--ok);
  border-color: var(--ok);
}

.copy-btn.is-failed {
  color: var(--err);
  border-color: var(--err);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0.8rem 1.4rem;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 4rem;
  font-family: var(--body);
  font-size: max(1.4rem, 13px);
  line-height: 1.2;
  color: var(--text);
}

.status-dot {
  position: relative;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
}

.status-dot::before,
.status-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--ok);
}

.status-dot::before {
  opacity: 0;
  animation: status-ping 2s ease-out infinite;
}

.status-dot::after {
  animation: status-blink 2s ease-in-out infinite;
}

@keyframes status-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@keyframes status-ping {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  70%,
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

.footer-bottom {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.footer-copy {
  font-family: var(--pixel);
  font-size: max(1.2rem, 10px);
  line-height: 1.8;
}

.footer-name {
  color: var(--accent);
}

/* Scroll to top */
.scroll-top {
  position: fixed;
  right: 2.4rem;
  bottom: 2.4rem;
  z-index: 90;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: max(4.4rem, 40px);
  height: max(4.4rem, 40px);
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 1rem var(--glow);
  color: var(--on-accent);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(1.2rem);
  transition:
    opacity 150ms ease-out,
    transform 150ms ease-out,
    box-shadow 200ms ease,
    visibility 0s linear 150ms;
}

.scroll-top i {
  font-size: max(2.6rem, 22px);
}

.scroll-top.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition:
    opacity 200ms ease-out,
    transform 200ms var(--ease),
    box-shadow 200ms ease,
    visibility 0s;
}

.scroll-top.show:active {
  transform: scale(0.95);
  transition-duration: 100ms;
}

.scroll-top:focus-visible {
  outline-color: var(--text);
}

/* Hover: mouse only */
@media (hover: hover) and (pointer: fine) {
  .navbar a:hover,
  .footer-link:hover {
    color: var(--accent);
  }

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

  .btn:hover,
  .scroll-top:hover {
    box-shadow: none;
  }

  .social-media a:hover {
    background: var(--hero-accent);
    color: var(--hero-base);
    box-shadow: 0 0 1rem var(--hero-accent);
  }

  .service-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 1.5rem var(--glow);
    transform: translateY(-0.8rem);
  }

  .copy-btn:not(.is-copied):not(.is-failed):hover {
    color: var(--accent);
    border-color: var(--accent);
  }
}

/* Responsive */
@media (max-width: 991px) {
  html {
    font-size: 58%;
  }

  .header {
    padding: 2rem 4%;
  }

  section {
    padding: 10rem 4% 2rem;
  }

  .footer {
    padding: 4rem 4% 2.4rem;
  }

  .navbar a {
    font-size: 1.3rem;
  }

  .home {
    padding: 10rem 4%;
  }

  .hero-title {
    font-size: 3.6rem;
  }

  .hero-line {
    font-size: 2rem;
  }

  .btn {
    font-size: 1.4rem;
  }

  .about {
    flex-direction: column;
    gap: 4rem;
    text-align: center;
  }

  .about-img img {
    width: 55vw;
  }

  .about-content {
    margin-left: 0;
  }

  .about-content .heading {
    text-align: center;
  }

  .about-role {
    font-size: 2.4rem;
  }

  .heading {
    font-size: 3.6rem;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .theme-toggle {
    margin-left: 0;
    margin-right: 1.6rem;
  }

  .navbar {
    position: absolute;
    top: 100%;
    left: 0;
    display: none;
    width: 100%;
    padding: 1rem 4%;
    background: var(--bg);
    box-shadow: 0 1rem 1rem rgba(0, 0, 0, 0.3);
  }

  .navbar.open {
    display: block;
  }

  .navbar a {
    display: block;
    margin: 2rem 0;
    font-size: 1.6rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 3.2rem;
  }
}

@media (max-width: 617px) {
  html {
    font-size: 55%;
  }

  .hero-line {
    font-size: 2.2rem;
  }

  .about-img img {
    width: 75vw;
  }

  .about-role {
    font-size: 2.2rem;
  }

  .heading {
    font-size: 3rem;
  }
}

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

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

  .theme-toggle i,
  .scroll-top,
  .scroll-top.show {
    transform: none !important;
    filter: none !important;
  }
}
