/* ==========================================================================
   Bracterra.dev — Responsive Glowing Landing Page
   Follows modern CSS best practices:
   - dvh viewport units for stable mobile layout
   - clamp() with rem + vw bounds (max <= 2.5x min) for WCAG 1.4.4 zoom
   - min-block-size instead of fixed heights on text controls
   - gradient color space interpolation fallback (--in-oklab)
   - compositor-friendly transform/opacity glowing animations
   ========================================================================== */

:root {
  --bg-deep: #071b1e;
  --bg-surface: #0a2428;
  --bg-elevated: rgba(13, 39, 44, 0.72);

  --text-primary: #f3f7f8;
  --text-secondary: #b9ccd1;
  --text-muted: #6e8c93;

  --glow-cyan: #2de1c2;
  --glow-teal: #1d9a8c;
  --glow-amber: #f5923e;
  --glow-copper: #d86932;

  --border-subtle: rgba(126, 186, 196, 0.16);
  --border-highlight: rgba(154, 224, 232, 0.28);

  /* Pointer coordinates updated gently via JS for interactive parallax glow */
  --pointer-x: 0;
  --pointer-y: 0;

  /* Safe pre-2024 gradient color space interpolation token */
  --in-oklab: ;
}

@supports (background: linear-gradient(in oklab, white, black)) {
  :root {
    --in-oklab: in oklab;
  }
}

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

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
}

body {
  min-block-size: 100vh;
  min-block-size: 100dvh;
  background:
    radial-gradient(
      circle at 50% 34% var(--in-oklab),
      #0e3237 0%,
      #082125 48%,
      #051619 100%
    );
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Ambient Background Glow & Subtle Grid
   ========================================================================== */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  isolation: isolate;
}

.ambient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
  will-change: transform, opacity;
}

.ambient-blob--teal {
  width: min(65vw, 34rem);
  aspect-ratio: 1;
  top: 6%;
  left: calc(50% - min(34vw, 18rem));
  background: radial-gradient(circle, rgba(39, 214, 185, 0.55) 0%, rgba(16, 102, 96, 0) 70%);
}

.ambient-blob--amber {
  width: min(60vw, 30rem);
  aspect-ratio: 1;
  top: 10%;
  left: calc(50% - min(12vw, 6rem));
  background: radial-gradient(circle, rgba(247, 142, 61, 0.45) 0%, rgba(145, 67, 22, 0) 70%);
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(180, 235, 240, 0.055) 1px, transparent 0);
  background-size: 2rem 2rem;
  mask-image: radial-gradient(circle at 50% 42%, black 20%, transparent 78%);
}

/* ==========================================================================
   Page Shell & Header (Language Switcher)
   ========================================================================== */
.page-shell {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding: clamp(1rem, 2.5vw, 1.85rem) clamp(1rem, 4vw, 2.75rem) clamp(1.5rem, 3.5vw, 2.5rem);
}

.site-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.85rem;
  min-block-size: 2.25rem;
  border-radius: 999px;
  background: rgba(11, 35, 39, 0.72);
  border: 1px solid rgba(118, 173, 182, 0.2);
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.lang-switcher:hover,
.lang-switcher:focus-within {
  border-color: rgba(74, 214, 194, 0.42);
  box-shadow:
    0 4px 22px rgba(27, 179, 161, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.lang-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.3rem;
  border-radius: 0.35rem;
  cursor: pointer;
  transition: color 0.2s ease, text-shadow 0.2s ease, background-color 0.2s ease;
}

.lang-btn:hover {
  color: var(--text-primary);
}

.lang-btn.is-active {
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(72, 229, 194, 0.55);
}

.lang-btn:focus-visible {
  outline: 2px solid var(--glow-cyan);
  outline-offset: 2px;
}

.lang-sep {
  color: rgba(140, 178, 184, 0.38);
  font-size: 0.75rem;
  user-select: none;
}

/* ==========================================================================
   Hero Layout
   ========================================================================== */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(1.1rem, 2.4vh, 1.75rem);
  padding-block: clamp(0.5rem, 2vh, 1.5rem);
}

/* ==========================================================================
   Center Glowing Orb & Logo Stage
   ========================================================================== */
.orb-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(11.5rem, 24vw, 15.5rem);
  aspect-ratio: 1;
  margin-block-end: 0.25rem;
  isolation: isolate;
}

/* Outer glowing aura with dual Teal + Orange halo matching the mockup */
.orb-aura {
  position: absolute;
  inset: -28%;
  pointer-events: none;
  z-index: 0;
  transform: translate3d(
    calc(var(--pointer-x, 0) * -10px),
    calc(var(--pointer-y, 0) * -10px),
    0
  );
  transition: transform 0.25s ease-out;
}

.aura-layer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  will-change: transform, opacity;
}

/* Left/Upper-Left Cyan-Teal Glow */
.aura-layer--cyan {
  background: radial-gradient(
    circle at 36% 42%,
    rgba(47, 224, 195, 0.62) 0%,
    rgba(27, 158, 148, 0.34) 36%,
    rgba(12, 71, 74, 0) 70%
  );
  filter: blur(22px);
}

/* Right/Upper-Right Amber-Orange Glow */
.aura-layer--orange {
  background: radial-gradient(
    circle at 66% 45%,
    rgba(255, 146, 56, 0.56) 0%,
    rgba(216, 97, 35, 0.28) 38%,
    rgba(80, 34, 14, 0) 70%
  );
  filter: blur(24px);
}

/* Conic rotating subtle halo */
.aura-ring {
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  background: conic-gradient(
    from 215deg,
    rgba(45, 225, 194, 0.45),
    rgba(255, 150, 64, 0.45),
    rgba(30, 120, 126, 0.18),
    rgba(45, 225, 194, 0.45)
  );
  filter: blur(26px);
  opacity: 0.75;
}

/* Dark 3D Glassmorphic Sphere */
.orb-sphere {
  position: relative;
  z-index: 1;
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(
      circle at 34% 28%,
      rgba(38, 92, 99, 0.55) 0%,
      rgba(14, 42, 47, 0.88) 54%,
      rgba(7, 23, 27, 0.96) 100%
    );
  box-shadow:
    /* Outer dual-hue bloom */
    -18px -10px 44px rgba(42, 214, 184, 0.22),
    18px -6px 44px rgba(244, 136, 54, 0.2),
    0 18px 40px rgba(0, 0, 0, 0.65),
    /* Inner rim highlights */
    inset -10px -10px 26px rgba(245, 140, 56, 0.14),
    inset 10px 10px 26px rgba(56, 224, 194, 0.18),
    inset 0 1px 2px rgba(215, 248, 250, 0.22);
  border: 1px solid rgba(152, 216, 222, 0.16);
  transform: translate3d(
    calc(var(--pointer-x, 0) * 6px),
    calc(var(--pointer-y, 0) * 6px),
    0
  );
  transition: transform 0.25s ease-out, box-shadow 0.35s ease;
}

.orb-sphere:hover {
  box-shadow:
    -24px -12px 56px rgba(42, 214, 184, 0.34),
    24px -8px 56px rgba(244, 136, 54, 0.32),
    0 20px 46px rgba(0, 0, 0, 0.7),
    inset -12px -12px 30px rgba(245, 140, 56, 0.22),
    inset 12px 12px 30px rgba(56, 224, 194, 0.26),
    inset 0 1px 3px rgba(230, 252, 255, 0.32);
}

.orb-inner-highlight {
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  background: radial-gradient(
    circle at 46% 35%,
    rgba(255, 255, 255, 0.07) 0%,
    transparent 60%
  );
  pointer-events: none;
}

.brand-mark {
  width: 82%;
  height: 82%;
  overflow: visible;
  shape-rendering: geometricPrecision;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
}

.logo-leaf--left,
.logo-leaf--right,
.logo-b {
  transform-origin: 110px 110px;
}

/* ==========================================================================
   Typography: Headline & Subtitle
   ========================================================================== */
.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.75rem, 1.8vh, 1.1rem);
  max-width: 42rem;
}

/* Responsive fluid typography with max <= 2.5x min for WCAG 1.4.4 zoom */
.hero-title {
  font-size: clamp(1.75rem, 1.1rem + 2.8vw, 3.35rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.028em;
  color: #ffffff;
  text-wrap: balance;
  text-shadow:
    0 2px 24px rgba(45, 225, 194, 0.14),
    0 4px 12px rgba(0, 0, 0, 0.45);
}

.hero-subtitle {
  font-size: clamp(0.92rem, 0.82rem + 0.45vw, 1.14rem);
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 52ch;
  text-wrap: pretty;
}

/* ==========================================================================
   Tech Stack Glowing Badges / Pills
   ========================================================================== */
.tech-pills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem 0.65rem;
  max-width: 39rem;
  margin-block-start: 0.15rem;
}

.pill-item {
  display: inline-flex;
}

.tech-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 2.1rem;
  padding: 0.32rem 0.95rem;
  border-radius: 999px;
  font-size: clamp(0.78rem, 0.73rem + 0.22vw, 0.88rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  background: var(--pill-bg, rgba(16, 48, 53, 0.65));
  color: var(--pill-text, #e6f4f5);
  border: 1px solid var(--pill-border, rgba(94, 179, 186, 0.3));
  box-shadow:
    0 0 18px -2px var(--pill-glow, rgba(45, 225, 194, 0.18)),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  cursor: default;
  user-select: none;
  transition:
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.tech-pill:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: var(--pill-border-hover, rgba(145, 235, 240, 0.65));
  box-shadow:
    0 0 24px 2px var(--pill-glow-strong, rgba(45, 225, 194, 0.38)),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* Color Variants matching the mockup's warm/cool glowing pills */
.tech-pill--amber {
  --pill-bg: linear-gradient(135deg var(--in-oklab), rgba(74, 43, 24, 0.72), rgba(43, 28, 22, 0.78));
  --pill-text: #ffd6b0;
  --pill-border: rgba(235, 143, 71, 0.42);
  --pill-border-hover: rgba(255, 174, 105, 0.78);
  --pill-glow: rgba(242, 136, 59, 0.22);
  --pill-glow-strong: rgba(242, 136, 59, 0.46);
}

.tech-pill--cyan {
  --pill-bg: linear-gradient(135deg var(--in-oklab), rgba(16, 66, 74, 0.76), rgba(12, 45, 54, 0.82));
  --pill-text: #b8f6ee;
  --pill-border: rgba(65, 208, 196, 0.42);
  --pill-border-hover: rgba(108, 245, 232, 0.8);
  --pill-glow: rgba(45, 225, 194, 0.24);
  --pill-glow-strong: rgba(45, 225, 194, 0.48);
}

.tech-pill--gold {
  --pill-bg: linear-gradient(135deg var(--in-oklab), rgba(66, 52, 24, 0.72), rgba(38, 34, 22, 0.78));
  --pill-text: #fde3a7;
  --pill-border: rgba(224, 174, 78, 0.4);
  --pill-border-hover: rgba(250, 205, 112, 0.78);
  --pill-glow: rgba(230, 175, 65, 0.22);
  --pill-glow-strong: rgba(230, 175, 65, 0.44);
}

.tech-pill--teal {
  --pill-bg: linear-gradient(135deg var(--in-oklab), rgba(17, 62, 62, 0.76), rgba(11, 42, 45, 0.82));
  --pill-text: #bdf2e4;
  --pill-border: rgba(68, 196, 172, 0.4);
  --pill-border-hover: rgba(110, 238, 212, 0.76);
  --pill-glow: rgba(52, 209, 178, 0.22);
  --pill-glow-strong: rgba(52, 209, 178, 0.46);
}

.tech-pill--emerald {
  --pill-bg: linear-gradient(135deg var(--in-oklab), rgba(18, 66, 52, 0.76), rgba(12, 44, 38, 0.82));
  --pill-text: #bef5d6;
  --pill-border: rgba(72, 204, 142, 0.42);
  --pill-border-hover: rgba(115, 242, 180, 0.78);
  --pill-glow: rgba(58, 214, 142, 0.24);
  --pill-glow-strong: rgba(58, 214, 142, 0.46);
}

.tech-pill--copper {
  --pill-bg: linear-gradient(135deg var(--in-oklab), rgba(71, 38, 33, 0.74), rgba(44, 25, 25, 0.8));
  --pill-text: #ffcab8;
  --pill-border: rgba(222, 118, 88, 0.42);
  --pill-border-hover: rgba(252, 154, 124, 0.78);
  --pill-glow: rgba(224, 110, 78, 0.22);
  --pill-glow-strong: rgba(224, 110, 78, 0.46);
}

/* ==========================================================================
   Contact CTA Bar & Footer Note
   ========================================================================== */
.cta-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-block-start: 0.4rem;
  width: 100%;
}

.contact-bar {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-block-size: 2.85rem;
  padding: 0.4rem 0.55rem 0.4rem 1.15rem;
  border-radius: 999px;
  background: rgba(12, 37, 42, 0.78);
  border: 1px solid rgba(120, 184, 194, 0.24);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.45),
    0 0 28px rgba(45, 225, 194, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.contact-bar:hover,
.contact-bar:focus-within {
  border-color: rgba(82, 219, 198, 0.48);
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.5),
    0 0 34px rgba(45, 225, 194, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.contact-prefix {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.contact-email {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.contact-email:hover {
  color: #7ef7e2;
  text-shadow: 0 0 12px rgba(72, 235, 205, 0.45);
}

.contact-email:focus-visible {
  outline: 2px solid var(--glow-cyan);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

.copy-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-block-size: 1.95rem;
  padding: 0.28rem 0.78rem;
  border-radius: 999px;
  background: rgba(31, 73, 81, 0.65);
  border: 1px solid rgba(132, 196, 204, 0.26);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease;
}

.copy-btn:hover {
  background: rgba(43, 102, 112, 0.82);
  color: #ffffff;
  border-color: rgba(142, 228, 235, 0.5);
}

.copy-btn:active {
  transform: scale(0.96);
}

.copy-btn.is-copied {
  background: rgba(32, 128, 110, 0.85);
  border-color: rgba(94, 242, 210, 0.75);
  color: #ebfffb;
}

.copy-btn:focus-visible {
  outline: 2px solid var(--glow-cyan);
  outline-offset: 2px;
}

.team-note {
  font-size: clamp(0.76rem, 0.72rem + 0.18vw, 0.84rem);
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* ==========================================================================
   Glowing Animations (Opt-in via prefers-reduced-motion: no-preference)
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .aura-layer--cyan {
    animation: pulse-cyan 6.5s ease-in-out infinite alternate;
  }

  .aura-layer--orange {
    animation: pulse-orange 7.5s ease-in-out infinite alternate;
  }

  .aura-ring {
    animation: slow-orbit 18s linear infinite;
  }

  .ambient-blob--teal {
    animation: float-teal 14s ease-in-out infinite alternate;
  }

  .ambient-blob--amber {
    animation: float-amber 16s ease-in-out infinite alternate;
  }

  .logo-leaf--left {
    animation: leaf-breathe-left 5.5s ease-in-out infinite alternate;
  }

  .logo-leaf--right {
    animation: leaf-breathe-right 6.2s ease-in-out infinite alternate;
  }

  .tech-pill {
    animation: pill-shimmer 5.5s ease-in-out infinite alternate;
  }

  .pill-item:nth-child(2n) .tech-pill {
    animation-delay: -1.8s;
  }

  .pill-item:nth-child(3n) .tech-pill {
    animation-delay: -3.4s;
  }
}

@keyframes pulse-cyan {
  0% {
    transform: translate3d(-4%, -3%, 0) scale(0.95);
    opacity: 0.78;
  }
  100% {
    transform: translate3d(4%, 4%, 0) scale(1.08);
    opacity: 1;
  }
}

@keyframes pulse-orange {
  0% {
    transform: translate3d(4%, 2%, 0) scale(1.05);
    opacity: 0.95;
  }
  100% {
    transform: translate3d(-5%, -4%, 0) scale(0.93);
    opacity: 0.72;
  }
}

@keyframes slow-orbit {
  from {
    transform: rotate(0deg) scale(0.98);
  }
  50% {
    transform: rotate(180deg) scale(1.05);
  }
  to {
    transform: rotate(360deg) scale(0.98);
  }
}

@keyframes float-teal {
  0% {
    transform: translate3d(-4%, -2%, 0) scale(0.96);
  }
  100% {
    transform: translate3d(5%, 6%, 0) scale(1.08);
  }
}

@keyframes float-amber {
  0% {
    transform: translate3d(4%, 4%, 0) scale(1.05);
  }
  100% {
    transform: translate3d(-6%, -3%, 0) scale(0.94);
  }
}

@keyframes leaf-breathe-left {
  0% {
    transform: rotate(0deg) scale(1);
  }
  100% {
    transform: rotate(-2.5deg) scale(1.025);
  }
}

@keyframes leaf-breathe-right {
  0% {
    transform: rotate(0deg) scale(1);
  }
  100% {
    transform: rotate(2.5deg) scale(1.03);
  }
}

@keyframes pill-shimmer {
  0% {
    opacity: 0.92;
  }
  100% {
    opacity: 1;
  }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 640px) {
  .page-shell {
    padding: 0.9rem 1rem 1.4rem;
  }

  .orb-stage {
    width: clamp(10.5rem, 48vw, 13.5rem);
  }

  .tech-pills {
    gap: 0.45rem;
  }

  .tech-pill {
    padding: 0.28rem 0.78rem;
  }

  .contact-bar {
    padding: 0.45rem 0.65rem;
    border-radius: 1.25rem;
    max-width: 100%;
  }
}

@media (max-width: 380px) {
  .contact-bar {
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.75rem 1rem;
  }
}
