/**
 * ARC Physique site styles — shadcn/ui token + component conventions
 * @see https://ui.shadcn.com/docs/theming
 * @see https://ui.shadcn.com/docs/components
 */

:root {
  /* Radius scale (shadcn) */
  --radius: 0.625rem;
  --radius-sm: calc(var(--radius) * 0.6);
  --radius-md: calc(var(--radius) * 0.8);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) * 1.4);

  /* ARC dark theme → shadcn semantic tokens
     Source of truth: lib/theme/augur_colors.dart (dark) + app icon reds */
  --background: #0a0a0a;
  --foreground: #f5f0ef;
  --card: #161414;
  --card-foreground: #f5f0ef;
  --popover: #161414;
  --popover-foreground: #f5f0ef;
  --primary: #e8433a;
  --primary-foreground: #ffffff;
  --primary-soft: #ff8f87;
  --secondary: #1e1a1a;
  --secondary-foreground: #f5f0ef;
  --muted: #1e1a1a;
  --muted-foreground: #c4b6b4;
  --accent: #1e1a1a;
  --accent-foreground: #f5f0ef;
  --destructive: #c22e26;
  --border: rgb(245 240 239 / 14%);
  --input: rgb(245 240 239 / 18%);
  --ring: #e8433a;

  --font-sans: "DM Sans", "Segoe UI", sans-serif;
  --font-display: "Syne", "DM Sans", sans-serif;
  --font-serif: "Source Serif 4", Georgia, serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--foreground);
  background: var(--background);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* —— Full-bleed hero stage (home) —— */
.hero-stage {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--background);
}

.hero-stage__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% 50%;
  z-index: 0;
}

.hero-stage__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      105deg,
      rgb(18 20 15 / 92%) 0%,
      rgb(18 20 15 / 78%) 38%,
      rgb(18 20 15 / 35%) 62%,
      rgb(18 20 15 / 55%) 100%
    ),
    linear-gradient(to top, rgb(18 20 15 / 75%) 0%, transparent 42%);
}

.hero-stage__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100svh;
}

.site-header--on-media {
  border-bottom-color: rgb(245 240 239 / 10%);
}

.page-home .hero-note {
  margin-top: 2rem;
}

/* —— Atmosphere (inner pages) —— */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 90% 70% at 78% 18%, rgb(232 67 58 / 16%), transparent 55%),
    radial-gradient(ellipse 60% 50% at 12% 88%, rgb(194 46 38 / 10%), transparent 50%),
    linear-gradient(165deg, #0a0a0a 0%, #161414 42%, #0a0a0a 100%);
  overflow: hidden;
}

.atmosphere::before {
  content: "";
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgb(245 240 239 / 3%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(245 240 239 / 3%) 1px, transparent 1px);
  background-size: 72px 72px;
  transform: rotate(-8deg);
  animation: grid-drift 28s linear infinite;
  pointer-events: none;
}

.atmosphere__glow {
  position: absolute;
  width: min(70vw, 640px);
  height: min(70vw, 640px);
  right: -8%;
  top: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(232 67 58 / 22%), transparent 68%);
  filter: blur(8px);
  animation: glow-breathe 7s var(--ease) infinite alternate;
  pointer-events: none;
}

@keyframes grid-drift {
  from {
    transform: rotate(-8deg) translateY(0);
  }
  to {
    transform: rotate(-8deg) translateY(-72px);
  }
}

@keyframes glow-breathe {
  from {
    opacity: 0.55;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1.06);
  }
}

/* —— Layout shell —— */
.shell {
  width: min(1120px, calc(100% - 2.5rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.42em;
  text-decoration: none;
  color: var(--foreground);
}

.wordmark span {
  text-indent: 0.42em;
}

.wordmark__mark {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0;
  flex-shrink: 0;
  object-fit: cover;
  background: #0a0a0a;
}

/* Navigation Menu–like links */
.nav {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.15rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.2s var(--ease),
    color 0.2s var(--ease);
}

.nav-link:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

.nav-link[aria-current="page"] {
  background: var(--secondary);
  color: var(--foreground);
}

/* —— Button (shadcn variants) —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.2s var(--ease),
    color 0.2s var(--ease),
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-default {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-default:hover {
  background: color-mix(in srgb, var(--primary) 88%, #000);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.btn-secondary:hover {
  background: color-mix(in srgb, var(--secondary) 85%, var(--foreground));
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--foreground);
}

.btn-outline:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

.btn-ghost {
  background: transparent;
  color: var(--foreground);
}

.btn-ghost:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

.btn-lg {
  min-height: 2.75rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
}

/* —— Badge —— */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.badge-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.badge-outline {
  border-color: var(--border);
  color: var(--foreground);
}

/* —— Alert —— */
.alert {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  max-width: 40rem;
  margin-top: 1.25rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--card-foreground);
}

.alert-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.alert-description {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.alert-warning {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  background: color-mix(in srgb, var(--primary) 8%, var(--card));
}

/* —— Card —— */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  color: var(--card-foreground);
  box-shadow: 0 1px 0 rgb(0 0 0 / 20%);
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem 1.25rem 0;
}

.card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-description {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.card-content {
  padding: 1.25rem;
}

.card-footer {
  display: flex;
  align-items: center;
  padding: 0 1.25rem 1.25rem;
}

/* —— Separator —— */
.separator {
  height: 1px;
  width: 100%;
  background: var(--border);
  border: 0;
  margin: 2rem 0;
}

/* —— Accordion (details/summary) —— */
.accordion {
  width: 100%;
  max-width: 36rem;
  border-top: 1px solid var(--border);
}

.accordion-item {
  border-bottom: 1px solid var(--border);
}

.accordion-trigger {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  color: var(--foreground);
}

.accordion-trigger::-webkit-details-marker {
  display: none;
}

.accordion-trigger::after {
  content: "+";
  flex-shrink: 0;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--muted-foreground);
  transition: transform 0.2s var(--ease);
}

.accordion-item[open] > .accordion-trigger::after {
  content: "−";
}

.accordion-content {
  padding: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--muted-foreground);
}

.accordion-content p {
  margin: 0;
}

.accordion-content a {
  color: var(--primary);
  text-underline-offset: 3px;
}

/* —— Typography (prose / shadcn typography feel) —— */
.prose {
  max-width: 42rem;
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--muted-foreground);
}

.prose h2 {
  margin: 2rem 0 0.65rem;
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--foreground);
}

.prose p {
  margin: 0 0 1rem;
}

.prose ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: 0.35rem;
}

.prose a {
  color: var(--primary);
  text-underline-offset: 3px;
}

.prose strong {
  color: var(--foreground);
  font-weight: 600;
}

.text-muted {
  color: var(--muted-foreground);
}

.text-link {
  color: var(--primary);
  text-underline-offset: 3px;
}

/* —— Hero —— */
.hero {
  min-height: calc(100vh - 5rem);
  display: grid;
  align-content: center;
  padding: 3.5rem 0 3rem;
  position: relative;
}

.hero--on-media {
  flex: 1;
  min-height: 0;
  align-content: end;
  padding: 2rem 0 4.5rem;
  max-width: 36rem;
}

.hero--on-media .btn-outline,
.hero--on-media .btn-ghost {
  backdrop-filter: blur(8px);
  background: rgb(18 20 15 / 35%);
}

.hero--on-media .btn-outline:hover,
.hero--on-media .btn-ghost:hover {
  background: rgb(18 20 15 / 55%);
}

.hero__brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(4.5rem, 18vw, 11rem);
  line-height: 0.88;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  text-transform: uppercase;
  color: var(--foreground);
  opacity: 0;
  transform: translateY(1.25rem);
  animation: rise 1s var(--ease) 0.1s forwards;
}

.hero__headline {
  margin: 1.75rem 0 0;
  max-width: 16ch;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(1.65rem, 3.6vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--foreground);
  opacity: 0;
  transform: translateY(1rem);
  animation: rise 1s var(--ease) 0.28s forwards;
}

.hero__support {
  margin: 1rem 0 0;
  max-width: 36ch;
  font-size: 1.0625rem;
  color: var(--muted-foreground);
  opacity: 0;
  transform: translateY(1rem);
  animation: rise 1s var(--ease) 0.42s forwards;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
  opacity: 0;
  transform: translateY(1rem);
  animation: rise 1s var(--ease) 0.56s forwards;
}

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

.hero-note {
  margin: 0 0 2.5rem;
  max-width: 40rem;
  font-size: 0.9375rem;
  color: var(--muted-foreground);
}

@media (max-width: 760px) {
  .shell {
    width: min(1120px, calc(100% - 1.5rem));
  }

  .site-header {
    gap: 0.5rem;
  }

  .wordmark {
    min-width: 0;
    letter-spacing: 0.14em;
    font-size: 0.9rem;
    gap: 0.35rem;
  }

  .wordmark span {
    text-indent: 0.14em;
    overflow: hidden;
    text-overflow: clip;
  }

  .nav-link {
    padding: 0.35rem 0.5rem;
    font-size: 0.8125rem;
  }

  .hero {
    padding-top: 2.5rem;
    min-height: auto;
  }

  .hero--on-media {
    padding-bottom: 3rem;
    max-width: none;
  }

  .hero__actions {
    gap: 0.5rem;
  }

  .hero__actions .btn-lg {
    min-height: 2.5rem;
    padding: 0.5rem 0.9rem;
    font-size: 0.8125rem;
  }

  .hero-stage__media {
    object-position: 70% 45%;
  }

  .hero-stage__scrim {
    background:
      linear-gradient(
        to top,
        rgb(18 20 15 / 94%) 0%,
        rgb(18 20 15 / 72%) 45%,
        rgb(18 20 15 / 40%) 100%
      );
  }
}

/* Narrow phones: keep nav fully visible on its own row */
@media (max-width: 520px) {
  .site-header {
    flex-wrap: wrap;
    row-gap: 0.35rem;
  }

  .wordmark {
    letter-spacing: 0.2em;
  }

  .wordmark span {
    text-indent: 0.2em;
  }

  .nav {
    flex: 1 0 100%;
    justify-content: flex-start;
    gap: 0.25rem;
    margin: 0 -0.35rem;
  }

  .hero__brand {
    letter-spacing: 0.16em;
    text-indent: 0.16em;
    font-size: clamp(3.25rem, 22vw, 5.5rem);
  }
}

/* —— Inner pages —— */
.page {
  padding: 2.5rem 0 1rem;
}

.page__eyebrow {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
}

.page__title {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 2.75rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--foreground);
}

.page__lede {
  margin: 0.85rem 0 0;
  max-width: 40ch;
  font-size: 1.0625rem;
  color: var(--muted-foreground);
}

.support-email {
  display: inline-block;
  margin-top: 0.35rem;
  font-family: var(--font-sans);
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--primary);
  text-decoration: none;
}

.support-email:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-footer {
  margin-top: 3rem;
  padding: 1.25rem 0 2.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.site-footer a {
  color: var(--foreground);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--primary);
}

@media (prefers-reduced-motion: reduce) {
  .atmosphere::before,
  .atmosphere__glow,
  .hero__brand,
  .hero__headline,
  .hero__support,
  .hero__actions {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .btn:hover {
    transform: none;
  }
}
