/* =========================================================
   Reflines — design tokens (light + dark)
   ========================================================= */
:root {
  --bg: #FBFAF7;
  --surface: #F4F2EC;
  --surface-2: #EEEEEE;
  --border: #D9D9D9;
  --text: #000000;
  --text-muted: #1F1F1F;
  --text-soft: #4A4A4A;
  --accent: #7ABA4A;
  --accent-strong: #6CAE3E;
  --accent-ink: #FFFFFF;
  --footer-bg: #373737;
  --footer-text: #BFBFBF;
  --footer-heading: #FFFFFF;
  --btn-store-bg: transparent;
  --btn-store-fg: #446D26;
  --btn-store-border: #446D26;
  --icon-color: #446D26;
  --shadow-card: 0 1px 0 rgba(0,0,0,0.02);
  --shadow-hero: 0 24px 60px -28px rgba(55,55,55,0.18);

  --radius-lg: 25px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --container: 1326px;
  --container-pad: clamp(20px, 4vw, 64px);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #19191B;
    --surface: #2F2F2F;
    --surface-2: #424242;
    --border: #4A4A4A;
    --text: #FFFFFF;
    --text-muted: #E8E8E8;
    --text-soft: #B0B0B0;
    --accent: #7ABA4A;
    --accent-strong: #8AC85A;
    --accent-ink: #0E0E0E;
    --footer-bg: #020202;
    --footer-text: #C8C8C8;
    --footer-heading: #FFFFFF;
    --btn-store-bg: transparent;
    --btn-store-fg: #7ABA4A;
    --btn-store-border: #7ABA4A;
    --icon-color: #7ABA4A;
    --shadow-card: 0 1px 0 rgba(0,0,0,0.4);
    --shadow-hero: 0 24px 60px -28px rgba(0,0,0,0.5);
  }
}

/* =========================================================
   Reset / base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { overflow-x: clip; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, picture { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; margin: 0; }
h1, h2, h3, h4, p { margin: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}
.container-wide {
  width: 100%;
  max-width: 1512px;
  margin-inline: auto;
  padding-inline: clamp(0px, 1vw, 16px);
}

/* =========================================================
   Nav
   ========================================================= */
.nav {
  padding: 24px 0 8px;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: 1500px;
  margin-inline: auto;
  padding-inline: clamp(16px, 2.8vw, 43px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}
.brand-logo {
  width: 62px;
  height: 62px;
  border-radius: 14px;
  display: block;
  flex: 0 0 auto;
}
.brand-name {
  font-size: 47px;
  line-height: 1;
  letter-spacing: 0;
  display: inline-flex;
}
.brand-re,
.brand-f {
  font-weight: 700;
  color: var(--accent);
}
.brand-f {
  letter-spacing: 2.37px;
}
.brand-lines {
  font-weight: 400;
  color: var(--text);
}
.nav-links {
  display: flex;
  gap: 36px;
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
}
.nav-links a { transition: color .15s ease; }
.nav-links a:hover { color: #446D26; font-weight: 600; }
@media (prefers-color-scheme: dark) {
  .nav-links a:hover { color: #7ABA4A; }
}

/* =========================================================
   Buttons — Mac App Store badge style
   ========================================================= */
.btn-store {
  display: inline-block;
  cursor: pointer;
  transition: transform .12s ease;
  text-decoration: none;
  line-height: 0;
}
.btn-store:hover { transform: translateY(-1px); }
.btn-store img,
.btn-store picture { display: block; height: 67px; width: auto; }
.btn-store .btn-store-hover { display: none; }
.btn-store:hover .btn-store-default { display: none; }
.btn-store:hover .btn-store-hover { display: block; }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  padding-top: 32px;
}
.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding-bottom: 40px;
}
.hero-title {
  font-size: 60px;
  line-height: 1.21;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}
.hero-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  width: 100%;
}
.lede {
  font-size: 30px;
  color: var(--text);
  line-height: 1.5;
  margin: 0;
  font-weight: 400;
  font-style: normal;
}
.lede strong { font-weight: 700; font-style: normal; }
.lede em { font-style: normal; font-weight: inherit; }
.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  flex: 0 0 auto;
}
.hero-cta .price-note {
  font-size: 20px;
  color: var(--text);
  opacity: 0.7;
  font-weight: 500;
  line-height: 1.2;
}
.hero-image-wrap {
  width: 100%;
  max-width: 1512px;
  margin-inline: auto;
  margin-top: 4px;
  margin-bottom: 96px;
  padding-inline: 0;
}
.hero-image {
  width: 100%;
  height: auto;
  display: block;
  background: transparent;
  border-radius: 10px;
  box-shadow: none;
}

/* =========================================================
   Section structure
   ========================================================= */
.section {
  padding: 56px 0;
}
.section-workspace { position: relative; overflow-x: clip; overflow-y: visible; padding-top: 140px; padding-bottom: 140px; }
.section-head {
  margin-bottom: 36px;
}
.section-head h2 {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.21;
  color: var(--text);
}
.section-head p {
  margin-top: 12px;
  color: var(--text);
  opacity: 0.8;
  font-size: 30px;
  letter-spacing: 0.02em;
  max-width: 760px;
  line-height: 1.33;
}
.section-head-center { text-align: center; }
.section-head-center h2 { text-align: center; }
.section-head-center p { margin-inline: auto; text-align: center; }

/* =========================================================
   Cards (generic)
   ========================================================= */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-card);
}
.card h3 {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.21;
  color: var(--text);
  margin: 0;
}
.card p {
  margin-top: 8px;
  color: var(--text);
  opacity: 0.8;
  font-size: 20px;
  line-height: 1.21;
  font-weight: 400;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}
.card-head h3 {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.21;
}
.feat-icon {
  display: inline-block;
  flex: 0 0 auto;
  color: var(--icon-color);
  width: var(--icon-w);
  height: var(--icon-h);
}
svg.feat-icon { width: auto; height: auto; }

/* =========================================================
   Speed section
   Row 1: Keybindings (332fr) + Command Line (921fr)
   Row 2: Action Bar  (921fr) + Filetypes  (332fr)
   ========================================================= */
.grid-speed {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.speed-row {
  display: grid;
  gap: 24px;
}
.speed-row-1 { grid-template-columns: 332fr 921fr; }
.speed-row-2 { grid-template-columns: 921fr 332fr; }

/* All speed cards share same height */
.speed-row .card { height: 320px; }

/* Narrow stacked cards (Keybindings + Filetypes) */
.card-stacked {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  padding: 32px;
  gap: 18px;
}
.card-stacked .card-body { width: 100%; }
.card-stacked .card-body h3 { text-align: left; }
.card-stacked .card-body p { text-align: left; margin-top: 8px; }
.card-stacked .card-media-square {
  width: 140px;
  height: 140px;
  border-radius: 20px;
  background: transparent;
  display: grid;
  place-items: center;
  overflow: hidden;
  align-self: center;
  margin-block: auto;
}
.card-stacked .card-media-square img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.card-keycap {
  width: 200px;
  max-width: 100%;
  align-self: center;
  margin-block: auto;
  display: block;
  position: relative;
  transform: translateY(-26px);
}
.card-keycap img {
  width: 100%;
  height: auto;
  display: block;
}
.keycap-glyph {
  position: absolute;
  top: 45%;
  left: 45%;
  transform: translate(-50%, -50%);
  font-size: 65px;
  font-weight: 500;
  line-height: 1;
  font-family: -apple-system, "SF Pro Display", "SF Pro", system-ui, sans-serif;
  color: var(--text);
  opacity: 0.3;
  pointer-events: none;
}
@media (prefers-color-scheme: dark) {
  .keycap-glyph { opacity: 0.5; }
  .lede { opacity: 0.9; }
  .nav-links { opacity: 0.9; }
}

/* Wide cards (Command Line + Action Bar) */
.card-wide {
  display: grid;
  gap: 32px;
  align-items: start;
  padding: 32px;
  overflow: hidden;
}
.card-wide .card-body { padding: 0; align-self: start; }
.card-wide .card-media-wide {
  background: transparent;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 0;
  padding-bottom: 0;
  min-width: 0;
  overflow: hidden;
  height: 256px;
}
.card-wide .card-media-wide picture {
  display: block;
  width: 100%;
  height: 100%;
}
.card-wide .card-media-wide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.card-command {
  grid-template-columns: 270fr 660fr;
  overflow: visible;
  position: relative;
  z-index: 1;
}
.card-command .card-media-wide {
  overflow: visible;
  position: relative;
}
.card-command .card-media-wide picture {
  display: block;
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 560px;
  height: 297px;
}
.card-command .card-media-wide img { object-position: 75% center; }
.card-actionbar { grid-template-columns: 380fr 545fr; padding-bottom: 0; }
.card-actionbar .card-media-wide { align-self: end; align-items: flex-end; height: 288px; }
.card-actionbar .card-media-wide img { object-position: center bottom; transform: translateY(8px); }

/* =========================================================
   Design section
   Row 1: 3-col (Views, Formulas, Cell Types)
   Row 2: screenshot left + Minimal Mode/Themes right
   ========================================================= */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}
.card-feature .card-head h3 { margin: 0; }

.design-row {
  display: grid;
  grid-template-columns: 1fr calc((100% - 48px) / 3);
  gap: 24px;
  align-items: start;
}
.design-screenshot {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: transparent;
  display: grid;
  place-items: center;
  width: calc(100% + 104px);
  margin-left: -80px;
}
.design-screenshot img {
  width: 100%;
  height: auto;
  display: block;
}
.design-side {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.card-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.card-row .card-body { width: 100%; }
.toggle {
  flex: 0 0 auto;
  width: 56px;
  height: 32px;
  background: var(--accent);
  border-radius: 999px;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}
.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.swatches {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}
.swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--border);
  opacity: 0.7;
}
.swatch-active {
  opacity: 1;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =========================================================
   Workspace section
   ========================================================= */
.workspace-row {
  position: relative;
}
.workspace-row .grid-2x2 {
  width: 870px;
  max-width: 100%;
}
.workspace-row .grid-2x2 .card-feature {
  min-height: 196px;
}
.grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-content: start;
}
.workspace-screenshot {
  position: absolute;
  top: -378px;
  right: calc(((var(--container) - 100vw) / 2) - var(--container-pad));
  left: auto;
  width: 485px;
  background: transparent;
  z-index: 1;
  pointer-events: none;
}
.workspace-screenshot img {
  width: 100%;
  height: auto;
  display: block;
  max-width: none;
}

/* =========================================================
   Pricing
   ========================================================= */
.pricing-row {
  display: grid;
  grid-template-columns: 824fr 540fr;
  gap: 24px;
  align-items: stretch;
}
.card-pricing {
  padding: 48px;
  display: flex;
  flex-direction: column;
  min-height: 397px;
  position: relative;
}
.card-pricing h3 {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.21;
}
.card-trial {
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
  gap: 28px;
}
.trial-copy {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.trial-copy > p {
  margin-top: 14px;
  max-width: 410px;
  color: color-mix(in srgb, var(--text) 80%, transparent);
  font-size: 30px;
  line-height: 1.33;
  letter-spacing: 0.02em;
  font-weight: 400;
}
.trial-copy > p a {
  color: var(--btn-store-fg);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.pricing-middle {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.trial-app-icon {
  width: 223px;
  height: 223px;
  border-radius: 48px;
  overflow: hidden;
}
.trial-app-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.btn-store-sm img,
.btn-store-sm picture { height: 48px; }

.card-price-accent {
  text-align: center;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.card-price-accent > p {
  color: var(--text);
  font-size: 20px;
  text-align: center;
  width: max-content;
  max-width: none;
  line-height: 1.21;
  font-weight: 400;
}
.card-price-accent .price {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.price-amount {
  font-size: 80px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.21;
  color: var(--text);
  display: block;
}
.price-note {
  font-size: 30px;
  margin-top: 0;
  color: var(--text);
  font-weight: 500;
  line-height: 1.21;
  display: block;
}

/* =========================================================
   Footer
   ========================================================= */
.footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 56px 0 40px;
  margin-top: 56px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 60px;
  align-items: start;
}
.footer h4 {
  font-size: 30px;
  letter-spacing: -0.005em;
  color: var(--footer-heading);
  font-weight: 600;
  margin-bottom: 16px;
}
.footer ul li {
  margin-bottom: 10px;
  font-size: 24px;
  line-height: 1.21;
  font-weight: 500;
  opacity: 0.7;
}
.footer a { transition: color .15s ease; }
.footer a:hover { color: var(--footer-heading); opacity: 1; }
.footer-meta {
  font-size: 20px;
  font-weight: 500;
  opacity: 0.75;
  justify-self: end;
  align-self: end;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1100px) {
  .hero-bottom { flex-direction: column; align-items: flex-start; }
  .hero-cta { align-self: flex-start; align-items: flex-start; }
  .speed-row-1, .speed-row-2 { grid-template-columns: 1fr; }
  .card-wide { grid-template-columns: 1fr; }
  .design-row { grid-template-columns: 1fr; }
  .workspace-row { grid-template-columns: 1fr; }
  .workspace-screenshot {
    margin-right: 0;
    border-radius: var(--radius-lg);
    aspect-ratio: 16 / 10;
    min-height: 0;
  }
  .workspace-screenshot img { position: static; width: 100%; height: 100%; }
  .pricing-row { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1100px) {
  .hero-title { font-size: 48px; }
  .lede { font-size: 22px; }
  .brand-name { font-size: 36px; }
  .nav-links { font-size: 16px; gap: 24px; }
  .btn-store img, .btn-store picture { height: 55px; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .nav { padding-top: 16px; }
  .nav-links { gap: 14px; font-size: 13px; }
  .brand-logo { width: 44px; height: 44px; }
  .brand-name { font-size: 28px; }
  .hero { padding-top: 16px; }
  .hero-title { font-size: 36px; }
  .lede { font-size: 18px; line-height: 1.45; }
  .hero-title br, .lede br { display: none; }
  .btn-store img, .btn-store picture { height: 45px; }
  .hero-cta .price-note { font-size: 14px; }
  .section { padding: 36px 0; }
  .section-head h2 { font-size: 28px; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2x2 { grid-template-columns: 1fr; }
  .card { padding: 22px; }
  .card-pricing { padding: 24px; min-height: 0; }
  .card-trial { flex-direction: column; gap: 20px; }
  .trial-right, .trial-app-icon { width: 140px; height: 140px; border-radius: 32px; }
  .price-amount { font-size: 56px; }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  .footer-meta {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 16px;
  }
}
