@font-face {
  font-family: "Quicksand";
  src: url("../fonts/Quicksand-VariableFont_wght.ttf") format("truetype");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --dt-navy: #202f43;
  --dt-navy-deep: #162232;
  --dt-accent: #ff6b6a;
  --dt-white: #ffffff;
  --dt-muted: #a8b3c2;
  --dt-card: rgba(255, 255, 255, 0.04);
  --dt-border: rgba(255, 255, 255, 0.08);
  --dt-font: "Quicksand", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --dt-mono: "Source Code Pro", ui-monospace, "Cascadia Code", "Consolas", monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--dt-navy);
  color: var(--dt-white);
  font-family: var(--dt-font);
  line-height: 1.55;
  position: relative;
  --mx: 50%;
  --my: 50%;
  --gx: 0px;
  --gy: 0px;
}

body::before {
  content: "";
  position: fixed;
  inset: -48px;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: var(--gx) var(--gy);
  opacity: 0.55;
  transition: opacity 0.3s ease;
}

body.fx-on::before {
  opacity: 0.7;
}

body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--dt-accent);
  z-index: 20;
}

/* —— Mouse FX layer —— */
#fx {
  display: none;
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

body.fx-on #fx {
  display: block;
}

#glow {
  position: absolute;
  width: 28rem;
  height: 28rem;
  left: var(--mx);
  top: var(--my);
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    rgba(255, 107, 106, 0.05) 0%,
    rgba(255, 107, 106, 0.015) 40%,
    transparent 68%
  );
  will-change: left, top;
  z-index: 0;
}

#stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

#cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--dt-accent);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 0 6px rgba(255, 107, 106, 0.35);
  left: -100px;
  top: -100px;
  opacity: 0;
  transition: width 0.15s ease, height 0.15s ease, margin 0.15s ease, opacity 0.2s ease;
  z-index: 40;
  mix-blend-mode: screen;
}

body.fx-on #cursor-dot {
  opacity: 0.9;
}

body.fx-on.fx-cursor {
  cursor: none;
}

body.fx-on.fx-cursor a,
body.fx-on.fx-cursor button,
body.fx-on.fx-cursor .accent {
  cursor: none;
}

body.fx-on.fx-hover #cursor-dot {
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  background: transparent;
  border: 1.5px solid var(--dt-accent);
  box-shadow: 0 0 8px rgba(255, 107, 106, 0.25);
}

a {
  color: var(--dt-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
.accent:focus-visible {
  outline: 2px solid var(--dt-accent);
  outline-offset: 3px;
}

#matrix {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s ease;
  font-family: var(--dt-mono);
  font-size: 13px;
  line-height: 1.2;
  color: #3dff7a;
  overflow: hidden;
  white-space: pre;
}

#matrix.on {
  opacity: 0.22;
}

.page {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 52rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
  flex: 1;
}

.page-home .page {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 36rem;
  padding-top: 4rem;
  padding-bottom: 2rem;
}

/* —— Hero —— */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.15rem;
  padding: 3rem 0 3.5rem;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}

.logo-wrap {
  position: relative;
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 800px;
  z-index: 2;
  width: fit-content;
  max-width: 100%;
}

.logo-tilt {
  display: block;
  width: fit-content;
  max-width: 100%;
  transform-style: preserve-3d;
  transition: transform 0.18s ease-out;
  will-change: transform;
  backface-visibility: hidden;
}

.logo {
  width: 20rem;
  max-width: 100%;
  height: auto;
  display: block;
  margin-inline: auto;
  user-select: none;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.25));
  animation: fadeUp 0.9s ease both;
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.logo-fallback {
  display: none;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--dt-white);
  animation: fadeUp 0.9s ease both;
}

.logo-fallback .tech {
  color: var(--dt-accent);
}

.logo-wrap.is-broken .logo {
  display: none;
}

.logo-wrap.is-broken .logo-fallback {
  display: block;
}

.hero h1 {
  color: var(--dt-muted);
  font-size: clamp(1.15rem, 2.8vw, 1.35rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  animation: fadeUp 0.9s ease 0.12s both;
}

.hero h1 .accent {
  color: var(--dt-accent);
  position: relative;
  cursor: pointer;
  font-weight: 700;
}

.hero h1 .accent[aria-expanded="true"]::after,
.hero h1 .accent.is-open::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hero h1 .accent::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.65rem);
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: 16rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: rgba(22, 34, 50, 0.96);
  border: 1px solid rgba(255, 107, 106, 0.4);
  color: var(--dt-muted);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 5;
}

.hero-sub {
  color: rgba(168, 179, 194, 0.85);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  animation: fadeUp 0.9s ease 0.2s both;
}

.hero-note {
  color: var(--dt-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 28rem;
  font-weight: 400;
  animation: fadeUp 0.9s ease 0.28s both;
}

.wink {
  margin-top: 0.85rem;
  animation: fadeUp 0.9s ease 0.36s both;
}

.btn-portal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  max-width: min(100%, 22rem);
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 107, 106, 0.4);
  background: linear-gradient(
    180deg,
    rgba(255, 107, 106, 0.18) 0%,
    rgba(255, 107, 106, 0.08) 100%
  );
  color: var(--dt-white);
  font-size: 0.8rem;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.01em;
  line-height: 1.3;
  text-decoration: none;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 6px 18px rgba(0, 0, 0, 0.22);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.btn-portal__text {
  text-wrap: balance;
}

.btn-portal:hover {
  text-decoration: none;
  color: var(--dt-white);
  border-color: rgba(255, 107, 106, 0.75);
  background: linear-gradient(
    180deg,
    rgba(255, 107, 106, 0.34) 0%,
    rgba(255, 107, 106, 0.16) 100%
  );
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 12px 32px rgba(0, 0, 0, 0.32),
    0 0 24px rgba(255, 107, 106, 0.18);
  transform: translateY(-1px);
}

.btn-portal:active {
  transform: translateY(0);
}

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

.btn-portal__arrow {
  display: inline-flex;
  transition: transform 0.18s ease;
  font-weight: 700;
  color: var(--dt-accent);
}

.btn-portal:hover .btn-portal__arrow {
  transform: translateX(3px);
}

/* —— Sections —— */
.sections {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--dt-border);
}

.section {
  animation: fadeUp 0.8s ease both;
}

.section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  letter-spacing: -0.01em;
}

.section p {
  color: var(--dt-muted);
  font-size: 0.98rem;
  max-width: 40rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 0.25rem;
}

.card {
  background: var(--dt-card);
  border: 1px solid var(--dt-border);
  border-radius: 0.75rem;
  padding: 1.15rem 1.1rem;
}

.card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: var(--dt-white);
}

.card p {
  font-size: 0.875rem;
  color: var(--dt-muted);
  line-height: 1.5;
}

.contact-link {
  display: inline-block;
  margin-top: 0.35rem;
  font-weight: 600;
  font-size: 1.05rem;
}

/* —— Mentions page —— */
.mentions-page .page {
  max-width: 40rem;
}

.mentions-page h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2rem 0 1.5rem;
}

.mentions-block {
  margin-bottom: 1.75rem;
}

.mentions-block h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.mentions-block p,
.mentions-block li {
  color: var(--dt-muted);
  font-size: 0.95rem;
}

.mentions-block ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin-top: 0.35rem;
}

.mentions-block li + li {
  margin-top: 0.35rem;
}

.back-home {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}

/* —— Footer —— */
.site-footer {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 1.25rem 1.25rem 1.75rem;
  color: var(--dt-muted);
  font-size: 0.75rem;
  opacity: 0.85;
  text-align: center;
}

.site-footer a {
  color: var(--dt-muted);
}

.site-footer a:hover {
  color: var(--dt-accent);
}

.site-footer .sep {
  opacity: 0.4;
}

/* —— Toast —— */
#toast {
  position: fixed;
  left: 50%;
  bottom: 2.5rem;
  transform: translateX(-50%) translateY(1rem);
  z-index: 30;
  max-width: min(90vw, 22rem);
  padding: 0.75rem 1rem;
  border-radius: 0.65rem;
  background: rgba(22, 34, 50, 0.96);
  border: 1px solid rgba(255, 107, 106, 0.45);
  color: var(--dt-white);
  font-size: 0.875rem;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .cards {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 2rem 0 2.5rem;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  #fx,
  #cursor-dot {
    display: none !important;
  }

  body.fx-on.fx-cursor,
  body.fx-on.fx-cursor a,
  body.fx-on.fx-cursor button,
  body.fx-on.fx-cursor .accent {
    cursor: auto;
  }

  .logo-tilt {
    transform: none !important;
  }
}
