/* ==========================================================================
   Fire Block 8 — Design System
   ========================================================================== */

:root {
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --bg-subtle: #f5f5f7;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --border: #e5e5e7;
  --accent: #c2410c;
  --accent-hover: #9a3412;
  --accent-soft: rgba(194, 65, 12, 0.08);
  --focus: #c2410c;
  --hero-glow: rgba(194, 65, 12, 0.12);
  --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.06);
  --header-height: 64px;
  --max-width: 1120px;
  --legal-width: 42rem;
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

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

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

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: var(--accent-hover);
}

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

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 1000;
  padding: 0.75rem 1rem;
  background: var(--text);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(250, 250, 250, 0.82);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
  background: rgba(250, 250, 250, 0.92);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  width: min(100% - 2.5rem, var(--max-width));
  margin-inline: auto;
}

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

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

.brand__mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  object-fit: contain;
  object-position: center;
  display: block;
  background: transparent;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

.nav-desktop a {
  position: relative;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-desktop a:hover {
  color: var(--text);
  background: var(--bg-subtle);
}

.nav-desktop a[aria-current="page"] {
  color: var(--text);
}

.nav-desktop a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.3rem;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: 8px;
}

.nav-toggle:hover {
  background: var(--bg-subtle);
}

.nav-toggle__icon {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  position: relative;
  transition: background 0.2s var(--ease);
}

.nav-toggle__icon::before,
.nav-toggle__icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: transform 0.25s var(--ease), top 0.25s var(--ease);
}

.nav-toggle__icon::before {
  top: -6px;
}

.nav-toggle__icon::after {
  top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon::after {
  top: 0;
  transform: rotate(-45deg);
}

.nav-mobile {
  position: fixed;
  inset: var(--header-height) 0 0 0;
  z-index: 99;
  background: rgba(250, 250, 250, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1.5rem;
  transform: translateY(-0.5rem);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
}

.nav-mobile.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-mobile nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 28rem;
  margin-inline: auto;
}

.nav-mobile a {
  display: block;
  color: var(--text);
  text-decoration: none;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
}

.nav-mobile a:hover,
.nav-mobile a[aria-current="page"] {
  background: var(--bg-subtle);
}

.nav-mobile a[aria-current="page"] {
  color: var(--accent);
}

body.nav-open {
  overflow: hidden;
}

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

  .nav-toggle,
  .nav-mobile {
    display: none;
  }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.85rem 1.5rem;
  border-radius: 980px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

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

.btn--secondary:hover {
  background: var(--bg-subtle);
  color: var(--text);
  border-color: #d2d2d7;
}

.btn--email {
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  padding-inline: 1.75rem;
}

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

.hero {
  position: relative;
  padding: clamp(3.5rem, 10vw, 7rem) 0 clamp(4rem, 12vw, 8rem);
  overflow: hidden;
}

.hero__grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.hero__eyebrow {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero__title {
  margin: 0 0 1.25rem;
  font-size: clamp(2.35rem, 7vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 700;
  max-width: 22ch;
}

.hero__lead {
  margin: 0 0 2rem;
  max-width: 34rem;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--text-secondary);
  line-height: 1.55;
}

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

.hero__visual {
  position: relative;
  min-height: 260px;
  display: grid;
  place-items: center;
}

.hero__glow {
  position: absolute;
  width: min(100%, 420px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--hero-glow) 0%, transparent 70%);
  filter: blur(8px);
  pointer-events: none;
}

.hero-blocks {
  position: relative;
  width: min(100%, 320px);
  aspect-ratio: 1;
}

.hero-block {
  position: absolute;
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
}

.hero-block--1 {
  width: 42%;
  height: 42%;
  top: 8%;
  left: 10%;
  background: linear-gradient(145deg, #c2410c, #ea580c);
  animation: float-a 7s ease-in-out infinite;
}

.hero-block--2 {
  width: 36%;
  height: 36%;
  top: 12%;
  right: 8%;
  background: var(--text);
  animation: float-b 8s ease-in-out infinite;
}

.hero-block--3 {
  width: 34%;
  height: 34%;
  bottom: 14%;
  left: 18%;
  background: #3f3f46;
  animation: float-c 9s ease-in-out infinite;
}

.hero-block--4 {
  width: 30%;
  height: 30%;
  bottom: 10%;
  right: 16%;
  background: linear-gradient(160deg, #fb923c, #c2410c);
  opacity: 0.9;
  animation: float-a 6.5s ease-in-out infinite reverse;
}

@keyframes float-a {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-12px) rotate(2deg);
  }
}

@keyframes float-b {
  0%,
  100% {
    transform: translateY(0) rotate(3deg);
  }
  50% {
    transform: translateY(10px) rotate(-1deg);
  }
}

@keyframes float-c {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-8px) rotate(3deg);
  }
}

.hero__copy > * {
  opacity: 0;
  transform: translateY(16px);
  animation: hero-in 0.8s var(--ease) forwards;
}

.hero__copy > *:nth-child(1) {
  animation-delay: 0.05s;
}

.hero__copy > *:nth-child(2) {
  animation-delay: 0.15s;
}

.hero__copy > *:nth-child(3) {
  animation-delay: 0.25s;
}

.hero__copy > *:nth-child(4) {
  animation-delay: 0.35s;
}

.hero__visual {
  opacity: 0;
  transform: translateY(20px);
  animation: hero-in 1s var(--ease) 0.2s forwards;
}

@keyframes hero-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 4rem;
  }

  .hero__visual {
    min-height: 380px;
  }
}

/* --------------------------------------------------------------------------
   Sections (Home)
   -------------------------------------------------------------------------- */

.section {
  padding: clamp(4rem, 10vw, 7rem) 0;
}

.section--subtle {
  background: var(--bg-subtle);
}

.section__header {
  max-width: 40rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.section__label {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

.section__title {
  margin: 0 0 0.85rem;
  font-size: clamp(1.85rem, 4.5vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.section__lead {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.work-grid {
  display: grid;
  gap: 1.25rem;
}

.work-panel {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: clamp(1.75rem, 4vw, 2.75rem);
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

.work-panel:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
  border-color: #d8d8dc;
}

.work-panel__index {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.work-panel__title {
  margin: 0 0 0.85rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.025em;
  font-weight: 700;
}

.work-panel__text {
  margin: 0;
  color: var(--text-secondary);
  max-width: 32rem;
}

.work-panel__motif {
  position: absolute;
  right: -1rem;
  bottom: -1rem;
  width: 120px;
  height: 120px;
  opacity: 0.12;
  pointer-events: none;
}

.work-panel--apps .work-panel__motif {
  background: linear-gradient(135deg, var(--accent), transparent);
  border-radius: 24px;
  transform: rotate(18deg);
}

.work-panel--games .work-panel__motif {
  background: linear-gradient(225deg, var(--text), transparent);
  border-radius: 28% 72% 40% 60%;
}

@media (min-width: 768px) {
  .work-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

.principles {
  display: grid;
  gap: 2rem;
}

.principle {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.principle__title {
  margin: 0 0 0.6rem;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.principle__text {
  margin: 0;
  color: var(--text-secondary);
  max-width: 28rem;
}

@media (min-width: 768px) {
  .principles {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }

  .principle {
    padding-top: 1.75rem;
  }
}

.about {
  display: grid;
  gap: 2rem;
}

.about__title {
  margin: 0;
  font-size: clamp(1.85rem, 4.5vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 700;
  max-width: 14ch;
}

.about__text {
  margin: 0;
  color: var(--text-secondary);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  max-width: 36rem;
  line-height: 1.65;
}

@media (min-width: 900px) {
  .about {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: start;
    gap: 4rem;
  }
}

.contact {
  text-align: center;
  padding: clamp(4.5rem, 12vw, 8rem) 0;
}

.contact__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.85rem, 4.5vw, 3rem);
  letter-spacing: -0.03em;
  font-weight: 700;
  line-height: 1.15;
}

.contact__lead {
  margin: 0 0 2rem;
  color: var(--text-secondary);
  font-size: 1.15rem;
}

/* --------------------------------------------------------------------------
   Reveal on scroll
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

.legal-hero {
  padding: clamp(2.5rem, 6vw, 4rem) 0 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.legal-hero__title {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.03em;
  font-weight: 700;
  line-height: 1.1;
}

.legal-hero__meta {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.legal-layout {
  display: grid;
  gap: 2.5rem;
  padding: 2.5rem 0 4rem;
  width: min(100% - 2.5rem, var(--max-width));
  margin-inline: auto;
}

.legal-toc {
  display: none;
}

.legal-toc__title {
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.legal-toc nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.legal-toc a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.35;
  padding: 0.2rem 0;
}

.legal-toc a:hover,
.legal-toc a.is-active {
  color: var(--accent);
}

.legal-content {
  max-width: var(--legal-width);
}

.legal-content > .legal-intro {
  margin: 0 0 1rem;
  color: var(--text-secondary);
}

.legal-content > .legal-intro:last-of-type {
  margin-bottom: 2rem;
}

.legal-content h2 {
  margin: 2.5rem 0 1rem;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  scroll-margin-top: calc(var(--header-height) + 1rem);
}

.legal-content h3 {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.legal-content p,
.legal-content li {
  color: var(--text);
  line-height: 1.7;
}

.legal-content p {
  margin: 0 0 1rem;
}

.legal-content ul {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
}

.legal-content li {
  margin-bottom: 0.4rem;
}

.legal-content li::marker {
  color: var(--text-secondary);
}

@media (min-width: 1024px) {
  .legal-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 3.5rem;
    align-items: start;
  }

  .legal-toc {
    display: block;
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
  }
}

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

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 3rem 0 2rem;
}

.footer__grid {
  display: grid;
  gap: 2rem;
}

.footer__brand-link {
  display: inline-block;
  text-decoration: none;
  margin-bottom: 0.35rem;
}

.footer__logo {
  width: 112px;
  height: auto;
  display: block;
}

.footer__brand {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.footer__blurb {
  margin: 0;
  color: var(--text-secondary);
  max-width: 22rem;
  font-size: 0.95rem;
}

.footer__heading {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.footer__links a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
}

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

.footer__bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

@media (min-width: 768px) {
  .footer__grid {
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 2.5rem;
  }
}

/* --------------------------------------------------------------------------
   Reduced 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;
  }

  .reveal,
  .hero__copy > *,
  .hero__visual {
    opacity: 1;
    transform: none;
  }

  .work-panel:hover {
    transform: none;
  }
}
