/* Corkscrew Studios. One stylesheet, no JavaScript.
   Light and dark themes follow the visitor's device setting. */

/* The headline typeface, Fraunces, is served from this site (public/fonts)
   so that no visitor details go to a font provider. */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/fraunces-latin-opsz-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/fraunces-latin-opsz-italic.woff2") format("woff2");
}

:root {
  color-scheme: light dark;

  --bg: #f6efe4;
  --surface: #fffaf3;
  --ink: #21151a;
  --muted: #68585c;
  --line: #dfd2c2;
  --accent: #7b1e3a;
  --accent-soft: #f1dedd;
  --cellar: #2b0f1a;
  --cellar-ink: #f8ece3;
  --cellar-muted: #d9bfc3;
  --cellar-accent: #f0b1c0;
  --shadow: 0 1px 2px rgb(60 20 30 / 0.06), 0 12px 32px -12px rgb(60 20 30 / 0.22);
  --note-bg: #fff4d6;
  --note-ink: #5c4300;
  --note-line: #c99a1b;

  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --wide: 68rem;
  --measure: 40rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 22px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #150f11;
    --surface: #1f1619;
    --ink: #f3ebe6;
    --muted: #b8a9ab;
    --line: #3b2c31;
    --accent: #eba3b5;
    --accent-soft: #3a2029;
    --cellar: #2b0f1a;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 32px -12px rgb(0 0 0 / 0.6);
    --note-bg: #332a10;
    --note-ink: #f5dfa0;
    --note-line: #b08a22;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.wrap {
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Links and focus */

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  padding: 0.5rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  z-index: 10;
}

.skip:focus {
  top: 0.5rem;
}

/* Header */

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 560;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand svg {
  width: 30px;
  height: 30px;
  flex: none;
}

.site-nav ul {
  display: flex;
  gap: 0.25rem;
  margin: 0 -0.7rem;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.7rem;
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--accent);
}

/* Type */

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 480;
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.6rem, 1.6rem + 5vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

h1 em,
.wordmark em {
  color: var(--accent);
  font-weight: 400;
}

h2 {
  margin: 0 0 0.75rem;
  font-size: 1.6rem;
}

h3 {
  margin: 1.5rem 0 0.25rem;
  font-size: 1.2rem;
}

p,
ul,
ol,
dl {
  margin: 0 0 1rem;
}

.lede {
  font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.35rem);
  line-height: 1.5;
}

.muted {
  color: var(--muted);
}

/* Small label above a title. */
.kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.kicker a {
  color: inherit;
}

.pill {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  background: var(--surface);
  color: var(--accent);
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
  white-space: nowrap;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 1.3rem;
  background: var(--accent);
  color: var(--bg);
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  text-decoration: underline;
}

/* Home: headline */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: center;
  padding: clamp(2rem, 6vw, 5rem) 0 clamp(2.5rem, 6vw, 4.5rem);
}

.hero h1 {
  margin-bottom: 2.25rem;
  font-size: clamp(3.2rem, 1.2rem + 10vw, 8rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.hero p {
  max-width: 36rem;
}

.hero-art {
  width: clamp(5.5rem, 13vw, 10rem);
  height: auto;
  margin-right: clamp(0rem, 4vw, 4rem);
  transform: rotate(14deg);
}

/* Home: the apps */

.section-title {
  margin-bottom: 1.25rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem);
}

.app-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-card {
  --tint: var(--accent);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.app-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

/* The coloured panel behind an app's icon. */
.plate {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.75rem;
  background: var(--accent-soft);
  background: color-mix(in srgb, var(--tint) 20%, var(--surface));
}

.app-icon {
  display: block;
  width: 104px;
  height: 104px;
  border-radius: 22.5%;
  box-shadow: var(--shadow);
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.4rem 1.75rem 1.5rem;
}

.app-card h3 {
  margin: 0 0 0.3rem;
  font-size: clamp(1.7rem, 1.4rem + 1vw, 2.1rem);
}

.app-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

/* Makes the whole card clickable while keeping one real link for screen readers. */
.app-card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.app-card p {
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.app-card .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: auto 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.app-card .more {
  margin-left: auto;
  color: var(--accent);
  font-weight: 600;
}

.arrow {
  display: inline-block;
}

.store-link {
  position: relative; /* sits above the card's click area */
  z-index: 1;
}

/* Home: about and help */

.band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1.5rem;
  margin-top: clamp(3rem, 7vw, 5rem);
}

.panel {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.panel h2 {
  font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.5rem);
}

.panel > :last-child {
  margin-bottom: 0;
}

.panel-dark {
  background: var(--cellar);
  border-color: var(--cellar);
  color: var(--cellar-ink);
}

.panel-dark .kicker {
  color: var(--cellar-muted);
}

.panel-dark .button {
  margin-top: 0.5rem;
  background: var(--cellar-ink);
  color: var(--cellar);
}

.panel-dark :focus-visible {
  outline-color: var(--cellar-accent);
}

/* Ordinary pages: title, then sections with the heading on the left */

.page-head {
  max-width: 46rem;
  padding: clamp(1.5rem, 5vw, 3.5rem) 0 clamp(1.5rem, 4vw, 2.5rem);
}

.page-head > :last-child {
  margin-bottom: 0;
}

.row {
  display: grid;
  grid-template-columns: 15rem minmax(0, var(--measure));
  gap: 0.75rem 3rem;
  padding: 2.25rem 0;
  border-top: 1px solid var(--line);
}

.row > h2 {
  margin: 0;
  font-size: 1.45rem;
}

.row-body > :last-child {
  margin-bottom: 0;
}

.row-body h3:first-child {
  margin-top: 0;
}

@media (max-width: 52rem) {
  .row {
    grid-template-columns: minmax(0, var(--measure));
  }
}

/* App page */

.app-head {
  --tint: var(--accent);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(1.25rem, 4vw, 2.5rem);
  align-items: center;
  margin: 1rem 0 clamp(2rem, 5vw, 3.5rem);
  padding: clamp(1.5rem, 5vw, 3.25rem);
  background: var(--accent-soft);
  background: color-mix(in srgb, var(--tint) 20%, var(--surface));
  border-radius: var(--radius);
}

.app-head .app-icon {
  width: clamp(5.5rem, 14vw, 8rem);
  height: auto;
}

.app-head h1 {
  margin-bottom: 0.75rem;
}

.app-head .lede {
  max-width: 34rem;
}

.app-head div > :last-child {
  margin-bottom: 0;
}

.name-note {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0;
  white-space: nowrap;
}

@media (max-width: 34rem) {
  .app-head {
    grid-template-columns: minmax(0, 1fr);
  }
}

.decisions {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: decision;
}

.decisions li {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
  counter-increment: decision;
}

.decisions li:first-child {
  padding-top: 0;
  border-top: 0;
}

.decisions li::before {
  content: counter(decision, decimal-leading-zero);
  padding-top: 0.3rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}

.decisions li > * {
  grid-column: 2;
}

.decisions h3 {
  margin-top: 0;
}

.decisions p {
  margin: 0;
}

.link-list {
  padding: 0;
  list-style: none;
}

.link-list li {
  border-top: 1px solid var(--line);
}

.link-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.link-list a {
  display: flex;
  align-items: center;
  min-height: 48px;
}

/* Support */

.email {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 0.9rem + 2.2vw, 2.2rem);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.faq {
  margin: 0;
}

.faq dt {
  margin-top: 1.25rem;
  font-weight: 600;
}

.faq dt:first-child {
  margin-top: 0;
}

.faq dd {
  margin: 0.25rem 0 0;
}

/* Footer */

.site-footer {
  margin-top: clamp(3.5rem, 8vw, 6rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer .wrap {
  padding-top: 2.25rem;
  padding-bottom: 2rem;
}

.coil {
  display: block;
  width: 132px;
  height: 12px;
  color: var(--accent);
}

.wordmark {
  margin: 0.75rem 0 1.25rem;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(2rem, 1.2rem + 4vw, 3.75rem);
  font-weight: 480;
  line-height: 1;
  letter-spacing: -0.03em;
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
}

.foot-row ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-row a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
}

.foot-row p {
  margin: 0;
}

/* Placeholders: text I still need to supply. Deliberately hard to miss. */

.placeholder {
  display: block;
  padding: 0.7rem 0.9rem;
  background: var(--note-bg);
  color: var(--note-ink);
  border: 2px dashed var(--note-line);
  border-radius: 10px;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
}

.placeholder strong {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Small screens */

@media (max-width: 40rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-art {
    display: none;
  }

  .plate,
  .card-body {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .app-icon {
    width: 84px;
    height: 84px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .app-card {
    transition: border-color 0.15s ease, box-shadow 0.2s ease, transform 0.2s ease;
  }

  .app-card:hover {
    transform: translateY(-3px);
  }

  .arrow {
    transition: transform 0.2s ease;
  }

  .app-card:hover .arrow {
    transform: translateX(4px);
  }
}

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