/* ---------- Design tokens (Dreamshell design system) ---------- */
:root {
  --deep-cabinet: #0a0820;   /* app background */
  --neon-surface: #15102e;   /* card surface */
  --hot-pink: #ff2e93;       /* accent */
  --neon-mint: #5dedc8;      /* accent */
  --neon-purple: #b47bff;    /* secondary text, UI tint */
  --text: #ffffff;

  /* Product status dots */
  --status-on-hold: #d81b1b;
  --status-live: #39ff14;
  --status-waitlist: #ffd400;

  --font-heading: 'Oxanium', system-ui, sans-serif;
  --font-body: 'Rajdhani', system-ui, sans-serif;

  --card-radius: 3px;
  --page-max: 1310px;
  --gutter: clamp(16px, 3vw, 36px);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--deep-cabinet);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  margin: 0;
  line-height: 1.15;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--neon-mint);
  outline-offset: 4px;
}

/* Links inside body copy */
.text-link {
  text-decoration: underline;
  text-decoration-color: var(--neon-mint);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* ---------- Glitch hover effect for links (class + data-text added by js/glitch.js) ---------- */
.glitch {
  position: relative;
  display: inline-block;
  mix-blend-mode: lighten;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  width: 100%;
  background: var(--deep-cabinet);
  pointer-events: none;
  clip-path: inset(50% 0 50% 0);
}

.glitch::before {
  left: -1px;
  text-shadow: 1px 0 rgb(255 46 147 / 0.7);
}

.glitch::after {
  left: 1px;
  text-shadow: -1px 0 rgb(93 237 200 / 0.7);
}

.glitch:hover::before,
.glitch:focus-visible::before {
  text-shadow: 4px 0 rgb(255 46 147 / 0.7);
  animation: glitch-loop-1 0.8s infinite ease-in-out alternate-reverse;
}

.glitch:hover::after,
.glitch:focus-visible::after {
  text-shadow: -5px 0 rgb(93 237 200 / 0.7);
  animation: glitch-loop-2 0.8s infinite ease-in-out alternate-reverse;
}

/* A rect whose top is below its bottom shows nothing, which makes the flicker */
@keyframes glitch-loop-1 {
  0% { clip-path: inset(36% 0 91% 0); }
  25% { clip-path: inset(25% 0 1% 0); }
  50% { clip-path: inset(50% 0 0 0); }
  75% { clip-path: inset(30% 0 8% 0); }
  100% { clip-path: inset(91% 0 2% 0); }
}

@keyframes glitch-loop-2 {
  0% { top: -1px; left: 1px; clip-path: inset(65% 0 0 0); }
  25% { top: -6px; left: 4px; clip-path: inset(79% 0 81% 0); }
  50% { top: -3px; left: 2px; clip-path: inset(68% 0 89% 0); }
  75% { top: 0; left: -4px; clip-path: inset(95% 0 47% 0); }
  100% { top: -1px; left: -1px; clip-path: inset(31% 0 0 0); }
}

/* The logo has no text to copy, so it only gets a shake */
.site-logo:hover img,
.site-logo:focus-visible img {
  animation: logo-shake 0.6s infinite;
}

@keyframes logo-shake {
  0%,
  100% {
    transform: translate(0);
  }
  20% {
    transform: translate(-2px, 2px);
  }
  40% {
    transform: translate(2px, -2px);
  }
  60% {
    transform: translate(-1px, 1px);
  }
  80% {
    transform: translate(1px, -1px);
  }
}

/* ---------- Looping glitch on a word in the hero heading (needs data-text in the HTML) ---------- */
.glitch-title {
  position: relative;
  display: inline-block;
}

.glitch-title::before,
.glitch-title::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  background: var(--deep-cabinet);
  overflow: hidden;
  pointer-events: none;
  animation-duration: 3.4s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-direction: alternate-reverse;
}

.glitch-title::before {
  left: 3px;
  text-shadow: -2px 0 var(--hot-pink);
  animation-name: title-glitch-1;
}

.glitch-title::after {
  left: -3px;
  text-shadow: -2px 0 var(--neon-mint);
  animation-name: title-glitch-2;
}

/* Random slices, generated once from the original Sass loop (20 steps) */
@keyframes title-glitch-1 {
  0% { clip-path: inset(41% 0 81% 0); }
  5% { clip-path: inset(50% 0 17% 0); }
  10% { clip-path: inset(6% 0 91% 0); }
  15% { clip-path: inset(68% 0 88% 0); }
  20% { clip-path: inset(46% 0 26% 0); }
  25% { clip-path: inset(7% 0 36% 0); }
  30% { clip-path: inset(27% 0 96% 0); }
  35% { clip-path: inset(11% 0 45% 0); }
  40% { clip-path: inset(53% 0 92% 0); }
  45% { clip-path: inset(30% 0 89% 0); }
  50% { clip-path: inset(70% 0 46% 0); }
  55% { clip-path: inset(7% 0 28% 0); }
  60% { clip-path: inset(15% 0 72% 0); }
  65% { clip-path: inset(80% 0 20% 0); }
  70% { clip-path: inset(74% 0 93% 0); }
  75% { clip-path: inset(73% 0 26% 0); }
  80% { clip-path: inset(50% 0 94% 0); }
  85% { clip-path: inset(28% 0 95% 0); }
  90% { clip-path: inset(71% 0 83% 0); }
  95% { clip-path: inset(37% 0 47% 0); }
  100% { clip-path: inset(18% 0 31% 0); }
}

@keyframes title-glitch-2 {
  0% { clip-path: inset(15% 0 27% 0); }
  5% { clip-path: inset(39% 0 29% 0); }
  10% { clip-path: inset(87% 0 77% 0); }
  15% { clip-path: inset(13% 0 26% 0); }
  20% { clip-path: inset(73% 0 19% 0); }
  25% { clip-path: inset(24% 0 53% 0); }
  30% { clip-path: inset(12% 0 30% 0); }
  35% { clip-path: inset(91% 0 92% 0); }
  40% { clip-path: inset(72% 0 93% 0); }
  45% { clip-path: inset(79% 0 74% 0); }
  50% { clip-path: inset(63% 0 13% 0); }
  55% { clip-path: inset(68% 0 46% 0); }
  60% { clip-path: inset(99% 0 60% 0); }
  65% { clip-path: inset(59% 0 26% 0); }
  70% { clip-path: inset(58% 0 54% 0); }
  75% { clip-path: inset(38% 0 69% 0); }
  80% { clip-path: inset(23% 0 11% 0); }
  85% { clip-path: inset(99% 0 69% 0); }
  90% { clip-path: inset(10% 0 27% 0); }
  95% { clip-path: inset(38% 0 33% 0); }
  100% { clip-path: inset(63% 0 57% 0); }
}

/* Soft pink glows pinned to the top-left and bottom-right corners of the window */
.page-glow {
  position: fixed;
  width: min(520px, 80vw);
  height: auto;
  opacity: 0.35;
  pointer-events: none;
  z-index: -1;
}

.page-glow--top-left {
  top: 0;
  left: 0;
}

/* Same image flipped so its bright corner points into the bottom-right */
.page-glow--bottom-right {
  bottom: 0;
  right: 0;
  transform: rotate(180deg);
}

/* ---------- Header ---------- */
.site-header {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 36px var(--gutter) 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-logo img {
  width: 190px;
  height: auto;
}

/* Fade on the link, not the image, so the hover shake doesn't replay it */
.site-logo {
  display: block;
  animation: logo-fade-in 1.2s ease-out 0.15s both;
}

@keyframes logo-fade-in {
  from {
    opacity: 0;
    filter: blur(6px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

.site-nav {
  display: flex;
  gap: clamp(20px, 4vw, 56px);
  font-size: 1.375rem;
}

.site-nav a {
  text-decoration: none;
}

/* ---------- Main layout ---------- */
main {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter) 120px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  /*
   * Page space outside the hero on each side (centering space + gutter).
   * Negative margins pull the hero out by half of it; the right side keeps
   * room for the pink offset block.
   */
  --outside: calc(max((100vw - var(--page-max)) / 2, 0px) + var(--gutter));
  margin-left: calc(var(--outside) / -2);
  margin-right: calc(var(--shadow-x) - var(--outside) / 2);
  padding: clamp(32px, 6vw, 88px) clamp(24px, 4vw, 52px) clamp(28px, 4vw, 48px) clamp(24px, 5vw, 72px);
  --shadow-x: 22px;
  --shadow-y: 26px;
  /* v2: frame hidden but kept transparent so the layout doesn't shift */
  border: 3px solid transparent;

  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 300px);
  row-gap: clamp(24px, 3vw, 40px);
  column-gap: clamp(17px, 2.1vw, 28px);
  align-items: start;
}

.hero h1 {
  text-transform: uppercase;
  font-size: clamp(3.25rem, calc(4vw + 1rem), 4.5rem);
  letter-spacing: 0.01em;
  margin: 1rem 0 18px;
  /* Same fade-and-focus entrance as the logo, starting just after it */
  animation: logo-fade-in 1.2s ease-out 0.3s both;
}

/* Large SemiBold text, shared by the hero subheader and the About paragraph */
.hero__lede,
.about__text {
  font-weight: 600;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.4;
}

.hero__lede {
  max-width: 50ch;
  margin-bottom: 2rem;
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.button--primary {
  color: var(--text);
  background: linear-gradient(135deg, var(--hot-pink), #d4187a);
  box-shadow: 0 0 18px rgb(255 46 147 / 0.35);
}

.button--primary:hover,
.button--primary:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 0 28px rgb(255 46 147 / 0.6);
}

.button--primary:focus-visible {
  outline: 2px solid var(--neon-mint);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
  .button--primary:hover,
  .button--primary:focus-visible { transform: none; }
}

.button__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.hero__text {
  margin-right: 0.7rem;
  /* Wide right padding (up to 9.1rem) keeps the subheader lines short, as in the v2 mockup */
  padding: 1rem clamp(2rem, 21vw - 140px, 9.1rem) 1rem 0;
}

.hero__mascot {
  margin: -32px 0 0;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 20px;
  animation: slide-in-right 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

/* Quick start, soft landing (ease-out-quint) */
@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(80px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.hero__mascot img {
  width: 100%;
  max-width: 300px;
  height: auto;
}

.hero__mascot figcaption {
  font-size: 0.875rem;
  text-align: right;
  white-space: nowrap;
}

/* ---------- Homepage sections (Products, About, Contact) ---------- */
.section {
  margin-top: clamp(56px, 7vw, 80px);
  scroll-margin-top: 24px;
}

.section__header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: clamp(20px, 3vw, 40px);
}

/* The spinning circle beside each section title */
.section__icon,
.section__icon img {
  display: block;
  width: clamp(39px, 4.2vw, 56px);
  height: auto;
}

.section h2 {
  font-size: clamp(2rem, 3vw, 2.375rem);
  letter-spacing: 0.08em;
}

/* Content sits in the same lane as the project cards */
.section__body {
  padding: 0 clamp(0px, 3vw, 44px);
}

.products__list {
  display: grid;
  gap: 56px;
}

.contact__form {
  display: block;
  width: 100%;
  min-height: 540px;
  border: none;
  border-radius: 10px;
}

/* ---------- Project card component ---------- */
project-card {
  display: block;
}

.project-card {
  background: var(--deep-cabinet);
  border: 2px solid var(--hot-pink);
  border-radius: var(--card-radius);
  padding: clamp(24px, 3vw, 40px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 4.5vw, 58px);
  align-items: stretch;
}

.project-card__image {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  border-radius: 5px;
}

/* Whole image, vertically centered against the description */
.project-card__media--contain {
  display: flex;
  align-items: center;
}

.project-card__media--contain picture {
  width: 100%;
}

.project-card__image--contain {
  height: auto;
  min-height: 0;
  object-fit: contain;
}

.project-card__image--placeholder {
  background: #d9d9d9;
}

.project-card__content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.project-card__name a {
  text-decoration: none;
}

.project-card__name {
  font-size: clamp(1.75rem, 2.5vw, 2rem);
  letter-spacing: 0.08em;
  text-align: right;
  margin-bottom: 18px;
}

.project-card__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--neon-mint);
  border-radius: 20px;
  color: var(--text);
  font-size: 1rem;
  text-transform: uppercase;
  line-height: 1;
}

.status-pill__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
  animation: status-pulse 2.4s ease-in-out infinite;
}

.status-pill--live .status-pill__dot {
  color: var(--status-live);
}

.status-pill--waitlist .status-pill__dot {
  color: var(--status-waitlist);
}

.status-pill--on-hold .status-pill__dot {
  color: var(--status-on-hold);
}

/* Dot dims slightly while a soft ring of its own color swells and fades */
@keyframes status-pulse {
  0% {
    opacity: 1;
    box-shadow: 0 0 0 0 currentColor;
  }
  50% {
    opacity: 0.6;
  }
  70% {
    box-shadow: 0 0 0 6px transparent;
  }
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 transparent;
  }
}

.project-card__tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 25px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--neon-mint);
  font-size: 1rem;
  line-height: 1;
  text-transform: uppercase;
}

.tag__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.project-card__description {
  display: flex;
  flex-direction: column;
  gap: 1.5em;
  font-size: 1.25rem;
  line-height: 1.5;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero__mascot {
    margin-top: 0;
    align-items: center;
  }

  .hero__mascot img {
    max-width: 260px;
    margin-right: 0;
  }

  .hero__mascot figcaption {
    text-align: center;
    white-space: normal;
  }

  .project-card {
    grid-template-columns: 1fr;
  }

  .project-card__image {
    aspect-ratio: 4 / 3;
    min-height: 0;
    height: auto;
  }

  .project-card__image--contain {
    aspect-ratio: auto;
  }

  .project-card__content {
    align-items: flex-start;
  }

  .project-card__name {
    text-align: left;
  }

  .project-card__meta,
  .project-card__tags {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .site-nav {
    font-size: 1.125rem;
  }

  .hero {
    --shadow-x: 12px;
    --shadow-y: 14px;
  }

  .project-card__description {
    font-size: 1.125rem;
  }

  /* All-caps words are wide; scale with the screen so "INNOVATING" fits on one line */
  .hero h1 {
    font-size: clamp(2rem, 12vw, 3.25rem);
  }
}

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

  /* Hold the glitch layers still: a fixed slice on hover, and none on the heading */
  .glitch:hover::before,
  .glitch:hover::after,
  .glitch:focus-visible::before,
  .glitch:focus-visible::after,
  .site-logo:hover img,
  .site-logo:focus-visible img,
  .site-logo,
  .hero h1,
  .hero__mascot,
  .status-pill__dot {
    animation: none;
  }

  .glitch:hover::before,
  .glitch:focus-visible::before {
    clip-path: inset(25% 0 45% 0);
  }

  .glitch:hover::after,
  .glitch:focus-visible::after {
    clip-path: inset(65% 0 0 0);
  }

  .glitch-title::before,
  .glitch-title::after {
    display: none;
  }
}
