:root {
  --white: #ffffff;
  --paper: #f4f8fd;
  --line: #dbe6f3;
  --ink: #0a0e1a;
  --ink-soft: #4b5a70;
  --blue: #0047ff;
  --blue-deep: #001a66;
  --blue-bright: #00b8ff;
  --blue-red-split: #ff2d55;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Inter', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  overflow-x: hidden;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

body.loaded .loading-screen {
  opacity: 0;
  visibility: hidden;
}

.loading-shell {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line);
  background: var(--white);
  padding: 20px;
  box-shadow: 0 18px 48px rgba(10, 14, 26, 0.08);
}

.loading-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--blue);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.loading-bar {
  height: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: rgba(0, 71, 255, 0.04);
}

.loading-bar span {
  display: block;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--blue-bright));
  animation: loadingSweep 1.4s ease-in-out infinite;
}

@keyframes loadingSweep {
  0% {
    transform: translateX(-10%);
  }
  50% {
    transform: translateX(110%);
  }
  100% {
    transform: translateX(-10%);
  }
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 71, 255, 0.02) 0px,
    rgba(0, 71, 255, 0.02) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 6vw;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo {
  width: 180px;
  height: auto;
  display: block;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(0, 71, 255, 0.4);
  }
  50% {
    opacity: 0.4;
    box-shadow: 0 0 0 6px rgba(0, 71, 255, 0);
  }
}

.navlinks {
  display: flex;
  gap: 40px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--ink);
  border-radius: 99px;
}

.navlinks li a {
  position: relative;
  padding: 4px 0;
  color: var(--ink-soft);
  transition: color 0.25s;
}

.navlinks li a::before,
.navlinks li a::after {
  content: "[ ";
  opacity: 0;
  color: var(--blue);
  transition: opacity 0.2s;
}

.navlinks li a::after {
  content: " ]";
}

.navlinks li a:hover {
  color: var(--blue-deep);
}

.navlinks li a:hover::before,
.navlinks li a:hover::after {
  opacity: 1;
}

header.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 0 6vw;
  position: relative;
  background:
    radial-gradient(circle at 85% 20%, rgba(0, 184, 255, 0.10), transparent 45%),
    radial-gradient(circle at 10% 80%, rgba(0, 71, 255, 0.08), transparent 40%),
    var(--white);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 15%, black 70%, transparent);
  mask-image: linear-gradient(to bottom, transparent, black 15%, black 70%, transparent);
  opacity: 0.6;
  pointer-events: none;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--blue);
  display: inline-block;
}

.glitch-wrap {
  position: relative;
  z-index: 2;
}

h1.glitch {
  font-family: var(--mono);
  font-weight: 800;
  font-size: clamp(2.6rem, 8vw, 6.4rem);
  line-height: 1.02;
  letter-spacing: -2px;
  color: var(--ink);
  position: relative;
  text-transform: uppercase;
}

h1.glitch span {
  display: block;
}

h1.glitch .accent {
  color: var(--blue);
}

h1.glitch::before,
h1.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  color: var(--ink);
  background: var(--white);
  white-space: pre;
}

h1.glitch::before {
  left: 3px;
  text-shadow: -2px 0 var(--blue-red-split);
  animation: glitchTop 5s infinite linear alternate-reverse;
  opacity: 0;
}

h1.glitch::after {
  left: -3px;
  text-shadow: -2px 0 var(--blue-bright), 2px 2px var(--blue);
  animation: glitchBottom 6.5s infinite linear alternate-reverse;
  opacity: 0;
}

@keyframes glitchTop {
  0% { clip-path: inset(0 0 85% 0); opacity: 0; }
  2% { opacity: 0.85; }
  4% { clip-path: inset(0 0 85% 0); transform: translate(-4px, -2px); }
  6% { clip-path: inset(40% 0 40% 0); transform: translate(3px, 1px); }
  8% { clip-path: inset(70% 0 5% 0); transform: translate(-2px, 0); }
  10% { opacity: 0; }
  45% { opacity: 0; }
  47% { opacity: 0.7; clip-path: inset(10% 0 60% 0); transform: translate(3px, 0); }
  50% { clip-path: inset(50% 0 20% 0); transform: translate(-3px, 1px); }
  53% { opacity: 0; }
  100% { opacity: 0; }
}

@keyframes glitchBottom {
  0% { clip-path: inset(85% 0 0 0); opacity: 0; }
  3% { opacity: 0.8; }
  5% { clip-path: inset(20% 0 60% 0); transform: translate(4px, 1px); }
  7% { clip-path: inset(60% 0 10% 0); transform: translate(-3px, -1px); }
  9% { opacity: 0; }
  60% { opacity: 0; }
  62% { opacity: 0.75; clip-path: inset(30% 0 40% 0); transform: translate(-4px, 0); }
  65% { clip-path: inset(5% 0 80% 0); transform: translate(3px, 2px); }
  68% { opacity: 0; }
  100% { opacity: 0; }
}

.hero-sub {
  max-width: 560px;
  margin-top: 28px;
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.hero-sub b {
  color: var(--ink);
  font-weight: 600;
}

.hero-cta {
  margin-top: 42px;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 14px 26px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  cursor: pointer;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--blue);
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn.ghost:hover {
  box-shadow: 4px 4px 0 var(--blue-bright);
  border-color: var(--ink);
}

.terminal-tag {
  margin-top: 56px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cursor {
  width: 8px;
  height: 16px;
  background: var(--blue);
  display: inline-block;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

section {
  padding: 120px 6vw;
  position: relative;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 60px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 26px;
  flex-wrap: wrap;
  gap: 14px;
}

.section-head h2 {
  font-family: var(--mono);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -1px;
  text-transform: uppercase;
}

.scroll-shuffle {
  display: inline-block;
  white-space: nowrap;
  position: relative;
}

.scroll-shuffle .letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity 0.18s ease;
}

.scroll-shuffle.is-visible .letter {
  opacity: 1;
}

.section-head .tag {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--blue);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: 1px solid var(--blue);
  padding: 6px 12px;
}

#services {
  background: var(--paper);
}

.services-grid,
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.coming-soon-block {
  grid-column: 1 / -1;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(0, 71, 255, 0.05), rgba(0, 184, 255, 0.06)),
    var(--white);
  box-shadow: 0 18px 48px rgba(10, 14, 26, 0.06);
  position: relative;
  overflow: hidden;
}

.coming-soon-block::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(transparent 0%, rgba(0, 71, 255, 0.12) 50%, transparent 100%),
    repeating-linear-gradient(
      to bottom,
      rgba(0, 71, 255, 0.08) 0,
      rgba(0, 71, 255, 0.08) 1px,
      transparent 1px,
      transparent 4px
    );
  opacity: 0.55;
  pointer-events: none;
}

.coming-soon-block h3 {
  font-family: var(--mono);
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: 2px;
  margin: 14px 0 8px;
  text-transform: uppercase;
  color: var(--blue-deep);
  text-shadow: 2px 0 0 rgba(255, 45, 85, 0.55), -2px 0 0 rgba(0, 184, 255, 0.65);
  animation: glitchPulse 2.8s infinite step-end;
}

.coming-soon-block p {
  color: var(--ink-soft);
  position: relative;
  z-index: 1;
}

.download-meter {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  margin-top: 18px;
}

.download-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--blue-deep);
}

.download-head strong {
  color: var(--blue);
}

.uploading-meter .download-head,
.uploading-meter .download-head strong {
  color: var(--blue-red-split);
}

.uploading-meter .download-bar {
  border: 1px solid rgba(255, 45, 85, 0.35);
  background: rgba(255, 45, 85, 0.05);
}

.uploading-meter .download-bar span {
  background: linear-gradient(90deg, var(--blue-red-split), #ff6b6b);
}

.download-bar {
  height: 12px;
  border: 1px solid rgba(0, 71, 255, 0.35);
  background: rgba(0, 71, 255, 0.05);
  overflow: hidden;
}

.download-bar span {
  display: block;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--blue-bright));
  animation: downloadPulse 1.6s ease-in-out infinite;
}

@keyframes downloadPulse {
  0%, 100% {
    opacity: 0.8;
    transform: translateX(0);
  }
  50% {
    opacity: 1;
    transform: translateX(1px);
  }
}

@keyframes glitchPulse {
  0%, 100% {
    transform: translate(0, 0);
    filter: drop-shadow(0 0 0 transparent);
  }
  20% {
    transform: translate(-1px, 1px);
    filter: drop-shadow(0 0 8px rgba(0, 184, 255, 0.35));
  }
  40% {
    transform: translate(1px, -1px);
  }
  60% {
    transform: translate(-1px, 0);
  }
  80% {
    transform: translate(1px, 1px);
  }
}

.service-card,
.project-card {
  background: var(--white);
  padding: 36px 30px;
  transition: background 0.25s;
  position: relative;
  overflow: hidden;
}

.service-card:hover,
.project-card:hover {
  background: #eef5ff;
}

.service-card .idx,
.project-card .idx {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--blue);
  letter-spacing: 1px;
}

.service-card h3,
.project-card h3 {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  margin: 18px 0 12px;
  letter-spacing: -0.5px;
}

.service-card p,
.project-card p {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.service-card .stack,
.project-card .stack {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.service-card .stack span,
.project-card .stack span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--blue-deep);
  background: rgba(0, 71, 255, 0.08);
  padding: 4px 8px;
  letter-spacing: 0.5px;
}

.service-card::after,
.project-card::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0%;
  background: var(--blue);
  transition: width 0.3s;
}

.service-card:hover::after,
.project-card:hover::after {
  width: 100%;
}

#projects {
  background: var(--white);
}

#blog {
  background: var(--white);
}

.contact-card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 30px;
  max-width: 760px;
}

.contact-card p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink-soft);
  margin-bottom: 24px;
}

.contact-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.blog-list {
  border-top: 1px solid var(--line);
}

.blog-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 26px 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: padding-left 0.25s, background 0.25s;
}

.blog-row:hover {
  background: var(--paper);
  padding-left: 16px;
}

.blog-row .date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--blue);
}

.blog-row h4 {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.blog-row .arrow {
  font-family: var(--mono);
  color: var(--ink-soft);
  transition: transform 0.25s, color 0.25s;
}

.blog-row:hover .arrow {
  transform: translateX(6px);
  color: var(--blue);
}

footer {
  padding: 60px 6vw 40px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-soft);
  background: var(--paper);
}

footer .brand-foot {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.04em;
}

footer .foot-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

footer .foot-links a {
  color: var(--ink-soft);
  transition: color 0.2s ease;
}

footer a:hover {
  color: var(--blue);
}

footer .copyright {
  margin-left: auto;
}

body.blog-page {
  background: var(--paper);
}

.blog-post {
  max-width: 900px;
  margin: 0 auto;
  padding: 140px 6vw 80px;
}

.blog-post-card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 40px;
  box-shadow: 0 10px 30px rgba(0, 71, 255, 0.05);
}

.blog-post-card h1 {
  font-family: var(--mono);
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 16px;
}

.blog-post-card p {
  margin-bottom: 16px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.blog-post-card .meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--blue);
  margin-bottom: 28px;
}

.blog-post-card .back-link {
  display: inline-block;
  margin-top: 22px;
  font-family: var(--mono);
  color: var(--blue);
}

@media (max-width: 720px) {
  nav {
    padding: 14px 5vw;
    align-items: center;
    gap: 12px;
    flex-direction: row;
  }

  .brand-logo {
    width: 144px;
  }

  .nav-toggle {
    display: flex;
  }

  .navlinks {
    position: absolute;
    top: calc(100% + 8px);
    right: 5vw;
    left: 5vw;
    display: none;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 14px 40px rgba(0, 26, 102, 0.08);
    font-size: 11px;
  }

  .navlinks.nav-open {
    display: flex;
  }

  .hero {
    min-height: auto;
    padding-top: 120px;
    padding-bottom: 70px;
  }

  .hero-sub {
    font-size: 15px;
  }

  .hero-cta,
  .contact-links {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .section-head {
    margin-bottom: 36px;
    padding-bottom: 18px;
  }

  .section-head h2 {
    font-size: clamp(1.4rem, 7vw, 2.2rem);
    line-height: 1.2;
  }

  .scroll-shuffle {
    white-space: normal;
    word-break: break-word;
  }

  .blog-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .contact-card {
    padding: 22px;
  }

  section {
    padding: 80px 6vw;
  }

  .blog-post-card {
    padding: 24px;
  }

  footer {
    padding: 30px 6vw 26px;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
  }

  footer .brand-foot,
  footer .foot-links,
  footer .copyright {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  footer .foot-links {
    gap: 10px 18px;
    font-size: 11px;
    flex-wrap: wrap;
  }

  footer .copyright {
    margin-left: 0;
    color: var(--ink-soft);
    opacity: 0.9;
  }
}
