/* Paper Tides studio page. Direction B "Papercut tide". No class starts with "ad-" or contains
   "sponsor"/"banner" (ad blockers hide those). */
:root {
  --sky: #eaf2f6;
  --ink: #0f2a3d;
  --muted: #415a6b;
  --card: #ffffff;
  --card-line: #d3e3ec;
  --accent: #ff8a5c;
  --accent-ink: #2a1206;
  --accent-hover: #ff7442;
  --focus: #0f2a3d;
  --w1: #bcd9e6;
  --w2: #7fb4cc;
  --w3: #3f86a8;
  --w4: #1d5b80;
  --floor-ink: #ffffff;
  --shadow: 0 12px 32px -16px rgba(15, 42, 61, 0.45);
  --paper-rim: #fbf8f1;
  --sail: #fbf8f1;
  --sail-shade: #d5e3eb;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --sky: #0b1824;
    --ink: #e7f1f6;
    --muted: #a7bfcd;
    --card: #122638;
    --card-line: #1c3850;
    --accent: #ffa27e;
    --accent-ink: #2a1206;
    --accent-hover: #ffb798;
    --focus: #ffd3c2;
    --w1: #13324a;
    --w2: #17405e;
    --w3: #1d5174;
    --w4: #25668f;
    --shadow: 0 12px 32px -16px rgba(0, 0, 0, 0.7);
    --paper-rim: #2c4a60;
    --sail: #e7f1f6;
    --sail-shade: #a7bfcd;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--sky);
  color: var(--ink);
  font: 400 1.0625rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: inherit; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.wrap {
  width: 100%;
  max-width: 60rem;
  margin-inline: auto;
  padding-inline: 1rem;
}
@media (min-width: 48rem) { .wrap { padding-inline: 2rem; } }

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 0.875rem;
  background: var(--card);
  border-radius: 8px;
  z-index: 10;
}
.skip:focus { top: 1rem; }

/* Hero */
.hero { padding-block: 2.5rem 2rem; }
@media (min-width: 48rem) { .hero { padding-block: 4.5rem 3rem; } }

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0 0 1.75rem;
  font-weight: 800;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
}
.mark { width: 2.25rem; height: 2.25rem; fill: var(--w4); flex: none; }
@media (prefers-color-scheme: dark) { .mark { fill: var(--accent); } }

.hero h1 {
  margin: 0 0 1rem;
  max-width: 18ch;
  font-size: clamp(2.125rem, 1.4rem + 3.6vw, 4rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.lede { margin: 0; max-width: 40ch; color: var(--muted); font-size: 1.125rem; }

/* Apps */
main { flex: 1 0 auto; padding-bottom: 3rem; }

.section-title {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.apps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr));
}

.app {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
@media (min-width: 30rem) { .app { flex-direction: row; align-items: flex-start; } }

.app-icon { flex: none; width: 4.5rem; height: 4.5rem; border-radius: 16px; }
.app-body { min-width: 0; }
.app h3 { margin: 0; font-size: 1.25rem; letter-spacing: -0.01em; }
.pitch { margin: 0.25rem 0 1rem; color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; }

.btn {
  /* inline-block, not flex: flex would drop the spaces around the hidden app name. */
  display: inline-block;
  text-align: center;
  line-height: 1.4;
  padding: 0.6875rem 1.25rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: none;
}
.btn:hover { background: var(--accent-hover); }
@media (max-width: 29.99rem) { .btn { width: 100%; } }

.store-soon { font-size: 0.9375rem; color: var(--muted); }
.store-badge img { display: block; height: 3.5rem; width: auto; }

/* Contact + privacy */
.notes {
  display: grid;
  gap: 1.5rem;
  margin-top: 3rem;
}
@media (min-width: 48rem) { .notes { grid-template-columns: 1fr 1fr; gap: 2.5rem; } }
.notes h2 { margin: 0 0 0.25rem; font-size: 1.125rem; }
.notes p { margin: 0; color: var(--muted); }
.notes a { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }

/* Wide screens: headline left, apps right, contact + privacy aligned under the two columns.
   With many apps the right column just grows; see README. */
@media (min-width: 64rem) {
  .wrap { max-width: 72rem; }
  .split {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 72rem;
    margin-inline: auto;
    padding: 4.5rem 2rem 0;
  }
  .split .wrap { padding-inline: 0; max-width: none; }
  .split .hero { padding: 0; }
  .apps { grid-template-columns: 1fr; }
  .notes { grid-template-columns: 1.15fr 1fr; gap: 4rem; margin-top: 3.5rem; }
}

/* Paper-cut tide footer */
.tide { margin-top: auto; }
/* Torn-paper layers: each <g> holds a pale paper rim (.rim, 4px higher) and the coloured sheet. */
/* Height grows with width so the top sheets are not cropped on very wide screens. */
.waves { display: block; width: 100%; height: 6.5rem; margin-bottom: -1px; }
@media (min-width: 48rem) { .waves { height: clamp(9.5rem, 10.5vw, 17rem); } }
.waves .sail { fill: var(--sail); }
.waves .sail-shade { fill: var(--sail-shade); }
.waves .hull { fill: var(--accent); }
.waves .w1 { fill: var(--w1); }
.waves .w2 { fill: var(--w2); }
.waves .w3 { fill: var(--w3); }
.waves .w4 { fill: var(--w4); }
.waves .rim { fill: var(--paper-rim); }

.tide-floor { background: var(--w4); color: var(--floor-ink); padding-block: 0.25rem 1.5rem; }
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  font-size: 0.9375rem;
}
.foot nav { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; }
.foot p { margin: 0; }
.tide-floor :focus-visible { outline-color: var(--floor-ink); }

@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background-color 0.15s ease; }
}
