/* back-line.cc marketing page.
   Plain CSS, no build step. Dark, product-led, in the spirit of
   apple.com/mac-studio. Ink values come from the app's token family
   (frontend/src/index.css); the gold accent is the brand's old ration.
   Stock photo slots are background-images so a missing file degrades to
   the gradient underneath instead of a broken-image icon. */

:root {
  --ink-1000: #0f1216;
  --ink-950: #14181d;
  --ink-900: #1c222a;
  --ink-800: #262d36;
  --ink-700: #333c45;

  --text-1: #f5f6f7;
  --text-2: #a8b0b8;
  --text-3: #7d8790; /* 5.1:1 on --bg; #6f7982 failed WCAG AA at 4.23:1 */

  --gold: #e9b949;
  --gold-hi: #f2d45a;
  --gold-ink: #1a1408;

  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;

  --shadow-device:
    0 40px 100px rgba(0, 0, 0, 0.55),
    0 10px 30px rgba(0, 0, 0, 0.35);

  --max: 1180px;
  --gutter: 20px;
  --header-h: 52px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-1);
  background: var(--ink-1000);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

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

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

.wrap.narrow {
  max-width: 760px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  padding: 8px 12px;
  background: var(--gold);
  color: var(--gold-ink);
  border-radius: 6px;
  z-index: 100;
}

.skip-link:focus {
  left: 8px;
}

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

/* ---------- Type ---------- */

h1 {
  font-size: clamp(40px, 7.4vw, 88px);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(30px, 4.6vw, 54px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

h3 {
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.18;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

.lede {
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.5;
  color: var(--text-2);
  max-width: 620px;
  margin-top: 20px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 26px;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

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

.btn-primary {
  background: var(--gold);
  color: var(--gold-ink);
}

.btn-primary:hover {
  background: var(--gold-hi);
}

.btn-ghost {
  color: var(--text-1);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.02);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
}

.btn-sm {
  min-height: 32px;
  padding: 0 14px;
  font-size: 13px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 36px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(15, 18, 22, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-logo img {
  height: 22px;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 13px;
  color: var(--text-2);
}

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

@media (max-width: 640px) {
  .site-nav a:not(.btn) {
    display: none;
  }
}

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

.hero {
  position: relative;
  padding: calc(var(--header-h) + 8vh) 0 0;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--ink-1000);
  background-image:
    linear-gradient(to bottom, rgba(15, 18, 22, 0.55) 0%, rgba(15, 18, 22, 0.86) 55%, var(--ink-1000) 100%),
    radial-gradient(60% 40% at 50% 0%, rgba(233, 185, 73, 0.14), transparent 70%),
    url('/marketing/img/hero.jpg');
  background-size: cover, cover, cover;
  background-position: center top;
}

/* Film grain so the ink never reads as flat vinyl. */
.hero-bg::after,
.product-bg::after,
.break-bg::after,
.cta-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-logo {
  width: clamp(220px, 38vw, 380px);
  margin-bottom: 40px;
  animation: hero-in 900ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero h1 {
  max-width: 14ch;
  animation: hero-in 900ms 120ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-sub {
  margin-top: 24px;
  max-width: 560px;
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.5;
  color: var(--text-2);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
  animation: hero-in 900ms 220ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero .cta-row {
  animation: hero-in 900ms 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-login-line {
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-2);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
  animation: hero-in 900ms 400ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-login-line a {
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero-login-line a:hover {
  color: var(--gold);
}

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

/* The callsheet rises out of the hero, Mac Studio style. */
.hero-device {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 2 * var(--gutter)), 1180px);
  margin: clamp(56px, 9vh, 96px) auto 0;
}

/* ---------- Device frames ---------- */

.device {
  position: relative;
  margin: 0;
  background: var(--ink-900);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-device);
}

.device::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  pointer-events: none;
  z-index: 1;
}

.device img {
  width: 100%;
  height: auto;
}

.device-desktop {
  aspect-ratio: 16 / 10;
}

.device-inset {
  border-radius: var(--radius-md);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.device-phone {
  width: 250px;
  aspect-ratio: 390 / 844;
  border-radius: 34px;
  border: 6px solid #0a0c0f;
  box-shadow:
    0 0 0 1px var(--line-strong),
    var(--shadow-device);
}

.device-phone::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  width: 84px;
  height: 22px;
  transform: translateX(-50%);
  background: #0a0c0f;
  border-radius: 12px;
  z-index: 2;
}

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

.section {
  position: relative;
  padding: clamp(80px, 12vw, 160px) 0;
}

/* The callsheet band: an empty stage behind the copy, fading in from the
   ink under the hero frame and back out before the feature grid. */
.product {
  position: relative;
  text-align: center;
  padding: clamp(110px, 14vw, 200px) 0;
  overflow: hidden;
}

.product-bg {
  position: absolute;
  inset: 0;
  background-color: var(--ink-1000);
  background-image:
    linear-gradient(to bottom, var(--ink-1000) 0%, rgba(15, 18, 22, 0.45) 35%, rgba(15, 18, 22, 0.45) 65%, var(--ink-1000) 100%),
    radial-gradient(60% 55% at 50% 50%, rgba(15, 18, 22, 0.7), transparent 100%),
    url('/marketing/img/callsheet.jpg');
  background-size: cover;
  background-position: center 62%;
}

.product .wrap {
  position: relative;
}

.product h2 {
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}

.product .lede {
  color: #d3d8dd;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
}

.features {
  padding-top: clamp(88px, 10vw, 140px);
}

.product .lede {
  margin-left: auto;
  margin-right: auto;
}

.section-head {
  max-width: 640px;
  margin-bottom: clamp(40px, 6vw, 72px);
}

/* ---------- Feature grid ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.feature-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 600px;
  background: var(--ink-900);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  isolation: isolate;
}

.feature-card-textured::before,
.feature-card-phone::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to bottom, var(--ink-900) 30%, rgba(28, 34, 42, 0.55) 100%),
    var(--card-photo, none);
  background-size: cover;
  background-position: center;
  opacity: 0.9;
}

.feature-copy {
  padding: 40px 40px 0;
}

.feature-copy .eyebrow {
  margin-bottom: 12px;
}

.feature-copy p:not(.eyebrow) {
  margin-top: 12px;
  color: var(--text-2);
  max-width: 44ch;
}

.feature-media {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 36px 0 0 40px;
  min-height: 0;
}

/* Desktop crops bleed off the right and bottom edges. */
.feature-media .device-inset {
  width: 100%;
  border-top-right-radius: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-right: 0;
  border-bottom: 0;
  transform: translateX(6%);
  aspect-ratio: 16 / 10;
}

.feature-media .device-inset img {
  object-fit: cover;
  object-position: top left;
  height: 100%;
}

.feature-card-phone .feature-media {
  align-items: flex-end;
  padding: 36px 40px 0;
}

.feature-card-phone .device-phone {
  border-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  aspect-ratio: 390 / 560;
}

.feature-card-phone .device-phone img {
  object-fit: cover;
  object-position: top;
  height: 100%;
}

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

  .feature-card {
    min-height: 0;
  }

  .feature-copy {
    padding: 32px 28px 0;
  }

  .feature-media {
    padding-left: 28px;
  }

  .feature-card-phone .feature-media {
    padding: 32px 28px 0;
  }
}

/* ---------- Photo break ---------- */

.break {
  position: relative;
  min-height: min(72vh, 720px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 120px 0;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.break-bg {
  position: absolute;
  inset: 0;
  background-color: var(--ink-950);
  background-image:
    linear-gradient(to bottom, var(--ink-1000) 0%, rgba(15, 18, 22, 0.45) 30%, rgba(15, 18, 22, 0.45) 70%, var(--ink-1000) 100%),
    radial-gradient(55% 45% at 50% 50%, rgba(15, 18, 22, 0.7), transparent 100%),
    url('/marketing/img/break.jpg');
  background-size: cover;
  background-position: center 40%;
}

.break-inner {
  position: relative;
}

.break-line {
  font-size: clamp(36px, 7vw, 92px);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.04em;
  text-wrap: balance;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}

.break-sub {
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-1);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.8);
}

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

.cta {
  text-align: center;
  overflow: hidden;
}

.cta-bg {
  position: absolute;
  inset: 0;
  background-color: var(--ink-1000);
  background-image:
    linear-gradient(to bottom, var(--ink-1000) 0%, rgba(15, 18, 22, 0.8) 50%, var(--ink-1000) 100%),
    url('/marketing/img/cta.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.9;
}

.cta-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cta-logo {
  width: 150px;
  margin-bottom: 32px;
  opacity: 0.9;
}

.cta .lede {
  margin-left: auto;
  margin-right: auto;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  font-size: 13px;
  color: var(--text-3);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.footer-wordmark {
  color: var(--text-2);
  font-weight: 500;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a:hover,
.footer-wordmark:hover {
  color: var(--text-1);
}

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

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 700ms cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

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

  .reveal,
  .hero-logo,
  .hero h1,
  .hero-sub,
  .hero .cta-row,
  .hero-login-line {
    animation: none;
    transition: none;
    opacity: 1;
    transform: none;
  }
}
