:root {
  --bg: #ffffff;
  --ink: #0a0a0a;
  --muted: #6b6b6b;
  --soft: #8a8a8a;
  --link: #2f6fed;
  --link-hover: #1a56d6;
  --max: 720px;
}

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

html {
  scroll-behavior: smooth;
}

::selection {
  background: #dbe8ff;
  color: var(--ink);
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--muted);
  font-family: "Lexend", system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
  border-radius: 2px;
}

.topnav {
  position: fixed;
  top: 1.35rem;
  left: 1.75rem;
  z-index: 10;
  display: flex;
  gap: 1.35rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.topnav a {
  color: var(--soft);
  text-decoration: none;
}

.topnav a:hover,
.topnav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: none;
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(5.5rem, 12vh, 8rem) clamp(1.5rem, 5vw, 2.5rem) 6rem;
}

.block + .block {
  margin-top: clamp(3.75rem, 8vh, 5.5rem);
}

h1 {
  color: var(--ink);
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

h2 {
  color: var(--ink);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 1.35rem;
}

p {
  margin-bottom: 1.1rem;
  max-width: 38rem;
}

p:last-child {
  margin-bottom: 0;
}

.lede {
  color: #4a4a4a;
  font-size: clamp(1.08rem, 2vw, 1.22rem);
  margin-bottom: 1.35rem;
}

.soft {
  color: var(--soft);
  margin-top: 1.5rem;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.block:nth-child(2).reveal {
  transition-delay: 0.06s;
}

.block:nth-child(3).reveal {
  transition-delay: 0.12s;
}

@media (max-width: 640px) {
  .topnav {
    top: 1rem;
    left: 1rem;
    gap: 1rem;
    font-size: 0.85rem;
  }

  main {
    padding-top: 4.5rem;
  }

  h1 {
    margin-bottom: 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .boot,
  .boot-bar-fill,
  .boot-sky,
  .boot-hills {
    animation: none !important;
    transition: none !important;
  }

  .boot.is-done {
    display: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* —— XP boot loader —— */
.boot {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: Tahoma, "Segoe UI", Lexend, sans-serif;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.boot.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 50% 18%, #7ec8f5 0%, #3a9de8 35%, #1e6fbf 70%, #0d4a8c 100%);
  animation: sky-drift 2s ease-in-out;
}

.boot-hills {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -8%;
  height: 48%;
  background:
    radial-gradient(ellipse 70% 90% at 22% 100%, #3d8c2e 0%, #2f6b22 55%, transparent 56%),
    radial-gradient(ellipse 80% 100% at 72% 110%, #4a9e35 0%, #356f26 50%, transparent 55%),
    linear-gradient(to top, #2a5c1c 0%, #3f8a2c 40%, transparent 70%);
  filter: saturate(1.1);
  animation: hills-up 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.boot-panel {
  position: relative;
  z-index: 2;
  width: min(92vw, 380px);
  padding: 1.35rem 1.4rem 1.2rem;
  background: linear-gradient(180deg, #245edc 0%, #1a4eb8 8%, #ece9d8 8%, #ece9d8 100%);
  border: 2px solid #0a246a;
  border-radius: 10px 10px 8px 8px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.35) inset,
    0 18px 50px rgba(0, 0, 0, 0.45);
  animation: panel-pop 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.boot-title {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
  margin-top: 0.35rem;
}

.boot-logo {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 6px;
  background: linear-gradient(145deg, #fff 0%, #c5d8f8 100%);
  color: #1a4eb8;
  font-weight: 800;
  font-size: 1.35rem;
  font-family: Lexend, Tahoma, sans-serif;
  box-shadow: 0 1px 0 #fff inset, 0 2px 4px rgba(0, 0, 0, 0.2);
}

.boot-os {
  color: #1a1a1a;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.boot-sub {
  color: #5a5a5a;
  font-size: 0.78rem;
  margin-top: 0.1rem;
}

.boot-bar-track {
  height: 1.15rem;
  padding: 2px;
  background: #fff;
  border: 1px solid #7f9db9;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}

.boot-bar-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(
    90deg,
    #3d95ff 0 11px,
    #1f5fd0 11px 12px,
    transparent 12px 15px
  );
  background-color: transparent;
  animation: xp-load 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

body.is-booting {
  overflow: hidden;
}

body.is-booting .topnav,
body.is-booting main {
  opacity: 0;
}

.topnav,
main {
  transition: opacity 0.4s ease;
}

.boot-status {
  margin-top: 0.75rem;
  color: #333;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}

@keyframes xp-load {
  0% { width: 0%; }
  15% { width: 18%; }
  40% { width: 42%; }
  70% { width: 78%; }
  100% { width: 100%; }
}

@keyframes panel-pop {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes hills-up {
  from { transform: translateY(18%); }
  to { transform: translateY(0); }
}

@keyframes sky-drift {
  from { transform: scale(1.05); }
  to { transform: scale(1); }
}
