/* OldPulsar Studio — cosmic landing */

:root {
  --space-deep: #020617;
  --space-mid: #0f172a;
  --beam-gold: #fde047;
  --beam-hot: #ffffff;
  --accent-blue: #38bdf8;
  --accent-blue-soft: #60a5fa;
  --text-primary: rgba(255, 255, 255, 0.92);
  --text-secondary: rgba(255, 255, 255, 0.68);
  --text-muted: rgba(255, 255, 255, 0.45);
  --glass: rgba(15, 23, 42, 0.72);
  --glass-border: rgba(56, 189, 248, 0.15);
  --artio-bg: #061512;
  --artio-amber: #f5a623;
  --artio-blue: #3b82f6;
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --max-width: 72rem;
  --header-h: 4rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--space-deep);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--beam-hot);
}

a:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
  border-radius: 2px;
}

/* —— Layout —— */

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

/* —— Header —— */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--glass);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.brand:hover {
  color: var(--beam-hot);
}

.brand__mark {
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.site-nav a:hover {
  color: var(--accent-blue);
}

/* —— Hero —— */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 2rem) 0 4rem;
  isolation: isolate;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse 80% 60% at 30% 40%, var(--space-mid) 0%, var(--space-deep) 70%);
}

.hero__stars {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.85;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 25% 65%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 40% 15%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 55% 80%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 70% 35%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1.5px 1.5px at 85% 55%, rgba(255, 255, 255, 0.65), transparent),
    radial-gradient(1px 1px at 15% 85%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1px 1px at 92% 12%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 48% 48%, rgba(56, 189, 248, 0.35), transparent),
    radial-gradient(1px 1px at 62% 22%, rgba(255, 255, 255, 0.35), transparent);
  background-size: 100% 100%;
  animation: starDrift 120s linear infinite;
}

@keyframes starDrift {
  to {
    transform: translateY(-2%);
  }
}

.hero__vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse 100% 80% at 50% 50%, transparent 30%, rgba(2, 6, 23, 0.75) 100%);
  pointer-events: none;
}

.hero__beam-wrap {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.hero__beam {
  position: absolute;
  top: 18%;
  left: -15%;
  width: 140vw;
  height: 14vh;
  min-height: 5rem;
  transform: rotate(45deg);
  transform-origin: center center;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(245, 158, 11, 0.08) 18%,
    rgba(253, 224, 71, 0.45) 38%,
    rgba(255, 255, 255, 0.85) 50%,
    rgba(253, 224, 71, 0.45) 62%,
    rgba(245, 158, 11, 0.08) 82%,
    transparent 100%
  );
  filter: blur(18px);
  opacity: 0.92;
  animation: beamPulse 7s linear infinite;
  will-change: opacity;
}

.hero__beam--sharp {
  top: 20%;
  height: 3vh;
  min-height: 1.25rem;
  filter: none;
  opacity: 0.55;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(253, 224, 71, 0.2) 40%,
    rgba(255, 255, 255, 0.95) 50%,
    rgba(253, 224, 71, 0.2) 60%,
    transparent 100%
  );
  animation: none;
}

@keyframes beamPulse {
  0%,
  100% {
    opacity: 0.68;
  }
  25%,
  75% {
    opacity: 0.84;
  }
  50% {
    opacity: 1;
  }
}

.hero__core-wrap {
  position: absolute;
  top: 22%;
  left: 12%;
  z-index: 3;
  width: clamp(4rem, 12vw, 7rem);
  height: clamp(4rem, 12vw, 7rem);
  pointer-events: none;
}

.hero__orbit {
  position: absolute;
  inset: -60%;
  border: 1px solid rgba(253, 224, 71, 0.12);
  border-radius: 50%;
}

.hero__orbit--mid {
  inset: -35%;
  border-width: 2px;
  border-color: rgba(253, 224, 71, 0.22);
}

.hero__core {
  position: absolute;
  inset: 15%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, var(--beam-hot) 0%, var(--beam-gold) 55%, #f59e0b 100%);
  box-shadow:
    0 0 24px rgba(253, 224, 71, 0.5),
    0 0 64px rgba(253, 224, 71, 0.28);
}

.hero__core::after {
  content: "";
  position: absolute;
  inset: -55%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.35) 0%,
    rgba(253, 224, 71, 0.4) 28%,
    rgba(253, 224, 71, 0.12) 52%,
    transparent 72%
  );
  animation: coreGlow 7s linear infinite;
  will-change: opacity;
}

@keyframes coreGlow {
  0%,
  100% {
    opacity: 0.35;
  }
  25%,
  75% {
    opacity: 0.62;
  }
  50% {
    opacity: 0.9;
  }
}

.hero__content {
  position: relative;
  max-width: 36rem;
}

.hero .container {
  position: relative;
  z-index: 4;
}

.hero__eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-blue);
}

.hero__title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--beam-hot) 0%, var(--beam-gold) 45%, var(--accent-blue-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  margin: 0;
  font-size: clamp(1.05rem, 2.5vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 32ch;
}

/* —— Sections —— */

.section {
  padding: 5rem 0;
}

.section--projects {
  background: linear-gradient(180deg, var(--space-deep) 0%, #030712 50%, var(--space-deep) 100%);
  border-top: 1px solid rgba(56, 189, 248, 0.08);
}

.section__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  color: var(--text-primary);
}

.section__subtitle {
  margin: 0 0 2.5rem;
  color: var(--text-muted);
  font-size: 1rem;
}

/* —— Project card —— */

.projects-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  }
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 1rem;
  background: linear-gradient(160deg, rgba(6, 21, 18, 0.95) 0%, rgba(6, 21, 18, 0.7) 100%);
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--artio-amber), var(--artio-blue));
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(59, 130, 246, 0.15);
}

.project-card__header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.project-card__icon {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 18%;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.project-card__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
}

.project-card__desc {
  margin: 0;
  flex: 1;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.project-card__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.project-card__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6.5rem;
  min-height: 2.75rem;
  padding: 0.6rem 1.25rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: rgba(6, 21, 18, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.5rem;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.project-card__link:hover {
  color: var(--beam-hot);
  background: rgba(6, 21, 18, 0.75);
}

.project-card__link--privacy {
  border-color: rgba(245, 166, 35, 0.45);
}

.project-card__link--privacy:hover {
  border-color: rgba(245, 166, 35, 0.75);
  box-shadow: 0 0 16px rgba(245, 166, 35, 0.2);
}

.project-card__link--terms {
  border-color: rgba(59, 130, 246, 0.45);
}

.project-card__link--terms:hover {
  border-color: rgba(59, 130, 246, 0.75);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.2);
}

/* —— Footer —— */

.site-footer {
  padding: 3rem 0 2rem;
  border-top: 1px solid rgba(56, 189, 248, 0.1);
  background: var(--space-deep);
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.site-footer__email {
  font-size: 1.05rem;
  font-weight: 500;
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.5rem;
  font-size: 0.875rem;
}

.site-footer__legal a {
  color: var(--text-muted);
}

.site-footer__legal a:hover {
  color: var(--accent-blue);
}

.site-footer__copy {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* —— Legal pages —— */

.page-legal {
  padding-top: calc(var(--header-h) + 2rem);
  padding-bottom: 4rem;
  min-height: 60vh;
}

.legal {
  max-width: 48rem;
}

.legal-lang-nav {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(56, 189, 248, 0.15);
}

.legal-lang-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: 0.35rem;
  border: 1px solid transparent;
}

.legal-lang-nav a:hover {
  color: var(--accent-blue);
  border-color: rgba(56, 189, 248, 0.25);
  background: rgba(56, 189, 248, 0.08);
}

.legal-body h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin: 0 0 1.25rem;
  line-height: 1.2;
}

.legal-body > p:first-of-type,
.legal-body > p:nth-of-type(-n + 4) {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.legal-body p {
  color: var(--text-secondary);
  margin: 0 0 1rem;
}

.legal-body h2.legal-lang-heading {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 3rem 0 1.25rem;
  padding-top: 1rem;
  color: var(--accent-blue);
  border-top: 1px solid rgba(56, 189, 248, 0.2);
}

.legal-body h2#english {
  margin-top: 2rem;
  border-top: none;
  padding-top: 0;
}

.legal-body h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  color: var(--text-primary);
}

.legal-body h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
  color: var(--text-primary);
}

.legal-body ul {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
  color: var(--text-secondary);
}

.legal-body li {
  margin-bottom: 0.5rem;
}

.legal-body li::marker {
  color: var(--accent-blue);
}

.legal-body hr {
  border: none;
  border-top: 1px solid rgba(56, 189, 248, 0.15);
  margin: 2rem 0;
}

.legal-body code {
  font-size: 0.88em;
  padding: 0.15em 0.4em;
  border-radius: 0.25rem;
  background: rgba(15, 23, 42, 0.8);
  color: var(--accent-blue-soft);
}

.legal-body a {
  color: var(--accent-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-body a:hover {
  color: var(--beam-hot);
}

.legal-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* —— Reduced motion —— */

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

  .hero__stars,
  .hero__beam,
  .hero__core::after {
    animation: none;
  }
}

/* —— Responsive hero —— */

@media (max-width: 639px) {
  .hero__beam {
    top: calc(var(--header-h) + 0.75rem);
    left: -30%;
    width: 160vw;
    opacity: 0.65;
  }

  .hero__beam--sharp {
    top: calc(var(--header-h) + 1.75rem);
    opacity: 0.4;
  }

  .hero__core-wrap {
    top: calc(var(--header-h) + 2.75rem);
    left: 50%;
    transform: translateX(-50%);
  }

  .hero__content {
    margin-top: calc(var(--header-h) + 7.5rem);
    text-align: center;
    margin-inline: auto;
  }

  .hero__lead {
    margin-inline: auto;
  }

  .site-nav {
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 2rem;
  }

  .hero__content {
    max-width: none;
  }

  .hero__beam {
    top: 25%;
    left: 5%;
  }

  .hero__beam--sharp {
    top: 27%;
  }

  .hero__core-wrap {
    top: 28%;
    left: 55%;
  }
}
