/* TapFrame — marketing site. Static, dependency-free, no build step.
   Paper-white e-ink look with the app icon's red, plus the panel's six inks. */

:root {
  --paper: #f6f4ee;
  --paper-deep: #ece8de;
  --card: #fffefa;
  --ink: #161514;
  --muted: #5f5b55;
  --line: rgb(22 21 20 / 12%);
  --red: #c8322b;
  --red-deep: #a8261f;
  --red-soft: #f05c48;

  /* Spectra 6 inks, matching PhotoProcessor.palette8 in the app. */
  --ink-black: #141414;
  --ink-white: #ebebe6;
  --ink-yellow: #f2cc1a;
  --ink-red: #b82924;
  --ink-blue: #244da6;
  --ink-green: #38784d;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Helvetica, Arial, sans-serif;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

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

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

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

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 0%, rgb(240 92 72 / 14%), transparent 28rem),
    var(--paper);
  font-family: var(--sans);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

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

:focus-visible {
  outline: 3px solid var(--ink-blue);
  outline-offset: 3px;
  border-radius: 6px;
}

.shell {
  width: min(1160px, calc(100% - 48px));
  margin-inline: auto;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  box-shadow: 0 4px 12px rgb(168 38 31 / 22%);
}

.site-header nav {
  display: flex;
  gap: clamp(16px, 3vw, 34px);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.site-header nav a:hover,
.site-header nav a[aria-current="page"],
.footer-links a:hover {
  color: var(--ink);
}

/* Type */
.eyebrow {
  margin-bottom: 16px;
  color: var(--red-deep);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

h1 {
  margin-bottom: 26px;
  font-size: clamp(3rem, 6.6vw, 5.9rem);
  line-height: 0.95;
}

h2 {
  margin-bottom: 20px;
  font-size: clamp(2.2rem, 4.4vw, 3.9rem);
  line-height: 1;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.lede {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(1.06rem, 1.5vw, 1.22rem);
  line-height: 1.65;
}

/* Buttons */
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

a.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: #fff;
  background: var(--ink);
  box-shadow: 0 9px 20px rgb(22 21 20 / 16%);
}

.button-secondary {
  background: transparent;
}

/* Pre-launch App Store badge: swap for a link once the app is live. */
.button-soon {
  color: var(--muted);
  border-style: dashed;
  border-color: rgb(22 21 20 / 35%);
  cursor: default;
}

.button svg {
  width: 18px;
  height: 18px;
  flex: none;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: center;
  gap: clamp(40px, 7vw, 96px);
  padding-block: clamp(64px, 9vw, 110px) clamp(80px, 10vw, 130px);
}

.note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.86rem;
}

/* Two e-ink displays, stacked like the app icon. */
.stage {
  position: relative;
  aspect-ratio: 1 / 1.02;
  width: min(100%, 520px);
  justify-self: center;
}

.stage::before {
  content: "";
  position: absolute;
  inset: 8% 4% 2% 10%;
  border-radius: 48px;
  background: linear-gradient(135deg, var(--red-soft), var(--red-deep));
  transform: rotate(-3deg);
}

.panel {
  position: absolute;
  padding: 3.4%;
  border-radius: 7% / 5.4%;
  background: #fcfcfa;
  box-shadow:
    0 30px 50px rgb(60 14 10 / 26%),
    0 2px 0 rgb(255 255 255 / 70%) inset;
}

.panel-screen {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 3.4% / 2.6%;
}

.panel-message {
  top: 4%;
  left: 2%;
  width: 46%;
  transform: rotate(-9deg);
}

.panel-photo {
  right: 2%;
  bottom: 0;
  width: 58%;
  transform: rotate(5deg);
}

.panel-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.message-card {
  height: 100%;
  display: grid;
  place-content: center;
  gap: 0.4em;
  padding: 10%;
  background: var(--ink-white);
  color: var(--ink-black);
  font-family: var(--rounded);
  font-size: clamp(1rem, 2.6vw, 1.6rem);
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
}

.message-card .big {
  font-size: 1.55em;
  letter-spacing: -0.02em;
}

.message-card .red {
  color: var(--ink-red);
}

.message-card .blue {
  color: var(--ink-blue);
}

.toast {
  position: absolute;
  left: 0;
  bottom: 9%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px 11px 12px;
  border-radius: 16px;
  background: rgb(255 254 250 / 94%);
  box-shadow: 0 14px 30px rgb(22 21 20 / 18%);
  font-size: 0.84rem;
  font-weight: 650;
  backdrop-filter: blur(10px);
}

.toast svg {
  width: 28px;
  height: 28px;
  padding: 5px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink-blue);
}

.toast small {
  display: block;
  color: var(--muted);
  font-weight: 500;
}

/* Sections */
.section {
  padding-block: clamp(84px, 12vw, 150px);
}

.section-heading {
  max-width: 780px;
  margin-bottom: 54px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  counter-reset: step;
}

.step {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgb(255 254 250 / 60%);
}

.step-number {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin-bottom: 44px;
  border-radius: 50%;
  color: #fff;
  background: var(--ink);
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
}

.step:nth-child(3) .step-number {
  background: var(--red);
}

.step p,
.feature p {
  color: var(--muted);
  line-height: 1.65;
}

/* Six inks band */
.inks {
  border-block: 1px solid var(--line);
  background: var(--card);
}

.inks-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(40px, 7vw, 90px);
}

.swatches {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: min(100%, 420px);
  justify-self: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.swatches li {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: flex-end;
  padding: 14px;
  border-radius: 20px;
  color: #fff;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.swatches .s-white {
  color: var(--ink);
  background: var(--ink-white);
  box-shadow: inset 0 0 0 1px var(--line);
}

.swatches .s-yellow {
  color: var(--ink);
  background: var(--ink-yellow);
}

.s-black { background: var(--ink-black); }
.s-red { background: var(--ink-red); }
.s-blue { background: var(--ink-blue); }
.s-green { background: var(--ink-green); }

/* Features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.feature {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 20px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgb(255 254 250 / 60%);
}

.feature-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
}

.feature-icon svg {
  width: 26px;
  height: 26px;
}

.fi-blue { background: var(--ink-blue); }
.fi-yellow { background: var(--ink-yellow); color: var(--ink); }
.fi-green { background: var(--ink-green); }
.fi-red { background: var(--ink-red); }

/* Compatibility */
.compat {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 7vw, 90px);
}

.spec-list {
  margin: 0;
  border-top: 1px solid var(--ink);
}

.spec-list > div {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.spec-list dt {
  font-weight: 700;
}

.spec-list dd {
  margin: 0;
  color: var(--muted);
}

.fineprint {
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

/* Closing */
.closing {
  padding-block: 64px;
  color: #fff;
  background: linear-gradient(120deg, var(--red-soft), var(--red-deep));
}

.closing-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
}

.closing img {
  width: 104px;
  height: 104px;
  border-radius: 23px;
  box-shadow: 0 18px 34px rgb(60 10 8 / 30%);
}

.closing h2 {
  margin: 0;
  font-size: clamp(1.9rem, 3.8vw, 3.3rem);
}

.closing .eyebrow {
  color: rgb(255 255 255 / 78%);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* Footer */
.site-footer {
  padding-block: 54px;
  color: #cfcac2;
  background: #141312;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px 60px;
  align-items: start;
}

.footer-inner strong {
  color: #fff;
  font-family: var(--display);
  font-size: 1.25rem;
}

.footer-inner p {
  margin-top: 6px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  font-size: 0.9rem;
  font-weight: 600;
}

.copyright {
  grid-column: 1 / -1;
  padding-top: 28px;
  border-top: 1px solid rgb(255 255 255 / 10%);
  font-size: 0.8rem;
}

/* Subpages */
.subpage-hero {
  padding-block: clamp(80px, 11vw, 120px) clamp(70px, 10vw, 110px);
  border-bottom: 1px solid var(--line);
}

.subpage-hero h1 {
  max-width: 900px;
}

.updated {
  display: inline-block;
  margin-top: 30px;
  padding-top: 12px;
  border-top: 2px solid var(--red);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.76rem;
}

.support-layout {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 70px;
  padding-block: 100px 120px;
}

.support-intro {
  position: sticky;
  top: 40px;
  align-self: start;
}

.support-intro h2 {
  font-size: clamp(2.1rem, 3.6vw, 3.2rem);
}

.support-intro p {
  color: var(--muted);
  line-height: 1.65;
}

.support-topic {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 18px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.support-topic:first-child {
  padding-top: 0;
}

.support-topic > span {
  padding-top: 5px;
  color: var(--red-deep);
  font-family: var(--mono);
  font-size: 0.74rem;
}

.support-topic h3 {
  font-size: 1.32rem;
}

.support-topic p,
.support-topic li,
.policy p,
.policy li {
  color: var(--muted);
  line-height: 1.75;
}

.support-topic p + p,
.support-topic p + ul,
.policy p + p,
.policy p + ul,
.policy ul + p {
  margin-top: 14px;
}

.support-topic ul,
.policy ul {
  margin: 0;
  padding-left: 1.2em;
}

.support-topic a,
.policy a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.support-contact {
  padding-block: 90px;
  color: #fff;
  background: var(--ink);
}

.support-contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
}

.support-contact p {
  color: #cfcac2;
  font-size: 1.08rem;
  line-height: 1.7;
}

.support-contact .text-link {
  margin-top: 18px;
  color: var(--ink-yellow);
  font-size: 1.1rem;
}

.support-contact .eyebrow {
  color: var(--ink-yellow);
}

/* Privacy policy */
.policy {
  width: min(860px, calc(100% - 48px));
  padding-block: 80px 130px;
}

.policy section {
  padding-block: 40px;
  border-bottom: 1px solid var(--line);
}

.policy section:last-child {
  border-bottom: 0;
}

.policy h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
}

.policy h3 {
  margin: 28px 0 8px;
  font-size: 1.2rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 26px;
}

.summary-grid div {
  padding: 20px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
}

.summary-grid strong {
  display: block;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.summary-grid span {
  color: var(--muted);
  font-size: 0.9rem;
}

.policy-table {
  border-top: 1px solid var(--ink);
}

.policy-table > div {
  display: grid;
  grid-template-columns: 0.6fr 1.4fr;
  gap: 26px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.policy-table span {
  color: var(--muted);
  line-height: 1.6;
}

/* 404 */
.not-found {
  min-height: 60vh;
  display: grid;
  align-content: center;
  padding-block: 100px;
}

/* Responsive */
@media (max-width: 900px) {
  .hero,
  .inks-inner,
  .compat,
  .support-layout,
  .support-contact-inner {
    grid-template-columns: 1fr;
  }

  .stage {
    width: min(100%, 460px);
  }

  .steps,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .step-number {
    margin-bottom: 26px;
  }

  .support-intro {
    position: static;
  }

  .closing-inner {
    grid-template-columns: auto 1fr;
  }

  .closing .text-link {
    grid-column: 2;
  }
}

@media (max-width: 620px) {
  .shell,
  .policy {
    width: calc(100% - 32px);
  }

  .header-inner {
    min-height: 66px;
    gap: 12px;
  }

  .brand img {
    width: 34px;
    height: 34px;
  }

  .site-header nav {
    gap: 14px;
    font-size: 0.86rem;
  }

  .site-header nav .nav-optional {
    display: none;
  }

  .button {
    width: 100%;
  }

  .toast {
    font-size: 0.76rem;
  }

  .feature {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .spec-list > div,
  .policy-table > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .closing-inner {
    grid-template-columns: 64px 1fr;
    gap: 18px;
  }

  .closing img {
    width: 64px;
    height: 64px;
    border-radius: 15px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .copyright {
    grid-column: auto;
  }

  .support-layout {
    padding-block: 70px 90px;
  }
}

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

  .button {
    transition: none;
  }
}
