/* ---- Inter (cross-browser SF Pro substitute; Apple devices use real SF via the stack below) ---- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/inter-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/inter-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/inter-700.woff2") format("woff2");
}

:root {
  /* Palette mirrors the app (greys + soft-blue accent), with an Apple-native action blue. */
  --bg: #f9f9fa;
  --surface: #ffffff;
  --subtle: #eef0f2;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --hairline: rgba(0, 0, 0, 0.08);
  --accent: #0071e3;            /* Apple-style action blue, matches the app's native buttons */
  --accent-press: #0063c7;
  --accent-tint: rgba(0, 113, 227, 0.1);

  /* Layered "shadow as border" for surfaces (per the make-interfaces principles). */
  --shadow-card:
    0 0 0 1px rgba(0, 0, 0, 0.04),
    0 1px 2px -1px rgba(0, 0, 0, 0.06),
    0 8px 24px -10px rgba(0, 0, 0, 0.10);
  --shadow-card-hover:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 2px 6px -2px rgba(0, 0, 0, 0.08),
    0 16px 32px -12px rgba(0, 0, 0, 0.14);

  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  font-feature-settings: "cv11", "ss01";
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 80px 24px 24px;
}

/* ---- Hero ---- */
.hero { text-align: center; }

.app-icon {
  /* No border or extra rounding: the PNG is already a transparent squircle. */
}

/* Hover "slice": duplicate icon cards fan out from behind the main icon. */
.icon-stack {
  position: relative;
  display: inline-block;
  line-height: 0;
}
.icon-stack .app-icon {
  position: relative;
  z-index: 3;
  display: block;
  transition: transform 350ms cubic-bezier(0.2, 0, 0, 1);
}
.icon-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 120px;
  height: 120px;
  opacity: 0;
  z-index: 1;
  transform: translateX(0) rotate(0deg) scale(0.96);
  transition: transform 380ms cubic-bezier(0.2, 0, 0, 1), opacity 320ms ease-out;
  pointer-events: none;
  will-change: transform, opacity;
}
.icon-card--l1, .icon-card--r1 { z-index: 2; }

/* Fan out on hover */
.icon-stack:hover .app-icon { transform: scale(1.03); }
.icon-stack:hover .icon-card--l1 { transform: translateX(-34px) rotate(-7deg) scale(0.97); opacity: 0.72; }
.icon-stack:hover .icon-card--l2 { transform: translateX(-64px) rotate(-13deg) scale(0.93); opacity: 0.42; transition-delay: 45ms; }
.icon-stack:hover .icon-card--r1 { transform: translateX(34px) rotate(7deg) scale(0.97); opacity: 0.72; }
.icon-stack:hover .icon-card--r2 { transform: translateX(64px) rotate(13deg) scale(0.93); opacity: 0.42; transition-delay: 45ms; }

@media (prefers-reduced-motion: reduce) {
  .icon-stack .app-icon, .icon-card { transition: none; }
}

h1 {
  font-size: 46px;
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.05;
  margin: 22px 0 6px;
  text-wrap: balance;
}

.tagline {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0 0 18px;
}

.lede {
  font-size: 17px;
  max-width: 520px;
  margin: 0 auto 30px;
  text-wrap: pretty;
}

.cta {
  display: flex;
  gap: 18px;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: wrap;
}
.download-group {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Apple-native primary action button (mirrors the app's .borderedProminent). */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 26px;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: 12px;
  transition: background 150ms ease-out, transform 150ms ease-out, box-shadow 150ms ease-out;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.button:hover { background: #0a78e6; box-shadow: 0 4px 14px -4px rgba(0, 113, 227, 0.5); }
.button:active { background: var(--accent-press); transform: scale(0.96); }
.button:focus-visible { outline: 3px solid var(--accent-tint); outline-offset: 2px; }

.ghost-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  line-height: 44px; /* vertically center with the 44px button */
  transition: opacity 150ms ease-out;
}
.ghost-link:hover { opacity: 0.7; }

.requires {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 12px;
  text-align: center;
}

.fineprint {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 460px;
  margin: 18px auto 0;
  text-wrap: pretty;
}

/* ---- Lightweight callout (near the features) ---- */
.lightweight {
  margin-top: 80px;
  text-align: center;
}
.lightweight-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--accent-tint);
  margin-bottom: 14px;
}
.lightweight-icon svg {
  width: 26px; height: 26px;
  fill: none; stroke: var(--accent); stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.lightweight-stat {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.lightweight-sub {
  margin: 6px auto 0;
  max-width: 380px;
  font-size: 15px;
  color: var(--text-secondary);
  text-wrap: pretty;
}

/* ---- Showcase: interactive demo + mobile static fallback ---- */
.showcase {
  margin-top: 80px;
  text-align: center;
}

/* The dummy app window (mirrors Mandoline's actual layout). */
.demo {
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg);
  border-radius: 14px;
  overflow: hidden;
  text-align: left;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  filter:
    drop-shadow(0 24px 48px rgba(0, 0, 0, 0.22))
    drop-shadow(0 6px 14px rgba(0, 0, 0, 0.12));
}
.demo:focus-visible { box-shadow: 0 0 0 3px var(--accent-tint); }

.demo-titlebar {
  position: relative;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.traffic { position: absolute; left: 14px; display: flex; gap: 8px; }
.traffic i { width: 12px; height: 12px; border-radius: 50%; }
.traffic i:nth-child(1) { background: #ff5f57; }
.traffic i:nth-child(2) { background: #febc2e; }
.traffic i:nth-child(3) { background: #28c840; }
.demo-path { font-size: 13px; font-weight: 500; color: var(--text-secondary); }

.demo-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 16px 12px;
}
.demo-name { font-size: 13px; font-weight: 600; color: var(--text); }
.demo-name span { font-variant-numeric: tabular-nums; }
.demo-size { font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.demo-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.demo-iconbtn {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--subtle); color: var(--text-secondary);
}
.demo-iconbtn svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}

.demo-stage {
  position: relative;
  height: 300px;
  margin: 0 16px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
#demo-media { max-width: 100%; max-height: 100%; object-fit: contain; }
.demo-flash {
  position: absolute; inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease-out;
}
.demo-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--bg);
}
.demo-empty[hidden] { display: none; }
.demo-empty-title { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.demo-reset {
  appearance: none; border: 0; cursor: pointer;
  background: var(--accent); color: #fff;
  font-family: var(--font-ui); font-size: 14px; font-weight: 600;
  padding: 9px 18px; border-radius: 10px;
  transition: background 150ms ease-out, transform 150ms ease-out;
}
.demo-reset:hover { background: #0a78e6; }
.demo-reset:active { transform: scale(0.96); }

.demo-carousel {
  display: flex;
  gap: 8px;
  padding: 14px 16px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.demo-carousel::-webkit-scrollbar { display: none; }
.demo-thumb {
  flex: 0 0 auto;
  width: 72px; height: 52px;
  padding: 0; border: 0; cursor: pointer;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  transition: box-shadow 150ms ease-out, transform 150ms ease-out;
}
.demo-thumb:hover { transform: translateY(-1px); }
.demo-thumb.is-active { box-shadow: inset 0 0 0 2px #88b0cc; } /* app selection accent */

.demo-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 18px auto 0;
  text-wrap: pretty;
}
.demo-hint kbd { margin: 0 1px; }

/* Static screenshot used on touch / small screens (no keyboard). */
.shot {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  filter:
    drop-shadow(0 24px 48px rgba(0, 0, 0, 0.22))
    drop-shadow(0 6px 14px rgba(0, 0, 0, 0.12));
}
.demo-static { display: none; }

@media (max-width: 700px), (hover: none) and (pointer: coarse) {
  .demo, .demo-hint { display: none; }
  .demo-static { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .demo-flash { transition: none; }
  .demo-thumb, .demo-reset { transition: none; }
}

/* ---- Features ---- */
.features-section { margin-top: 80px; }
.section-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-align: center;
  text-wrap: balance;
  margin: 0 0 24px;
}
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  background: var(--surface);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 200ms ease-out, transform 200ms ease-out;
}
.card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.card h3 { margin: 14px 0 6px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.card p { margin: 0; font-size: 14px; color: var(--text-secondary); text-wrap: pretty; }

/* Tinted rounded icon chip (inner radius ≈ outer 18 − 24 padding → its own surface, 12). */
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-tint);
}
.feature-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Shortcuts ---- */
.shortcuts { margin-top: 80px; }
.shortcuts h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 22px;
  text-align: center;
  text-wrap: balance;
}

.shortcut-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 360px;
  display: grid;
  gap: 8px;
}
.shortcut-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
}
.keys { display: inline-flex; gap: 4px; min-width: 64px; }
.desc { font-size: 14px; color: var(--text-secondary); }

kbd {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: linear-gradient(180deg, #ffffff, #f1f2f4);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 7px;
  min-width: 24px;
  padding: 3px 7px;
  text-align: center;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

/* ---- Download email modal ---- */
.modal {
  border: none;
  padding: 16px;
  overflow: visible;
  background: transparent;
  max-width: 100%;
  max-height: 100%;
  color: var(--text);
}
.modal::backdrop {
  background: rgba(20, 20, 22, 0.32);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.modal-card {
  position: relative;
  width: min(92vw, 400px);
  background: var(--surface);
  border-radius: 20px;
  padding: 24px 26px;
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.05),
    0 30px 60px -24px rgba(0, 0, 0, 0.35),
    0 12px 24px -16px rgba(0, 0, 0, 0.2);
}
.modal[open] .modal-card { animation: modal-in 0.32s cubic-bezier(0.2, 0, 0, 1); }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.modal-close {
  position: absolute;
  top: -12px; right: -12px;
  z-index: 2;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; cursor: pointer;
  border-radius: 50%;
  background: #fff;
  color: var(--text-secondary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  transition: color 150ms ease-out, transform 150ms ease-out;
}
.modal-close:hover { color: var(--text); transform: scale(1.06); }
.modal-close:active { transform: scale(0.94); }
.modal-close svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.modal-input {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--text);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
}
.modal-input::placeholder { color: #a0a0a6; }
.modal-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
.modal-error {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: #c4352f;
  text-align: left;
}
.modal-field {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.modal-field .modal-input { flex: 1 1 auto; width: auto; }
.modal-go {
  flex: 0 0 auto;
  width: 50px;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease-out, transform 150ms ease-out;
}
.modal-go:hover { background: #0a78e6; }
.modal-go:active { transform: scale(0.94); }
.modal-go:focus-visible { outline: 3px solid var(--accent-tint); outline-offset: 2px; }
.modal-go:disabled { cursor: default; }
.go-arrow {
  width: 20px; height: 20px;
  fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 320ms cubic-bezier(0.2, 0, 0, 1), opacity 180ms ease-out;
}
.go-spinner {
  position: absolute;
  top: 50%; left: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  opacity: 0;
}
/* submitting: arrow fades, spinner spins */
.modal-go.is-loading .go-arrow { opacity: 0; }
.modal-go.is-loading .go-spinner { opacity: 1; animation: go-spin 0.7s linear infinite; }
/* success: the download icon drops down as the file starts downloading */
.modal-go.is-done .go-spinner { opacity: 0; }
.modal-go.is-done .go-arrow { opacity: 0; transform: translateY(20px); }
@keyframes go-spin { to { transform: rotate(360deg); } }
.modal-fineprint {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

@media (prefers-reduced-motion: reduce) {
  .modal[open] .modal-card { animation: none; }
  .go-arrow { transition: none; }
  .go-spinner { animation: none; }
}

/* ---- Footer ---- */
footer {
  text-align: center;
  padding: 44px 24px 52px;
  color: var(--text-secondary);
}
.credit { margin: 0 0 4px; font-size: 14px; }
.credit a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 150ms ease-out;
}
.credit a:hover { color: var(--text); }
.credit .arrow {
  display: inline-block;
  margin-left: 3px;
  transition: transform 200ms cubic-bezier(0.2, 0, 0, 1);
}
.credit a:hover .arrow { transform: translate(2px, -2px) scale(1.15); }
.licence {
  margin: 56px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}

/* ---- Staggered entrance (split + stagger, with blur/lift) ---- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  filter: blur(4px);
  animation: reveal-in 0.5s cubic-bezier(0.2, 0, 0, 1) forwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}
@keyframes reveal-in {
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; filter: none; }
  .button, .card, .credit .arrow { transition: none; }
}

/* ---- Responsive ---- */
@media (max-width: 720px) {
  .features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  main { padding-top: 56px; }
  h1 { font-size: 38px; }
  .features { grid-template-columns: 1fr; }
  .cta { flex-direction: column; align-items: center; }
}
