/* ===========================================================
   Rowmotion — design tokens
   =========================================================== */
:root {
  /* colors */
  --bg: #0b0c0f;
  --surface: #141620;
  --surface-alt: #1b1e2a;
  --surface-alt-2: #181b26;
  --border-soft: rgba(255, 255, 255, .06);
  --border-med: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);
  --text-primary: #f5f5f7;
  --text-primary-2: #f2f2f5;
  --text-secondary: rgba(255, 255, 255, .6);
  --text-secondary-2: rgba(255, 255, 255, .55);
  --text-muted: rgba(255, 255, 255, .5);
  --text-muted-2: rgba(255, 255, 255, .4);
  --text-faint: rgba(255, 255, 255, .35);
  --accent: #528298;
  --accent-light: #8fb0c2;
  --accent-red: #b23030;
  --success: #6ee7a8;
  --warning: #f2a154;

  /* type */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  /* layout */
  --page-max: 1440px;
  --page-pad: clamp(64px, 9vw, 160px);
  --radius-card: 12px;
  --radius-btn: 8px;
  --radius-pill: 100px;
}

/* ===========================================================
   Reset / base
   =========================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ===========================================================
   Shared: page inner width
   =========================================================== */
.nav__inner,
.hero__inner,
.gallery__inner {
  max-width: var(--page-max);
  margin: 0 auto;
}

.contact__inner {
  max-width: 640px;
  margin: 0 auto;
}

/* ===========================================================
   Nav
   =========================================================== */
.nav {
  border-bottom: 1px solid var(--border-soft);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px var(--page-pad);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 18px var(--font-display);
  color: var(--text-primary-2);
  letter-spacing: -0.02em;
}

.nav__logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
  flex: none;
  display: block;
}

.nav__links {
  display: flex;
  gap: 36px;
  align-items: center;
  margin-left: 48px;
  margin-right: 36px;
}

.nav__links a {
  font: 500 14px var(--font-body);
  color: var(--text-secondary);
  transition: color .15s ease;
}

.nav__links a:hover {
  color: var(--text-primary-2);
}

.nav__cta {
  margin-left: auto;
}

/* ===========================================================
   Buttons
   =========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 600 15px var(--font-body);
  padding: 14px 28px;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter .15s ease, background-color .15s ease, border-color .15s ease;
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { filter: brightness(1.1); }
.btn--primary:active { filter: brightness(0.95); }

.btn--secondary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-primary-2);
}
.btn--secondary:hover { border-color: rgba(255, 255, 255, .32); }

.btn--small {
  padding: 10px 20px;
  font-size: 14px;
  border-radius: 7px;
}

/* ===========================================================
   Hero
   =========================================================== */
.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
  align-items: center;
  padding: 88px var(--page-pad) 96px;
}

.hero__text {
  display: flex;
  flex-direction: column;
  gap: 22px;
  text-align: left;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  font: 500 13px var(--font-body);
  color: var(--text-secondary);
  width: fit-content;
}

.eyebrow__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.hero__headline {
  margin: 0;
  font: 600 52px/1.1 var(--font-display);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.hero__subhead {
  margin: 0;
  font: 400 18px/1.55 var(--font-body);
  color: var(--text-secondary-2);
  max-width: 480px;
}

.hero__ctas {
  display: flex;
  gap: 14px;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* ---- hero visual ---- */
.hero__visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  width: 100%;
}

/* spreadsheet mockup */
.mock-sheet {
  width: 340px;
  max-width: 100%;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--border-med);
  overflow: hidden;
  text-align: left;
  flex: 1 1 340px;
}

/* Modifier: reused inside gallery "before" panels, where the card itself
   already provides the rounded corner + clipping, so this just needs to
   fill the available box instead of being its own floating card. */
.mock-sheet--fill {
  width: 100%;
  height: 100%;
  flex: none;
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}

.mock-sheet--fill .mock-sheet__body {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
}

.mock-sheet--fill .mock-sheet__grid {
  width: 100%;
}

.mock-sheet__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #5c5f6b;
  flex: none;
}

.mock-sheet__filename {
  font: 500 12px var(--font-mono);
  color: var(--text-muted-2);
  margin-left: 8px;
}

.mock-sheet__body {
  padding: 14px 16px;
}

.mock-sheet__grid {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border-soft);
  border-radius: 6px;
  overflow: hidden;
}

.mock-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1px;
}

.cell {
  padding: 8px 10px;
  font: 400 11px var(--font-mono);
  color: rgba(255, 255, 255, .7);
  line-height: 1.5;
  overflow-wrap: break-word;
}

.cell--head {
  background: var(--surface-alt);
  font-weight: 600;
  color: var(--text-secondary-2);
}

.cell--row1 { background: var(--surface); }
.cell--row2 { background: var(--surface-alt-2); }

.cell--up { color: var(--success); font-weight: 600; }
.cell--warn { color: var(--warning); font-weight: 600; }

/* arrow */
.arrow {
  flex: none;
  animation: floatArrow 1.8s ease-in-out infinite;
}

/* animated post / phone mockup */
.mock-phone {
  width: 190px;
  border-radius: 26px;
  background: var(--surface);
  border: 1px solid var(--border-med);
  padding: 9px;
  flex: none;
}

.mock-phone__screen {
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent-light), var(--accent-red));
  background-size: 200% 200%;
  animation: shimmer 3.5s linear infinite;
  aspect-ratio: 9 / 16;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 14px;
}

/* Real rendered post video — fills the screen, sits above the gradient
   fallback. If src is empty/broken, this has no intrinsic size and the
   gradient + bars behind it show through instead. */
.mock-phone__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.mock-phone__bars {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 60px;
}

.bar {
  width: 10px;
  background: rgba(255, 255, 255, .85);
  border-radius: 3px;
  transform-origin: bottom;
  animation: pulseBar 1.4s ease-in-out infinite;
}

.bar:nth-child(1) { height: 40%; animation-delay: 0s; }
.bar:nth-child(2) { height: 65%; animation-delay: .15s; }
.bar:nth-child(3) { height: 90%; background: rgba(255, 255, 255, .95); animation-delay: .3s; }
.bar:nth-child(4) { height: 50%; animation-delay: .45s; }

.mock-phone__caption {
  text-align: center;
  font: 500 10px var(--font-mono);
  color: var(--text-muted-2);
  padding-top: 8px;
}

/* ===========================================================
   Gallery
   =========================================================== */
.gallery__inner {
  padding: 0 var(--page-pad) 96px;
}

.gallery__title {
  margin: 0 0 8px;
  font: 600 30px var(--font-display);
  color: var(--text-primary-2);
  letter-spacing: -0.01em;
}

.gallery__subtitle {
  margin: 0 0 36px;
  font: 400 16px var(--font-body);
  color: var(--text-muted);
  max-width: 520px;
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.gallery-card {
  position: relative;
  margin: 0;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-med);
}

/* Red arrow marking the before -> after transition. Absolutely positioned
   so it overlays the seam between the two panels without affecting their
   layout. The seam sits at a fixed 27/91 (~29.7%) of the card's height —
   that ratio falls out of the two panels' aspect ratios (4:3 over 9:16)
   and stays constant regardless of card width, so this works at any
   screen size without JS measurement. */
.gallery-card__arrow {
  position: absolute;
  top: 29.7%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  pointer-events: none;
}

.gallery-card__arrow-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border-strong);
}

/* Both panels: a fallback background shows while/if the real media is
   missing, with the <img>/<video> layered on top filling the frame, and
   a small caption chip pinned in the corner so it stays readable either
   way. */
.gallery-card__before,
.gallery-card__after {
  position: relative;
  overflow: hidden;
}

.gallery-card__before {
  aspect-ratio: 4 / 3;
  background: repeating-linear-gradient(135deg, var(--surface-alt), var(--surface-alt) 10px, #20232f 10px, #20232f 20px);
}

.gallery-card__after {
  aspect-ratio: 9 / 16;
}

.gallery-card__after--indigo { background: linear-gradient(160deg, var(--accent), var(--surface-alt)); }
.gallery-card__after--red { background: linear-gradient(160deg, var(--accent-red), var(--surface-alt)); }
.gallery-card__after--lightindigo { background: linear-gradient(160deg, var(--accent-light), var(--surface-alt)); }

/* Real image/video — fills the panel, sits above the fallback background.
   If src is empty/broken, this has no intrinsic box and the background
   behind it shows through instead. */
.gallery-card__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  display: block;
}

.gallery-card__label {
  position: absolute;
  z-index: 2;
  left: 10px;
  bottom: 10px;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(11, 12, 15, .72);
  backdrop-filter: blur(3px);
  font: 500 11px var(--font-mono);
  color: var(--text-secondary);
  max-width: calc(100% - 20px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===========================================================
   About
   =========================================================== */
.about__inner {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 56px;
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--page-pad) 120px;
}

.about__image {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: repeating-linear-gradient(135deg, var(--surface-alt), var(--surface-alt) 10px, #20232f 10px, #20232f 20px);
  border: 1px solid var(--border-med);
}

.about__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about__text {
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
}

.about__title {
  margin: 0;
  font: 600 34px var(--font-display);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.about__body {
  margin: 0;
  font: 400 17px/1.6 var(--font-body);
  color: var(--text-secondary-2);
  max-width: 560px;
}

.about__text .btn {
  align-self: flex-start;
  margin-top: 4px;
}

/* ===========================================================
   Contact
   =========================================================== */
.contact {
  border-top: 1px solid var(--border-soft);
}

.contact__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 96px var(--page-pad) 120px;
}

.contact__title {
  margin: 0;
  font: 600 34px var(--font-display);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.contact__body {
  margin: 0 0 8px;
  font: 400 17px/1.6 var(--font-body);
  color: var(--text-secondary-2);
  max-width: 440px;
}

.contact__links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-light);
  transition: color .15s ease;
}

.contact-link:hover {
  color: var(--text-primary);
}

.contact-link:hover .contact-link__value {
  text-decoration: underline;
}

.contact-link__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  flex: none;
}

.contact-link__text {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.contact-link__label {
  font: 500 12px var(--font-body);
  color: var(--text-muted);
}

.contact-link__value {
  font: 600 16px var(--font-body);
  color: currentColor;
}

/* ===========================================================
   Footer
   =========================================================== */
.footer {
  border-top: 1px solid var(--border-soft);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 40px var(--page-pad);
}

.footer__logo {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-card);
  object-fit: cover;
  flex: none;
  display: block;
}

.footer__text {
  font: 400 13px var(--font-body);
  color: var(--text-faint);
}

/* ===========================================================
   Keyframes
   =========================================================== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulseBar {
  0%, 100% { transform: scaleY(.4); }
  50% { transform: scaleY(1); }
}

@keyframes floatArrow {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}

/* ===========================================================
   Responsive
   =========================================================== */

/* Tablet — fluid page padding, gallery to 2 cols */
@media (max-width: 1100px) {
  :root { --page-pad: 40px; }

  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Hero stacks, nav links hide (logo + CTA remain) */
@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
    padding-top: 56px;
    padding-bottom: 64px;
  }

  .hero__text { text-align: left; }

  .hero__headline { font-size: 40px; }

  .hero__visual {
    margin-top: 16px;
  }

  .nav__links {
    display: none;
  }

  .nav__cta {
    margin-left: 0;
  }

  .about__inner {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-bottom: 80px;
  }

  .about__image {
    max-width: 340px;
  }
}

/* Small mobile — page padding tighter, visual stacks, single-column gallery */
@media (max-width: 600px) {
  :root { --page-pad: 20px; }

  .hero__headline { font-size: 32px; }
  .hero__subhead { font-size: 16px; max-width: none; }

  .hero__visual {
    flex-direction: column;
    gap: 16px;
  }

  .arrow {
    transform: rotate(90deg);
  }

  @keyframes floatArrow {
    0%, 100% { transform: rotate(90deg) translateX(0); }
    50% { transform: rotate(90deg) translateX(6px); }
  }

  .mock-sheet,
  .mock-phone {
    width: 100%;
    max-width: 340px;
  }

  .gallery__grid {
    grid-template-columns: 1fr;
  }

  .gallery__title { font-size: 26px; }

  .about__title { font-size: 28px; }
  .about__image { max-width: 100%; }

  .btn {
    padding: 13px 22px;
  }

  .hero__ctas {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__ctas .btn {
    text-align: center;
  }

  .contact__inner {
    padding: 72px var(--page-pad) 88px;
  }

  .contact__title { font-size: 28px; }

  .contact__links {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-link {
    justify-content: flex-start;
  }
}