/* friðən.ai coming-soon page — brand kit v1.1 */

@font-face {
  font-family: "Manrope";
  src: url("assets/fonts/Manrope-Variable.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Inter";
  src: url("assets/fonts/Inter-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/JetBrainsMono-Variable.ttf") format("truetype");
  font-weight: 100 800;
  font-style: normal;
  font-display: block;
}

:root {
  --frithen-canvas: #0D1117;
  --frithen-surface: #161B22;
  --frithen-border: #30363D;
  --frithen-text: #E6EDF3;
  --frithen-muted: #8B949E;
  --frithen-accent: #A371F7;
  --frithen-accent-dark: #8957E5;
  --frithen-denied: #FF7B72;
  --frithen-denied-bg: rgba(248, 81, 73, 0.10);
  --grid: 32px;
  --content: 1080px;
  --radius: 12px;
  --rise-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --draw-ease: cubic-bezier(0.4, 0, 0.15, 1);
}

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

html {
  background: var(--frithen-canvas);
  color: var(--frithen-text);
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
}

body {
  min-height: 100vh;
  background: var(--frithen-canvas);
  position: relative;
  overflow-x: hidden;
}

::selection {
  background: rgba(163, 113, 247, 0.35);
  color: #fff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Background: faint dot grid + soft violet radial behind the hero */
.bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-glow {
  position: absolute;
  left: 50%;
  top: 120px;
  width: 920px;
  height: 720px;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse 50% 55% at 50% 42%,
    rgba(163, 113, 247, 0.16) 0%,
    rgba(163, 113, 247, 0.06) 36%,
    rgba(137, 87, 229, 0.02) 58%,
    transparent 72%
  );
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    circle at center,
    rgba(230, 237, 243, 0.055) 1px,
    transparent 1.15px
  );
  background-size: var(--grid) var(--grid);
  background-position: 50% 0;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 28%, #000 0%, #000 38%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 28%, #000 0%, #000 38%, transparent 78%);
}

/* Cursor-following wash. Stays off until a mouse or pen actually moves. */
.bg-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 0;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    circle,
    rgba(163, 113, 247, 0.14) 0%,
    rgba(163, 113, 247, 0.055) 32%,
    rgba(137, 87, 229, 0.02) 52%,
    transparent 68%
  );
  transform: translate3d(-100vw, -100vh, 0);
  transition: opacity 0.9s ease;
  will-change: transform;
}

.bg-cursor.is-on {
  opacity: 1;
}

.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: calc(var(--content) + 128px);
  margin: 0 auto;
  padding: 28px 64px 0;
  width: 100%;
}

.header-logo {
  display: block;
  height: 36px;
  width: auto;
}

/* Hero */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 88px 24px 0;
}

.hero-mark {
  display: block;
  width: 168px;
  height: auto;
  margin: 0 0 36px;
}

.hero-mark svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.mark-draw {
  fill: none;
  stroke: #C9A8FF;
  stroke-width: 11;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-opacity: 0;
}

.mark-ascender {
  stroke-linecap: butt;
  stroke-linejoin: miter;
}

.mark-fill {
  opacity: 1;
}

.hero-wordmark {
  width: 420px;
  max-width: 86vw;
  height: auto;
  margin: 0 0 22px;
  font-size: inherit;
  font-weight: inherit;
  line-height: 0;
}

.hero-wordmark img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-tagline {
  font-family: "Manrope", sans-serif;
  font-weight: 300;
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: var(--frithen-muted);
  margin: 0 0 28px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 12px;
  border: 1px solid var(--frithen-border);
  background: rgba(22, 27, 34, 0.72);
  border-radius: 999px;
  color: var(--frithen-muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--frithen-accent);
  box-shadow: 0 0 0 3px rgba(163, 113, 247, 0.18);
  flex-shrink: 0;
}

/* Pillars — the gap under the hero matches the old hero-to-next-section rhythm. */
.pillars-wrap {
  width: 100%;
  max-width: calc(var(--content) + 128px);
  margin: 0 auto;
  padding: 88px 64px 0;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.pillar {
  background: var(--frithen-surface);
  border: 1px solid var(--frithen-border);
  border-radius: var(--radius);
  padding: 28px 26px 30px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 100%;
}

.pillar-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--frithen-border);
  background: rgba(13, 17, 23, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--frithen-accent);
}

.pillar-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pillar h2 {
  font-family: "Manrope", sans-serif;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--frithen-text);
  margin: 0 0 8px;
  line-height: 1.3;
}

.pillar p {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 400;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--frithen-muted);
}

/* Footer */
.footer {
  margin-top: 104px;
  border-top: 1px solid var(--frithen-border);
  width: 100%;
}

.footer-inner {
  max-width: calc(var(--content) + 128px);
  margin: 0 auto;
  padding: 28px 64px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-logo {
  display: block;
  height: 28px;
  width: auto;
}

.footer-meta {
  color: var(--frithen-muted);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 400;
}

/* On-load hero sequence. Final state is the default; .motion hides the
   resting artwork until each beat finishes. */
html.motion .mark-draw {
  stroke-opacity: 1;
  stroke-linecap: butt;
  stroke-dasharray: 1.08;
  stroke-dashoffset: 1.08;
}

/* Whole hero lands by ~1.4s: draw, fill, bar, wordmark, tagline, pill. */
html.motion .mark-bowl {
  animation:
    draw 0.4s var(--draw-ease) 0s forwards,
    stroke-out 0.16s ease 0.5s forwards;
}

html.motion .mark-hole {
  animation:
    draw 0.26s var(--draw-ease) 0.22s forwards,
    stroke-out 0.16s ease 0.52s forwards;
}

html.motion .mark-ascender {
  animation:
    draw 0.22s var(--draw-ease) 0.36s forwards,
    stroke-out 0.14s ease 0.54s forwards;
}

html.motion .mark-fill {
  opacity: 0;
  animation: fade-in 0.2s ease 0.46s forwards;
}

html.motion .mark-bar {
  clip-path: inset(-55% 100% -55% -12%);
  animation: bar-sweep 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) 0.58s forwards;
}

html.motion .mark-bar-halo {
  opacity: 0;
  animation: fade-in 0.2s ease 0.76s forwards;
}

html.motion .mark-bar-core {
  animation: bar-glow 0.34s ease 0.72s forwards;
}

html.motion .hero-wordmark {
  opacity: 0;
  animation: rise 0.34s var(--rise-ease) 0.84s forwards;
}

html.motion .hero-tagline {
  opacity: 0;
  animation: rise 0.28s var(--rise-ease) 0.98s forwards;
}

html.motion .badge {
  opacity: 0;
  animation: rise 0.28s var(--rise-ease) 1.08s forwards;
}

html.motion .badge-dot {
  animation: dot-pulse 2.8s ease-in-out 1.3s infinite;
}

/* Scripted beats wait for main.js, so a failed script still shows the resting page. */
html.motion.play .pillar {
  opacity: 0;
  transform: translateY(18px);
}

html.motion.play .pillar.is-in {
  animation: rise 0.8s var(--rise-ease) forwards;
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

@keyframes stroke-out {
  to { stroke-opacity: 0; }
}

@keyframes fade-in {
  to { opacity: 1; }
}

@keyframes bar-sweep {
  from { clip-path: inset(-55% 100% -55% -12%); }
  to { clip-path: inset(-55% -14% -55% -14%); }
}

@keyframes bar-glow {
  0% { filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0)); }
  38% {
    filter:
      drop-shadow(0 0 7px rgba(255, 255, 255, 0.95))
      drop-shadow(0 0 18px rgba(163, 113, 247, 0.85));
  }
  100% { filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0)); }
}

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

@keyframes dot-pulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(163, 113, 247, 0.18);
    opacity: 1;
  }
  50% {
    box-shadow:
      0 0 8px 1px rgba(163, 113, 247, 0.55),
      0 0 0 6px rgba(163, 113, 247, 0.06);
    opacity: 0.72;
  }
}

/* Reduced motion: resting layout, no playback, even if .motion was set. */
@media (prefers-reduced-motion: reduce) {
  html.motion *,
  html.motion *::before,
  html.motion *::after {
    animation: none !important;
    transition: none !important;
  }

  html.motion .mark-draw {
    stroke-opacity: 0 !important;
  }

  html.motion .mark-fill,
  html.motion .mark-bar,
  html.motion .mark-bar-halo,
  html.motion .hero-wordmark,
  html.motion .hero-tagline,
  html.motion .badge,
  html.motion .pillar,
  html.motion .bg-cursor {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    clip-path: none !important;
  }

  html.motion .bg-cursor {
    opacity: 0 !important;
  }
}

/* If scripted motion cannot run, show the finished page. */
html.motion-fallback .pillar,
html.motion-fallback .hero-wordmark,
html.motion-fallback .hero-tagline,
html.motion-fallback .badge,
html.motion-fallback .mark-fill,
html.motion-fallback .mark-bar,
html.motion-fallback .mark-bar-halo {
  opacity: 1 !important;
  transform: none !important;
  clip-path: none !important;
  animation: none !important;
  filter: none !important;
}

html.motion-fallback .mark-draw {
  stroke-opacity: 0 !important;
}

/* Mobile */
@media (max-width: 720px) {
  .header {
    padding: 20px 20px 0;
  }

  .header-logo {
    height: 28px;
  }

  .hero {
    padding: 64px 20px 0;
  }

  .hero-mark {
    width: 128px;
    margin-bottom: 28px;
  }

  .hero-wordmark {
    width: 300px;
    margin-bottom: 18px;
  }

  .hero-tagline {
    font-size: 18px;
    margin-bottom: 22px;
    max-width: 20em;
  }

  .pillars-wrap {
    padding: 56px 20px 0;
  }

  .pillars {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .pillar {
    padding: 22px 20px 24px;
  }

  .footer {
    margin-top: 80px;
  }

  .footer-inner {
    padding: 22px 20px 28px;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .bg-glow {
    width: 140%;
    left: 50%;
    top: 80px;
    height: 520px;
  }
}
