/* ============ Intra Ai — base styles ============ */
/* Inter (SIL OFL), self-hosted */
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Roboto Mono";
  src: url("../assets/fonts/RobotoMono-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 700;
  font-display: swap;
}

:root {
  --black: #000;
  --bg: #050505;
  --bg-2: #0c0c0c;
  --bg-3: #141414;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --ink: #f5f5f5;
  --ink-2: #a3a3a3;
  --ink-3: #8a8a8a;
  --white: #fff;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Roboto Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --container: 1180px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
::selection { background: var(--white); color: var(--black); }

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

.container { width: min(var(--container), 100% - 40px); margin-inline: auto; }

.mono { font-family: var(--mono); }

/* ---------- Page transition veil ---------- */
.veil {
  position: fixed; inset: 0; z-index: 999;
  background: var(--black);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.7s var(--ease);
}
body.is-ready .veil { opacity: 0; }
body.is-leaving .veil { opacity: 1; transition-duration: 0.45s; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.02em; }
.logo__mark { width: 30px; height: 30px; flex: none; }
.logo__mark .ring { transform-origin: 50% 50%; animation: spin 14s linear infinite; }
.logo__mark .ring--2 { animation-duration: 9s; animation-direction: reverse; }
.logo__mark .core { transform-origin: 50% 50%; animation: pulse 2.8s var(--ease-in-out) infinite; }
.logo__text { font-size: 17px; line-height: 1; }
.logo__by { display: block; font-family: var(--mono); font-size: 10px; color: var(--ink-3); font-weight: 400; letter-spacing: 0.02em; margin-top: 3px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.72); opacity: 0.6; } }

/* ---------- Buttons ---------- */
.btn {
  --h: 44px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 20px;
  border-radius: 999px;
  font-size: 15px; font-weight: 500; letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden; isolation: isolate;
  transition: transform 0.35s var(--ease), background-color 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.btn svg { width: 18px; height: 18px; transition: transform 0.4s var(--ease); }
.btn:hover svg.arrow { transform: translateX(4px); }
.btn:active { transform: scale(0.97); }

.btn--primary { background: var(--white); color: var(--black); }
.btn--primary::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(0,0,0,0.12) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.8s var(--ease);
}
.btn--primary:hover::before { transform: translateX(100%); }
.btn--primary:hover { box-shadow: 0 0 0 6px rgba(255,255,255,0.08), 0 10px 40px rgba(255,255,255,0.15); }

.btn--ghost { border: 1px solid var(--line-2); color: var(--ink); }
.btn--ghost:hover { border-color: rgba(255,255,255,0.45); background: rgba(255,255,255,0.04); }

.btn--lg { --h: 54px; padding: 0 28px; font-size: 16px; }
.btn--sm { --h: 36px; padding: 0 16px; font-size: 14px; }
.btn--block { width: 100%; }

/* ---------- Badge / pill ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 8px;
  border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 13px; color: var(--ink-2);
  background: rgba(255,255,255,0.02);
  backdrop-filter: blur(8px);
}
.pill__dot { width: 18px; height: 18px; border-radius: 50%; background: var(--white); display: grid; place-items: center; }
.pill__dot::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--black); animation: pulse 2s var(--ease-in-out) infinite; }

/* ---------- Background layers ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  opacity: 0.6;
}
.bg-glow {
  position: fixed; z-index: -1; pointer-events: none;
  width: 600px; height: 600px; border-radius: 50%;
  left: 0; top: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.07), transparent 60%);
  transform: translate(-50%, -50%);
  transition: opacity 0.6s var(--ease);
  opacity: 0;
}
body.has-pointer .bg-glow { opacity: 1; }
.noise {
  position: fixed; inset: 0; z-index: 1000; pointer-events: none; opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- Scroll reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(6px);
  transition: opacity 1s var(--ease), transform 1s var(--ease), filter 1s var(--ease);
  transition-delay: var(--d, 0s);
}
[data-reveal].is-in { opacity: 1; transform: none; filter: none; }

/* ---------- Animated line icons ---------- */
.icon { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-draw path, .icon-draw circle, .icon-draw rect, .icon-draw line, .icon-draw polyline {
  stroke-dasharray: 120; stroke-dashoffset: 120;
  transition: stroke-dashoffset 1.6s var(--ease);
}
.is-in .icon-draw path, .is-in .icon-draw circle, .is-in .icon-draw rect, .is-in .icon-draw line, .is-in .icon-draw polyline,
.icon-draw.is-in path, .icon-draw.is-in circle, .icon-draw.is-in rect, .icon-draw.is-in line, .icon-draw.is-in polyline { stroke-dashoffset: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 900;
  transform: translate(-50%, 20px);
  padding: 12px 18px; border-radius: 12px;
  background: var(--white); color: var(--black);
  font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  max-width: calc(100% - 40px);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Scrollbar ---------- */
* { scrollbar-width: thin; scrollbar-color: #2a2a2a transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; filter: none; }
}
