/* PikPDF home page. The legal pages keep site.css. */

:root {
  --ink: #0A1A3A;        /* navy text and the privacy band */
  --blue: #075BF5;       /* the app's scanner blue */
  --marker: #FFD640;     /* highlighter on the answer */
  --paper: #FFFFFF;
  --desk: #E8EDF4;       /* cool grey-blue page ground */
  --graphite: #475268;   /* body text */
  --rule: #CBD4E1;

  --font: "Schibsted Grotesk", system-ui, -apple-system, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: clamp(1.9rem, 1.2rem + 2.6vw, 3rem);
  --step-4: clamp(2.6rem, 1.4rem + 5vw, 5.4rem);

  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--desk);
  color: var(--graphite);
  font: 400 var(--step-0)/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { color: var(--ink); margin: 0; }
p { margin: 0; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }

.skip {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 6px; z-index: 10;
}
.skip:focus { top: 1rem; }

.badge { display: inline-block; line-height: 0; border-radius: 10px; }
.badge img { width: auto; height: 56px; }
.badge-small img { height: 40px; }

.section-title {
  font-size: var(--step-3);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 22ch;
}

.fine { font-size: var(--step--1); color: var(--graphite); opacity: .85; }

/* Header */

.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--desk) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 60%, transparent);
}
.top-inner { display: flex; align-items: center; gap: 2rem; height: 68px; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; }
.brand img { border-radius: 9px; }
.top-nav { display: flex; gap: 1.6rem; margin-left: auto; }
.top-nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.top-nav a:hover { color: var(--blue); }

/* Hero */

.hero { padding: clamp(3rem, 7vw, 6.5rem) 0 clamp(4rem, 8vw, 7rem); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }

.hero h1 {
  font-size: var(--step-4);
  font-weight: 900;
  line-height: .98;
  letter-spacing: -0.035em;
  max-width: 11ch;
}
.lede { margin-top: 1.6rem; font-size: var(--step-1); line-height: 1.45; max-width: 34ch; color: var(--ink); }
.hero-cta { display: flex; align-items: center; gap: 1.25rem; margin-top: 2.2rem; flex-wrap: wrap; }
.cta-note { font-size: var(--step--1); line-height: 1.45; max-width: 30ch; }

/* The desk: an invoice with the question and answer laid over it. */

.desk { position: relative; padding: 2.5rem 0 4.5rem; }

.sheet {
  position: relative;
  background: var(--paper);
  padding: 2.2rem 2.2rem 1.6rem;
  border-radius: 3px;
  transform: rotate(-2.2deg);
  box-shadow:
    0 1px 1px rgba(10, 26, 58, .08),
    0 12px 24px -8px rgba(10, 26, 58, .18),
    0 40px 60px -30px rgba(10, 26, 58, .35);
  color: #2B3446;
  font-size: .82rem;
  max-width: 470px;
  margin-left: auto;
}
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.sheet-from { font-weight: 800; color: var(--ink); font-size: 1rem; }
.sheet-addr { color: #6B7588; }
.sheet-title { text-align: right; font-weight: 800; color: var(--blue); font-size: 1.35rem; line-height: 1.05; }
.sheet-title span { font-weight: 500; font-size: .85rem; color: #6B7588; }
.sheet-meta { margin: 1.5rem 0 1.2rem; display: grid; gap: .25rem; }
.sheet-meta div { display: flex; justify-content: space-between; border-bottom: 1px dashed #DCE2EB; padding-bottom: .25rem; }
.sheet-meta dt { color: #6B7588; }
.sheet-meta dd { margin: 0; }
.sheet-table { width: 100%; border-collapse: collapse; }
.sheet-table th { text-align: left; font-weight: 700; color: #fff; background: var(--blue); padding: .4rem .6rem; font-size: .74rem; }
.sheet-table td { padding: .45rem .6rem; border-bottom: 1px solid #EEF1F6; }
.sheet-table th:nth-child(n+2), .sheet-table td:nth-child(n+2) { text-align: right; }
.sheet-table .sub td { color: #6B7588; }
.sheet-total { display: flex; justify-content: flex-end; align-items: baseline; gap: 1rem; margin-top: 1rem; font-weight: 800; color: var(--ink); }
.sheet-total span { font-size: .78rem; color: #6B7588; font-weight: 600; }
.sheet-foot { margin-top: 1.6rem; color: #8A93A5; font-size: .72rem; }

.marker {
  font-size: 1.35rem;
  color: var(--ink);
  padding: 0 .25rem;
  background: linear-gradient(transparent 12%, var(--marker) 12%, var(--marker) 88%, transparent 88%) no-repeat left / 100% 100%;
  border-radius: 2px;
}

.bubble {
  position: absolute; top: 0; right: 4%;
  background: var(--blue); color: #fff;
  padding: .75rem 1.15rem;
  border-radius: 22px 22px 6px 22px;
  font-weight: 600;
  box-shadow: 0 10px 24px -10px rgba(7, 91, 245, .6);
}
.typed { display: inline-block; white-space: nowrap; vertical-align: bottom; }

.answer {
  position: absolute; left: -2%; bottom: 0;
  width: min(360px, 82%);
  background: var(--paper);
  border: 2px solid var(--marker);
  border-radius: 18px;
  padding: 1rem 1.15rem 1.05rem;
  color: var(--ink);
  font-size: .98rem;
  line-height: 1.45;
  box-shadow: 0 24px 40px -18px rgba(10, 26, 58, .45);
}
.answer-label { display: flex; align-items: center; gap: .35rem; color: var(--blue); font-weight: 700; font-size: .82rem; margin-bottom: .3rem; }
.answer-source { margin-top: .5rem; font-size: .78rem; color: var(--graphite); }

/* The one orchestrated moment: question types, total gets marked, answer lands. */
@media (prefers-reduced-motion: no-preference) {
  .bubble { animation: pop .35s ease-out .2s both; }
  .typed { animation: type 1s steps(20, end) .45s both; }
  .marker { animation: mark .55s cubic-bezier(.6, 0, .3, 1) 1.65s both; }
  .answer { animation: land .5s cubic-bezier(.2, .8, .2, 1) 2.25s both; }
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.96); } }
@keyframes type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes mark { from { background-size: 0% 100%; } }
@keyframes land { from { opacity: 0; transform: translateY(16px); } }

/* Features */

.features { background: var(--paper); padding: clamp(4rem, 8vw, 7rem) 0; }
.feature {
  display: grid;
  grid-template-columns: minmax(200px, 270px) 1fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  max-width: 980px;
}
.feature-flip { grid-template-columns: 1fr minmax(200px, 270px); }
.feature-flip .phone { order: 2; }
.feature-flip { margin-left: auto; }
.feature-copy { max-width: 36rem; }
.feature h3 { font-size: var(--step-2); font-weight: 800; line-height: 1.12; letter-spacing: -0.015em; max-width: 20ch; }
.feature-copy p { margin-top: 1rem; max-width: 60ch; }
.feature-copy .fine { margin-top: .9rem; }

.phone {
  margin: 0;
  padding: 9px;
  background: var(--ink);
  border-radius: 40px;
  box-shadow: 0 30px 60px -30px rgba(10, 26, 58, .55);
}
.phone img { border-radius: 32px; width: 100%; }

/* Piles */

.piles { padding: clamp(4rem, 8vw, 7rem) 0; }
.pile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.25rem, 3vw, 2.5rem); margin-top: 2.5rem; }
.pile-grid figure { margin: 0; }
.pile-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: var(--rule); }
.pile-grid figcaption { margin-top: 1rem; max-width: 40ch; }
.pile-grid strong { color: var(--ink); }

/* Toolbox: tabs over one large panel */

.toolbox { background: var(--paper); padding: clamp(4rem, 8vw, 7rem) 0; }
.toolbox-head { text-align: center; }
.toolbox-head .section-title { margin-inline: auto; max-width: none; }
.toolbox-head p { margin-top: .8rem; font-size: var(--step-1); }

.tabs {
  display: flex; gap: .25rem; width: fit-content; max-width: 100%;
  margin: 2.2rem auto 2.5rem; padding: .3rem;
  background: var(--desk); border-radius: 14px; overflow-x: auto;
}
.tabs button {
  font: 600 var(--step-0)/1 var(--font); color: var(--ink);
  background: none; border: 0; border-radius: 10px;
  padding: .8rem 1.3rem; cursor: pointer; white-space: nowrap;
}
.tabs button:hover { background: color-mix(in srgb, var(--paper) 60%, transparent); }
.tabs button[aria-selected="true"] { background: var(--ink); color: #fff; }

.panel {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center;
  padding: clamp(2rem, 5vw, 4.5rem);
  border-radius: 28px;
  background: linear-gradient(135deg, #F1F5FB 0%, #E3ECFB 100%);
  min-height: 560px;
}
.panel[hidden] { display: none; }
.panel-copy h3 { font-size: var(--step-2); font-weight: 800; line-height: 1.12; letter-spacing: -0.015em; max-width: 18ch; }
.panel-copy p { margin-top: 1rem; max-width: 46ch; }
.panel-copy ul { list-style: none; margin: 1.5rem 0 0; padding: 0; max-width: 34rem; }
.panel-copy li { padding: .55rem 0 .55rem 1.8rem; border-top: 1px solid var(--rule); position: relative; color: var(--ink); }
.panel-copy li::before {
  content: ""; position: absolute; left: .2rem; top: 1rem; width: .75rem; height: .4rem;
  border-left: 2px solid var(--blue); border-bottom: 2px solid var(--blue); transform: rotate(-45deg);
}
.panel-shot { margin: 0; display: flex; justify-content: center; }
.panel-shot .phone { width: min(270px, 70%); }

/* Photo vs scan: the scan sits underneath, the photo is clipped from the right. */
.compare {
  position: relative; margin: 0; justify-self: center;
  width: min(440px, 100%); aspect-ratio: 4 / 5;
  border-radius: 22px; overflow: hidden;
  border: 8px solid var(--paper);
  box-shadow: 0 30px 60px -30px rgba(10, 26, 58, .5);
  background: var(--rule);
  touch-action: pan-y;
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare-before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare-line {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px;
  background: var(--paper); pointer-events: none;
}
.compare-knob {
  position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border-radius: 50%; background: var(--paper); box-shadow: 0 4px 14px rgba(10, 26, 58, .3);
}
.compare-knob::before, .compare-knob::after {
  content: ""; position: absolute; top: 50%; width: 8px; height: 8px; margin-top: -4px;
  border-top: 2px solid var(--ink); border-left: 2px solid var(--ink);
}
.compare-knob::before { left: 11px; transform: rotate(-45deg); }
.compare-knob::after { right: 11px; transform: rotate(135deg); }
.compare-tag {
  position: absolute; bottom: 14px; padding: .3rem .65rem; border-radius: 8px;
  font-size: .8rem; font-weight: 700; pointer-events: none;
}
.compare-tag-before { left: 14px; background: rgba(10, 26, 58, .75); color: #fff; }
.compare-tag-after { right: 14px; background: var(--marker); color: var(--ink); }
.compare-range {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: ew-resize;
}
.compare:has(.compare-range:focus-visible) { outline: 3px solid var(--blue); outline-offset: 3px; }

/* Privacy */

.privacy { background: var(--ink); color: #C9D3E6; padding: clamp(4.5rem, 9vw, 7.5rem) 0; }
.privacy h2 { color: #fff; font-size: var(--step-3); font-weight: 800; line-height: 1.06; letter-spacing: -0.02em; max-width: 14ch; }
.privacy-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.privacy-lede { margin: 1.4rem 0 1.6rem; font-size: var(--step-1); line-height: 1.45; max-width: 38ch; color: #DCE4F3; }
.text-link { color: var(--marker); font-weight: 600; text-underline-offset: 4px; }
.privacy-facts { list-style: none; margin: 0; padding: 0; }
.privacy-facts li { padding: 1.1rem 0; border-top: 1px solid rgba(255, 255, 255, .14); }
.privacy-facts li:last-child { border-bottom: 1px solid rgba(255, 255, 255, .14); }
.privacy-facts strong { color: #fff; display: block; }

/* Pricing */

.pricing { padding: clamp(4rem, 8vw, 7rem) 0; }
.plans { display: grid; grid-template-columns: 1fr 1.25fr; gap: 1.5rem; margin-top: 2.5rem; max-width: 980px; }
.plan { background: var(--paper); border-radius: 20px; padding: 2rem; }
.plan-premium { border: 2px solid var(--blue); }
.plan h3 { font-size: var(--step-1); font-weight: 800; }
.price { margin-top: .6rem; font-size: var(--step-3); font-weight: 900; color: var(--ink); letter-spacing: -0.02em; line-height: 1.1; }
.price span { font-size: var(--step--1); font-weight: 500; color: var(--graphite); letter-spacing: 0; }
.price-alt { font-size: var(--step--1); margin-top: .2rem; }
.plan ul { margin: 1.4rem 0 0; padding-left: 1.1rem; }
.plan li { padding: .3rem 0; }
.plan li::marker { color: var(--blue); }
.plans-note { margin-top: 1.4rem; max-width: 70ch; }

/* FAQ */

.faq { background: var(--paper); padding: clamp(4rem, 8vw, 6.5rem) 0; }
.faq-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 3rem; }
.faq-list details { border-bottom: 1px solid var(--rule); }
.faq-list details:first-child { border-top: 1px solid var(--rule); }
.faq-list summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 1.15rem 0; font-weight: 700; color: var(--ink); font-size: var(--step-0);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; font-weight: 400; font-size: 1.5rem; line-height: 1; color: var(--blue); transition: transform .2s ease; }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details p { padding: 0 0 1.25rem; max-width: 62ch; }

/* Closer and footer */

.closer { padding: clamp(4rem, 8vw, 6.5rem) 0; }
.closer-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.closer h2 { font-size: var(--step-3); font-weight: 900; letter-spacing: -0.025em; line-height: 1.05; max-width: 16ch; }

.foot { border-top: 1px solid var(--rule); padding: 3rem 0 2rem; font-size: .95rem; }
.foot-inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.foot nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.foot-brand p { margin-top: .8rem; max-width: 30ch; }
.foot nav { display: flex; flex-direction: column; gap: .45rem; }
.foot nav h3 { font-size: .95rem; margin-bottom: .3rem; }
.foot nav a { color: var(--graphite); text-decoration: none; }
.foot nav a:hover { color: var(--blue); }
.foot-copy { margin-top: 2.5rem; font-size: var(--step--1); }

/* Japanese: Noto Sans JP for the glyphs SF-style Latin lacks; CJK needs no negative tracking. */
html:lang(ja) { --font: "Schibsted Grotesk", "Noto Sans JP", system-ui, sans-serif; }
html:lang(ja) h1, html:lang(ja) h2, html:lang(ja) h3 { letter-spacing: 0; line-height: 1.3; word-break: auto-phrase; }
html:lang(ja) .hero h1 { line-height: 1.15; max-width: 9em; }
html:lang(ja) body { line-height: 1.75; }

/* Responsive */

@media (max-width: 960px) {
  .hero-grid, .privacy-grid, .faq-grid, .panel { grid-template-columns: 1fr; }
  .panel { min-height: 0; }
  .tabs { margin-inline: 0; }
  .desk { max-width: 520px; margin-inline: auto; width: 100%; }
  .sheet { margin-inline: auto; }
}

@media (max-width: 720px) {
  .top-nav { display: none; }
  .top-inner { justify-content: space-between; }
  .feature, .feature-flip { grid-template-columns: 1fr; }
  .feature-flip .phone { order: 0; }
  .phone { max-width: 260px; margin-inline: auto; }
  .pile-grid { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; }
  .foot-inner { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
  .sheet { padding: 1.5rem 1.3rem 1.2rem; font-size: .74rem; }
  .bubble { font-size: .92rem; }
}

@media (max-width: 480px) {
  .tabs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .tabs button { padding: .8rem .5rem; }
  .panel { padding: 1.5rem; border-radius: 22px; }
  /* Narrow screens: the answer sits under the invoice so it never covers the total. */
  .desk { padding-bottom: 0; }
  .answer { position: relative; left: auto; bottom: auto; width: 92%; margin: -1rem 0 0 auto; }
}
