/* ==========================================================================
   F1GAR Studios — styles
   ========================================================================== */

:root {
  --bg: #0b0b0c;
  --bg-raised: #121214;
  --text: #ecebe6;
  --muted: #8b8a85;
  --line: #232326;
  --accent: #ff5b2e;

  --font-sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;

  --container: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section-y: clamp(5rem, 12vw, 10rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Reset ------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, p, ol {
  margin: 0;
}

ol {
  padding: 0;
  list-style: none;
}

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

em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

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

/* Layout ------------------------------------------------------------------ */

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

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

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.section-label,
.eyebrow {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-title {
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.035em;
}

/* Header ------------------------------------------------------------------ */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background: rgba(11, 11, 12, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: block;
}

.logo img {
  display: block;
  width: auto;
  height: 40px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  font-size: 0.9375rem;
}

.site-nav a {
  position: relative;
  color: var(--muted);
  transition: color 0.25s var(--ease);
}

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

.site-nav .nav-cta {
  color: var(--text);
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease);
}

.site-nav .nav-cta:hover {
  border-color: var(--text);
}

/* EN · ES switcher */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: -0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.lang-option {
  padding: 0.25rem 0.1rem;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  transition: color 0.25s var(--ease);
}

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

.lang-option[aria-pressed="true"] {
  color: var(--accent);
  cursor: default;
}

.lang-sep {
  opacity: 0.6;
}

.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  background: none;
  border: 0;
  cursor: pointer;
}

.nav-toggle span {
  position: absolute;
  left: 11px;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.35s var(--ease), top 0.35s var(--ease);
}

.nav-toggle span:first-child { top: 18px; }
.nav-toggle span:last-child  { top: 25px; }

.nav-toggle[aria-expanded="true"] span:first-child {
  top: 21.5px;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  top: 21.5px;
  transform: rotate(-45deg);
}

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

.hero {
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  padding: 8rem 0 clamp(3rem, 8vw, 6rem);
}

.hero .container {
  width: 100%;
}

/* Ambient falling symbols (page-wide, decorative; driven by js/ambient.js) */

/* Fixed to the viewport so it stays visible while scrolling. Sits at layer 0
   with page content lifted above it, rather than relying on a negative
   z-index that a background on <html> could cover. */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  animation: ambient-in 2s var(--ease) both;
}

main,
.site-footer {
  position: relative;
  z-index: 1;
}

/* Full-height track; translating it by 100% carries the glyph top to bottom */
.ambient-item {
  position: absolute;
  top: 0;
  height: 100%;
  will-change: transform;
}

.ambient-glyph {
  display: block;
  will-change: transform;
}

.ambient-glyph svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ambient-glyph svg * {
  vector-effect: non-scaling-stroke;
}

.ambient-glyph.is-filled svg {
  fill: currentColor;
  stroke: none;
  opacity: 0.75;
}

.ambient-text {
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ambient-f1 {
  background: currentColor;
  -webkit-mask: url("../images/f1-mark-white.png") center / contain no-repeat;
  mask: url("../images/f1-mark-white.png") center / contain no-repeat;
}

.tone-gray   { color: rgba(139, 138, 133, 0.42); }
.tone-light  { color: rgba(236, 235, 230, 0.2); }
.tone-accent { color: rgba(255, 91, 46, 0.55); }

@keyframes ambient-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* Logo is 672×348 natively; width capped there so it's never upscaled at 1x */
.hero-title {
  line-height: 0;
}

.hero-title img {
  display: block;
  width: clamp(10.2rem, 43.35vw, 35.7rem);
  max-width: 100%;
  height: auto;
}

/* Sized at ~5% of the wordmark width so it scales with it */
.hero-studios {
  display: block;
  margin-top: 0.85em;
  font-size: clamp(0.6875rem, 2.17vw, 1.785rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #a8a8a8;
}

.hero-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.hero-lead {
  max-width: 32rem;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  color: var(--muted);
}

/* Button ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.6rem;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  font-size: 1rem;
  border-radius: 999px;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

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

.btn-arrow {
  display: inline-block;
  transition: transform 0.35s var(--ease);
}

.btn:hover .btn-arrow {
  transform: translateX(4px);
}

/* Services ---------------------------------------------------------------- */

.services {
  border-bottom: 1px solid var(--line);
}

.service {
  display: grid;
  grid-template-columns: 5rem 1fr 1fr;
  gap: 1.5rem 2rem;
  align-items: baseline;
  padding: clamp(1.75rem, 4vw, 2.75rem) 0;
  border-top: 1px solid var(--line);
  transition: padding-left 0.5s var(--ease);
}

.service-num {
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.service-name {
  font-size: clamp(1.75rem, 3.6vw, 3rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.03em;
  transition: color 0.3s var(--ease);
}

.service-desc {
  max-width: 28rem;
  color: var(--muted);
}

@media (hover: hover) {
  .service:hover {
    padding-left: 1rem;
  }

  .service:hover .service-name {
    color: var(--accent);
  }
}

/* Pricing ----------------------------------------------------------------- */

.pricing-intro {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1.25rem;
  text-align: right;
}

.pricing-lead {
  color: var(--muted);
}

.plans {
  border-bottom: 1px solid var(--line);
}

.plan {
  border-top: 1px solid var(--line);
}

.plan-head {
  font: inherit;
}

.plan-toggle {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr) minmax(0, 1.15fr) 11rem 1.5rem;
  grid-template-areas: "num name desc price icon";
  gap: 1rem 2rem;
  align-items: baseline;
  width: 100%;
  padding: clamp(1.75rem, 4vw, 2.75rem) 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.plan-num {
  grid-area: num;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.plan-name {
  grid-area: name;
  font-size: clamp(1.75rem, 3.6vw, 3rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.03em;
  transition: color 0.3s var(--ease);
}

.plan-desc {
  grid-area: desc;
  max-width: 24rem;
  color: var(--muted);
}

.plan-price {
  grid-area: price;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.plan-amount {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1;
}

.plan-amount--quote {
  font-family: var(--font-sans);
  font-style: normal;
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.plan-term {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Plus that rotates into a minus when open */
.plan-icon {
  grid-area: icon;
  position: relative;
  align-self: center;
  justify-self: end;
  width: 14px;
  height: 14px;
  color: var(--muted);
  transition: color 0.3s var(--ease);
}

.plan-icon::before,
.plan-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1.5px;
  margin-top: -0.75px;
  background: currentColor;
  transition: transform 0.4s var(--ease);
}

.plan-icon::after {
  transform: rotate(90deg);
}

.plan-toggle[aria-expanded="true"] .plan-icon::after {
  transform: rotate(0deg);
}

.plan-toggle[aria-expanded="true"] .plan-icon {
  color: var(--text);
}

@media (hover: hover) {
  .plan-toggle:hover .plan-name {
    color: var(--accent);
  }

  .plan-toggle:hover .plan-icon {
    color: var(--text);
  }
}

.plan-panel {
  display: grid;
  grid-template-rows: 1fr;
}

.js .plan-panel {
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows 0.5s var(--ease), visibility 0.5s;
}

.js .plan.is-open .plan-panel {
  grid-template-rows: 1fr;
  visibility: visible;
}

.plan-panel-inner {
  min-height: 0;
  overflow: hidden;
}

.plan-includes,
.plan-features,
.plan-cta {
  margin-left: 7rem;
}

.plan-includes {
  margin-bottom: 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.plan-features {
  margin-top: 0;
  margin-bottom: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 2rem;
  max-width: 44rem;
}

.plan-features li {
  position: relative;
  padding: 0.35rem 0 0.35rem 1.5rem;
  break-inside: avoid;
}

.plan-features li::before {
  content: "";
  position: absolute;
  top: 1.15em;
  left: 0;
  width: 0.75rem;
  height: 1px;
  background: var(--muted);
}

.plan-cta {
  margin-top: 2rem;
  margin-bottom: clamp(2rem, 4vw, 2.75rem);
}

.pricing-note {
  max-width: 40rem;
  margin-top: 2rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* About ------------------------------------------------------------------- */

.about {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 2rem;
}

.about-text {
  font-size: clamp(1.625rem, 3.8vw, 3.25rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.about-text em {
  color: var(--accent);
}

/* Contact ----------------------------------------------------------------- */

.contact-title {
  margin-top: 1.5rem;
  font-size: clamp(2.5rem, 8vw, 6.5rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.contact-lead {
  max-width: 34rem;
  margin-top: 1.5rem;
  color: var(--muted);
}

.contact-phone {
  display: inline-block;
  margin-top: clamp(2.5rem, 6vw, 4rem);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.75rem, 6vw, 4.5rem);
  line-height: 1.1;
  font-variant-numeric: lining-nums;
  white-space: nowrap;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: color 0.3s var(--ease), background-size 0.5s var(--ease);
}

.contact-phone:hover {
  color: var(--accent);
  background-size: 100% 1px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: clamp(2rem, 4vw, 3rem);
}

.btn-secondary {
  padding: 0.75rem 1.3rem;
  background: transparent;
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
  border: 1px solid var(--line);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.btn-secondary:hover {
  background: transparent;
  color: var(--text);
  border-color: var(--text);
}

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

.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}

/* Reveal animation (only active when JS is running) ----------------------- */

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

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

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Pricing entrance (only active when JS is running) ---------------------- */

/* Divider lines are redrawn as pseudo-elements over the existing (now
   transparent) 1px borders, so layout and final position are unchanged. */
.js .plans {
  position: relative;
  border-bottom-color: transparent;
}

.js .plan {
  position: relative;
  border-top-color: transparent;
}

.js .plans::after,
.js .plan::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.7s cubic-bezier(0.45, 0, 0.2, 1);
  pointer-events: none;
}

.js .plan::before { top: -1px; }
.js .plans::after { bottom: -1px; }

.js .plans.is-visible::after,
.js .plan.is-visible::before {
  transform: none;
}

/* Rows: content fades up. A keyframe animation is used (not a transition)
   so the panel's own expand/collapse transition is left untouched. The
   150ms stagger between rows is scheduled in main.js. */
.js .plan > * {
  opacity: 0;
}

.js .plan.is-visible > * {
  opacity: 1;
  animation: plan-rise 0.7s var(--ease) backwards;
}

@keyframes plan-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .plans::after,
  .js .plan::before {
    transform: none;
    transition: none;
  }

  .js .plan > *,
  .js .plan.is-visible > * {
    opacity: 1;
    animation: none;
  }
}

/* Responsive -------------------------------------------------------------- */

@media (max-width: 900px) {
  .service {
    grid-template-columns: 3.5rem 1fr;
  }

  .service-desc {
    grid-column: 2;
  }

  .about {
    grid-template-columns: 1fr;
  }

  .plan-toggle {
    grid-template-columns: 3.5rem minmax(0, 1fr) auto 1.5rem;
    grid-template-areas:
      "num name price icon"
      ".   desc desc  .";
  }

  .plan-includes,
  .plan-features,
  .plan-cta {
    margin-left: 5.5rem;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: fixed;
    inset: 72px 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.5rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .site-nav a {
    width: 100%;
    padding: 0.9rem 0;
    font-size: 1.5rem;
    color: var(--text);
    border-bottom: 1px solid var(--line);
  }

  .site-nav .nav-cta {
    padding: 0.9rem 0;
    border: 0;
    border-radius: 0;
  }

  .lang-switch {
    margin: 1.25rem 0 0;
    gap: 0.6rem;
    font-size: 0.9375rem;
  }

  .lang-option {
    padding: 0.5rem 0.25rem;
  }

  .site-header.menu-open {
    background: var(--bg);
    border-bottom-color: var(--line);
  }

  .hero-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .service {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .service-desc {
    grid-column: auto;
  }

  .pricing-intro {
    align-items: flex-start;
    text-align: left;
  }

  .plan-toggle {
    grid-template-columns: minmax(0, 1fr) 1.5rem;
    grid-template-areas:
      "num   icon"
      "name  ."
      "desc  ."
      "price .";
    gap: 0.75rem 1rem;
  }

  .plan-price {
    flex-direction: row;
    align-items: baseline;
    gap: 0.75rem;
    margin-top: 0.25rem;
  }

  .plan-term {
    margin-top: 0;
  }

  .plan-includes,
  .plan-features,
  .plan-cta {
    margin-left: 0;
  }

  .plan-features {
    columns: 1;
  }
}
