:root {
  color-scheme: light;
  --bg: #f2f7fb;
  --bg-rgb: 242, 247, 251;
  --panel: #ffffff;
  --ink: #0f2438;
  --ink-dark: #081423;
  --ink-rgb: 15, 36, 56;
  --accent: #016fb1;
  --accent-rgb: 1, 111, 177;
  --accent-soft: #b8ddf2;
  --accent-soft-rgb: 184, 221, 242;
  --line: rgba(var(--ink-rgb), 0.18);
  --font-display: "Geologica", sans-serif;
  --font-ui: "Geologica", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#heat {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(circle at 20% 20%, rgba(var(--accent-rgb), 0.18), transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(var(--accent-soft-rgb), 0.24), transparent 65%),
    linear-gradient(180deg, rgba(var(--bg-rgb), 0.6), rgba(var(--bg-rgb), 0.98));
  mix-blend-mode: multiply;
}

canvas#grid {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.nav,
.page,
.footer {
  position: relative;
  z-index: 2;
}

.nav {
  padding: 20px clamp(20px, 6vw, 80px) 0;
  display: flex;
  justify-content: flex-end;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  line-height: 1;
}

.lang-btn {
  border: 1px solid transparent;
  background: transparent;
  color: rgba(var(--ink-rgb), 0.55);
  font-family: var(--font-mono);
  cursor: pointer;
  padding: 6px 6px;
  line-height: 1;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.lang-btn[aria-pressed="true"] {
  color: var(--ink);
  border-color: rgba(var(--accent-rgb), 0.5);
}

.lang-divider {
  display: inline-flex;
  align-items: center;
  color: rgba(var(--ink-rgb), 0.4);
  line-height: 1;
}

.page {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: clamp(24px, 6vh, 80px);
  padding: 0 clamp(20px, 6vw, 80px) clamp(28px, 6vh, 80px);
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.wordmark {
  font-family: var(--font-display);
  font-size: clamp(74px, 14vw, 240px);
  margin: 0;
  text-transform: uppercase;
  color: var(--ink);
  position: relative;
  line-height: 0.86;
  display: inline-flex;
  gap: 0;
}

.wordmark-logo {
  margin: 0;
  display: inline-flex;
  line-height: 0;
}

.wordmark-logo img {
  display: block;
  height: calc(clamp(74px, 14vw, 240px) * 0.86);
  width: auto;
  max-width: 100%;
}

.letter {
  display: inline-block;
  position: relative;
}

.ligature-ai {
  display: inline-flex;
  position: relative;
  margin-right: -0.02em;
}

.ligature-ai .letter-a {
  margin-right: -0.18em;
  clip-path: polygon(0 0, 88% 0, 70% 100%, 0 100%);
}

.ligature-ai .letter-i {
  position: relative;
  z-index: 1;
  margin-left: 0;
  transform: translateX(0.01em);
}

.letter-i {
  margin-left: -0.08em;
}

.letter-v {
  margin-left: -0.02em;
  margin-right: -0.02em;
  transform: scaleX(0.82);
  transform-origin: center bottom;
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 10px),
    64% 100%,
    36% 100%,
    0 calc(100% - 10px)
  );
}

.letter-i2 {
  margin-left: -0.06em;
}

.letter-c {
  margin-left: -0.03em;
}

.tagline {
  font-family: var(--font-ui);
  font-size: clamp(18px, 3vw, 30px);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: rgba(var(--ink-rgb), 0.78);
  margin: 0;
}

.contact {
  padding: 24px 0 0;
}

.contact-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.contact-email {
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-mono);
  letter-spacing: 0.24em;
  font-size: clamp(15px, 2.6vw, 26px);
  position: relative;
  display: inline-block;
  z-index: 0;
}

.contact-email::before {
  content: "";
  position: absolute;
  left: -6%;
  right: -6%;
  top: 50%;
  height: 1.1em;
  background: linear-gradient(
    90deg,
    rgba(var(--accent-rgb), 0.12),
    rgba(var(--accent-soft-rgb), 0.35),
    rgba(var(--accent-rgb), 0.12)
  );
  transform: translateY(-50%) scaleX(0);
  transform-origin: left;
  opacity: 0;
  filter: blur(12px);
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.6s ease;
  z-index: -1;
}

.contact-email::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(var(--accent-rgb), 0.6),
    rgba(var(--accent-soft-rgb), 0.9),
    rgba(var(--accent-rgb), 0.6),
    transparent
  );
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.45s ease;
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.2);
}

.contact-email:hover {
  text-shadow: 0 0 16px rgba(var(--accent-rgb), 0.3);
}

.contact-email:hover::before {
  transform: translateY(-50%) scaleX(1);
  opacity: 1;
}

.contact-email:hover::after {
  transform: scaleX(1);
  opacity: 1;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px clamp(20px, 6vw, 80px) 28px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), 0.6);
}

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

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 1s ease forwards;
  animation-delay: calc(var(--delay, 0s));
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .page {
    padding: 0 20px 64px;
  }

  .footer {
    flex-direction: column;
    gap: 12px;
  }
}
