/* ==========================================================================
   Bugalabs — shared stylesheet
   Ad Tech × AI. Amber = ads/revenue. Violet = models.
   ========================================================================== */

:root {
  /* Surface */
  --ink:        #0d0e12;
  --ink-raised: #14161d;
  --ink-sunk:   #0a0b0e;
  --line:       rgba(255, 255, 255, 0.08);
  --line-hi:    rgba(255, 255, 255, 0.16);

  /* Text */
  --paper: #eceef4;
  --mute:  #8b92a4;
  --prose: #c3c8d4;

  /* Brand */
  --amber:      #ffb020;
  --amber-soft: rgba(255, 176, 32, 0.12);
  --amber-line: rgba(255, 176, 32, 0.35);
  --violet:      #7c5cff;
  --violet-soft: rgba(124, 92, 255, 0.12);
  --violet-line: rgba(124, 92, 255, 0.35);

  /* Type */
  --display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --body:    'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  /* Rhythm */
  --gutter:  1.25rem;
  --section: 7rem;
  --radius:  0.75rem;
}

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

html {
  scroll-behavior: smooth;
  /* Fixed nav is 4rem; keep anchor targets clear of it. */
  scroll-padding-top: 5rem;
}

body {
  font-family: var(--body);
  background-color: var(--ink);
  color: var(--paper);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

@media (min-width: 1024px) {
  .container { padding: 0 2rem; }
}

/* --- Eyebrow ------------------------------------------------------------ */
/* The mono label is the vernacular of this industry: ads.txt, bid requests,
   placement IDs are all plain text. Used as the page's structural marker. */

.eyebrow {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1.25rem;
}

.eyebrow::before {
  content: '';
  width: 1.5rem;
  height: 1px;
  background: var(--amber);
  flex-shrink: 0;
}

.eyebrow--center {
  justify-content: center;
}

/* --- Navigation --------------------------------------------------------- */

.nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 50;
  background: rgba(13, 14, 18, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background 0.3s ease;
}

.nav.is-scrolled {
  background: rgba(13, 14, 18, 0.96);
}

.nav .container {
  display: flex;
  height: 4rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

.brand svg {
  width: 1.5rem;
  height: 1.5rem;
  display: block;
}

.brand__word {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.0625rem;
  letter-spacing: 0.06em;
}

.nav__links {
  display: none;
  align-items: center;
  gap: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--mute);
}

@media (min-width: 768px) {
  .nav__links { display: flex; }
}

.nav__links a {
  transition: color 0.2s ease;
}

.nav__links a:hover {
  color: var(--paper);
}

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8125rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  font-family: var(--body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn--primary {
  background: var(--amber);
  color: #171100;
}

.btn--primary:hover {
  background: #ffc24d;
}

.btn--ghost {
  background: transparent;
  color: var(--paper);
  border-color: var(--line-hi);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--paper);
}

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

/* --- Sections ----------------------------------------------------------- */

.section {
  padding: var(--section) 0;
  border-top: 1px solid var(--line);
}

.section--sunk {
  background: var(--ink-sunk);
}

.section__title {
  font-size: clamp(1.75rem, 4vw, 2.375rem);
  margin-bottom: 0.875rem;
}

.section__lede {
  color: var(--mute);
  max-width: 34rem;
  font-size: 1.0625rem;
  margin-bottom: 3.5rem;
}

.section__head--center {
  text-align: center;
}

.section__head--center .section__lede {
  margin-left: auto;
  margin-right: auto;
}

/* --- Hero --------------------------------------------------------------- */

.hero {
  padding: 9rem 0 var(--section);
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero .container {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 3rem;
  }
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin-bottom: 1.5rem;
}

.hero h1 em {
  font-style: normal;
  color: var(--amber);
}

.hero__lede {
  color: var(--prose);
  font-size: 1.125rem;
  line-height: 1.7;
  max-width: 34rem;
  margin-bottom: 2.25rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
}

/* --- Signature: the ad slot --------------------------------------------- */
/* The hero art is a real IAB medium rectangle. It runs an auction and fills. */

.slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.slot__frame {
  position: relative;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 300 / 250;
  border: 1px dashed var(--line-hi);
  border-radius: 0.5rem;
  background: var(--ink-raised);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.25rem;
  text-align: center;
  transition: border-color 0.35s ease, background 0.35s ease, box-shadow 0.35s ease;
}

.slot__frame.is-filled {
  border-style: solid;
  border-color: var(--amber-line);
  background: linear-gradient(180deg, var(--amber-soft), var(--ink-raised) 70%);
  box-shadow: 0 0 60px -20px var(--amber);
}

.slot__state {
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  transition: color 0.35s ease;
}

.slot__frame.is-filled .slot__state {
  color: var(--amber);
}

.slot__bidder {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
  color: var(--paper);
  min-height: 1.6em;
  display: flex;
  align-items: center;
}

.slot__engine {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  color: var(--violet);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.slot__frame.is-filled .slot__engine {
  opacity: 1;
}

.slot__caption {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}

/* --- Cards -------------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
}

/* auto-fill, not auto-fit: with a single app live, the card should keep its
   natural width rather than stretch across the whole row. */
.grid--apps {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.card {
  background: var(--ink-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.card:hover {
  border-color: var(--line-hi);
}

.card__icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid var(--amber-line);
}

.card__icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Models are violet; ads are amber. */
.card__icon--model {
  background: var(--violet-soft);
  color: var(--violet);
  border-color: var(--violet-line);
}

.card h3 {
  font-size: 1.1875rem;
  margin-bottom: 0.625rem;
}

.card p {
  color: var(--mute);
  font-size: 0.9375rem;
  line-height: 1.65;
}

/* --- Split (stack detail) ----------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3.5rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .split {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 4.5rem;
  }
}

.split__art {
  order: -1;
}

@media (min-width: 1024px) {
  .split__art { order: 0; }
}

.split__art svg {
  width: 100%;
  height: auto;
  display: block;
}

.split h2 {
  font-size: clamp(1.75rem, 4vw, 2.375rem);
  margin-bottom: 1.25rem;
}

.split > div > p {
  color: var(--prose);
  font-size: 1.0625rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
  list-style: none;
}

.checklist li {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
}

.checklist li::before {
  content: '';
  width: 0.4375rem;
  height: 0.4375rem;
  margin-top: 0.5625rem;
  border-radius: 50%;
  background: var(--violet);
  flex-shrink: 0;
}

.checklist strong {
  display: block;
  font-weight: 600;
  color: var(--paper);
  font-size: 0.9688rem;
}

.checklist span {
  color: var(--mute);
  font-size: 0.9063rem;
  line-height: 1.6;
}

.checklist a {
  color: var(--amber);
  border-bottom: 1px solid var(--amber-line);
}

/* --- Apps --------------------------------------------------------------- */

.app-card {
  display: flex;
  flex-direction: column;
  background: var(--ink-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color 0.2s ease;
}

.app-card:hover {
  border-color: var(--amber-line);
}

/* Real store icons, masked to the iOS squircle-ish radius. Most app icons ship
   on a white plate, so the tile keeps its own background rather than the card's. */
.app-card__mark {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.875rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--line-hi);
  object-fit: cover;
  display: block;
}

.app-card h3 {
  font-size: 1.1875rem;
  margin-bottom: 0.375rem;
}

/* The store name in its home market. The display face has no Hangul, so let it
   sit in the body face as a secondary label rather than a fallback accident. */
.app-card__alt {
  font-family: var(--body);
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--mute);
  letter-spacing: 0;
}

.app-card__tag {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 0.875rem;
}

.app-card p {
  color: var(--mute);
  font-size: 0.9375rem;
  line-height: 1.65;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.store-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.store-links a {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 0.4375rem 0.75rem;
  border: 1px solid var(--line-hi);
  border-radius: 0.375rem;
  color: var(--prose);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.store-links a:hover {
  border-color: var(--amber);
  color: var(--amber);
}

/* --- Networks ----------------------------------------------------------- */
/* Every partner here is authorized in /app-ads.txt. Nothing is aspirational. */

/* Each partner is its own bordered cell. A shared 1px-gap grid would leave the
   trailing empty cells of the last row showing as a grey slab. */
.networks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 0.75rem;
}

.network {
  background: var(--ink-raised);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 1.25rem;
  transition: border-color 0.2s ease;
}

.network:hover {
  border-color: var(--amber-line);
}

.network__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.network__role {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
}

.networks-note {
  margin-top: 1.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--mute);
  text-align: center;
}

.networks-note a {
  color: var(--amber);
  border-bottom: 1px solid var(--amber-line);
}

/* --- CTA ---------------------------------------------------------------- */

.cta {
  padding: var(--section) 0;
  border-top: 1px solid var(--line);
  text-align: center;
  background:
    radial-gradient(ellipse 60% 100% at 50% 100%, var(--amber-soft), transparent 70%),
    var(--ink);
}

.cta h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1.25rem;
}

.cta p {
  color: var(--prose);
  font-size: 1.125rem;
  line-height: 1.7;
  max-width: 36rem;
  margin: 0 auto 2.25rem;
}

.cta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.875rem;
}

/* --- Footer ------------------------------------------------------------- */

.footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--line);
  background: var(--ink-sunk);
  font-size: 0.875rem;
  color: var(--mute);
}

.footer .container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .footer .container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
}

.footer__links a {
  transition: color 0.2s ease;
}

.footer__links a:hover {
  color: var(--paper);
}

/* --- Legal / prose pages ------------------------------------------------ */

.legal {
  padding: 8rem 0 5rem;
}

.legal .container {
  max-width: 46rem;
}

.legal h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  margin-bottom: 0.75rem;
}

.legal__date {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  padding-bottom: 2.5rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--line);
}

.legal h2 {
  font-size: 1.375rem;
  margin: 3rem 0 1rem;
}

.legal h3 {
  font-size: 1.0625rem;
  margin: 2rem 0 0.75rem;
  color: var(--paper);
}

.legal p,
.legal li {
  color: var(--prose);
  line-height: 1.75;
  margin-bottom: 0.875rem;
}

.legal ul,
.legal ol {
  padding-left: 1.25rem;
  margin-bottom: 1.25rem;
}

.legal li::marker {
  color: var(--amber);
}

.legal a {
  color: var(--amber);
  border-bottom: 1px solid var(--amber-line);
}

.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.875rem;
  display: block;
  overflow-x: auto;
}

.legal th,
.legal td {
  border: 1px solid var(--line);
  padding: 0.75rem;
  text-align: left;
  vertical-align: top;
  color: var(--prose);
}

.legal th {
  background: var(--ink-raised);
  color: var(--paper);
  font-weight: 600;
}

.callout {
  background: var(--ink-raised);
  border: 1px solid var(--line);
  border-left: 2px solid var(--violet);
  border-radius: 0.5rem;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.callout--warn {
  border-left-color: var(--amber);
}

.callout p:last-child {
  margin-bottom: 0;
}

/* --- Motion ------------------------------------------------------------- */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
