/* ==========================================================================
   Mataino Studio — stylesheet
   Art direction: editorial, warm, restrained. Paper, ink, one red-chile accent.
   Type: Source Serif 4 (display) · IBM Plex Sans (text) · IBM Plex Mono (meta)
   Spacing: 8px scale. Corners: square (2px on controls only).
   ========================================================================== */

:root {
  /* Color */
  --paper: #f4f1ea;
  --paper-deep: #ebe6db;
  --ink: #1c1b18;
  --ink-soft: #4a4740;
  --muted: #625d53;
  --rule: #d6cfbf;
  --accent: #a63d24;       /* red chile */
  --accent-ink: #8a3119;   /* hover / pressed */
  --on-dark: #f4f1ea;
  --on-dark-muted: #b7b0a2;
  --rule-dark: #3a3832;

  /* Type */
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-text: "IBM Plex Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  /* Spacing (8px scale) */
  --s1: 0.5rem;   /* 8  */
  --s2: 1rem;     /* 16 */
  --s3: 1.5rem;   /* 24 */
  --s4: 2rem;     /* 32 */
  --s5: 3rem;     /* 48 */
  --s6: 4rem;     /* 64 */
  --s7: 6rem;     /* 96 */

  --gutter: 1.5rem;
  --max: 75rem;   /* 1200px */
  --radius: 2px;
}

/* Reset ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
ul, ol { padding: 0; list-style: none; }

/* Links & focus ---------------------------------------------------------- */
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip-link {
  position: absolute; left: var(--s2); top: -100px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: var(--s1) var(--s2);
}
.skip-link:focus { top: var(--s2); }

/* Layout ----------------------------------------------------------------- */
.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }

/* Type scale ------------------------------------------------------------- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-optical-sizing: auto;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.75rem); line-height: 1.06; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 1.4rem + 1.3vw, 2.5rem); line-height: 1.15; }
h3 { font-size: 1.375rem; line-height: 1.3; }
p { max-width: 38em; text-wrap: pretty; }
.meta {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* Buttons ---------------------------------------------------------------- */
.button {
  display: inline-flex; align-items: center; gap: 0.6em;
  min-height: 48px; padding: 0 var(--s3);
  background: var(--ink); color: var(--paper);
  border: 1px solid var(--ink); border-radius: var(--radius);
  font: 500 1rem/1 var(--font-text); text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease;
}
.button:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.button--line { background: transparent; color: var(--ink); }
.button--line:hover { background: var(--ink); border-color: var(--ink); }
.arrow { display: inline-block; transition: transform .15s ease; }
a:hover > .arrow { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) { .arrow, .button { transition: none; } }

/* Header ----------------------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3); min-height: 72px;
}
.wordmark {
  display: inline-flex; align-items: baseline; gap: 0.4em;
  font-family: var(--font-display); font-size: 1.5rem; line-height: 1;
  text-decoration: none; letter-spacing: -0.01em;
}
.wordmark span { font: 500 0.75rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.wordmark:hover { color: var(--ink); }
.site-nav ul { display: flex; gap: var(--s4); }
.site-nav a {
  display: inline-block; padding: var(--s1) 0;
  font-size: 0.9375rem; text-decoration: none; color: var(--ink-soft);
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

/* Hero ------------------------------------------------------------------- */
.hero { padding: var(--s7) 0 var(--s6); border-bottom: 1px solid var(--rule); }
.hero h1 { grid-column: 1 / span 8; }
.hero-lede { grid-column: 1 / span 6; margin-top: var(--s4); font-size: 1.1875rem; color: var(--ink-soft); }
.hero-actions { grid-column: 1 / span 8; display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s5); }
.hero-facts {
  grid-column: 10 / span 3; grid-row: 1 / span 3; align-self: end;
  border-top: 1px solid var(--ink);
}
.hero-facts div { padding: var(--s2) 0; border-bottom: 1px solid var(--rule); }
.hero-facts dt { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.hero-facts dd { margin: 4px 0 0; font-size: 0.9375rem; }

/* Sections --------------------------------------------------------------- */
.section { padding: var(--s7) 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section-head { grid-column: 1 / span 4; }
.section-head p { margin-top: var(--s2); color: var(--ink-soft); }
.section-body { grid-column: 6 / span 7; }

/* Titles list ------------------------------------------------------------ */
.titles { border-top: 1px solid var(--ink); }
.title {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: var(--s1) var(--s3);
  align-items: center;
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--rule);
}
.title-icon {
  width: 72px; height: 72px; border-radius: 16px; /* matches iOS/Android icon shape */
  object-fit: cover; background: var(--paper-deep);
}
.title h3 { font-size: 1.375rem; }
.title p { margin-top: 2px; color: var(--ink-soft); font-size: 0.9875rem; }
.title .meta { margin-top: 6px; }
.title-stores { display: flex; flex-direction: column; gap: 6px; text-align: right; }
.title-stores a { font-size: 0.9375rem; white-space: nowrap; }

.titles-empty { padding: var(--s4) 0; border-bottom: 1px solid var(--rule); }
.titles-empty p { color: var(--ink-soft); }
.titles-empty p + p { margin-top: var(--s1); }

/* Studio ----------------------------------------------------------------- */
.studio-intro { grid-column: 1 / span 7; }
.studio-intro p { margin-top: var(--s3); font-size: 1.1875rem; color: var(--ink-soft); }
.principles {
  grid-column: 1 / -1; margin-top: var(--s6);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gutter);
  counter-reset: p;
}
.principles li { border-top: 1px solid var(--ink); padding-top: var(--s2); counter-increment: p; }
.principles li::before { content: "0" counter(p); display: block; font: 0.8125rem var(--font-mono); color: var(--accent); margin-bottom: var(--s2); }
.principles h3 { font-size: 1.25rem; }
.principles p { margin-top: var(--s1); color: var(--ink-soft); font-size: 0.9875rem; }

/* Support (dark band) ---------------------------------------------------- */
.support { background: var(--ink); color: var(--on-dark); }
.section.support { border-top: 0; }
.support .section-head p { color: var(--on-dark-muted); }
.support a:hover { color: #e0876f; }
.support :focus-visible { outline-color: #e0876f; }
.support-email {
  display: inline-block; margin-top: var(--s4);
  font-family: var(--font-display); font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 0.18em;
}
.support-list li { padding: var(--s3) 0; border-top: 1px solid var(--rule-dark); }
.support-list li:last-child { border-bottom: 1px solid var(--rule-dark); }
.support-list h3 { font-size: 1.25rem; }
.support-list p { margin-top: var(--s1); color: var(--on-dark-muted); }
.support-list a { color: var(--on-dark); }

/* Footer ----------------------------------------------------------------- */
.site-footer { background: var(--paper-deep); border-top: 1px solid var(--rule); padding: var(--s6) 0 var(--s4); font-size: 0.9375rem; }
.footer-company { grid-column: 1 / span 5; }
.footer-company .wordmark { margin-bottom: var(--s3); }
.footer-company address { font-style: normal; line-height: 1.7; color: var(--ink-soft); }
.footer-company address strong { color: var(--ink); font-weight: 500; }
.footer-col { grid-column: span 3; }
.footer-col:first-of-type { grid-column: 7 / span 3; }
.footer-col h2 { font: 500 0.75rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s2); }
.footer-col li + li { margin-top: 6px; }
.footer-col a { text-decoration: none; display: inline-block; padding: 4px 0; }
.footer-col a:hover { text-decoration: underline; }
.footer-col a[aria-current="page"] { text-decoration: underline; color: var(--accent); }
.footer-base {
  margin-top: var(--s6); padding-top: var(--s3); border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap;
}

/* Legal pages ------------------------------------------------------------ */
.legal { padding: var(--s6) 0 var(--s7); }
.legal-nav { grid-column: 1 / span 3; align-self: start; position: sticky; top: var(--s3); }
.legal-nav-label { font: 500 0.75rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s2); }
.legal-nav ul { border-top: 1px solid var(--ink); }
.legal-nav li { border-bottom: 1px solid var(--rule); }
.legal-nav a { display: block; padding: 12px 0; text-decoration: none; }
.legal-nav a[aria-current="page"] { color: var(--accent); }
.legal-body { grid-column: 5 / span 7; }
.legal-body h1 { font-size: clamp(2rem, 1.6rem + 1.6vw, 3rem); }
.legal-body .meta { margin-top: var(--s2); margin-bottom: var(--s5); }
.legal-body h2 { font-size: 1.375rem; margin-top: var(--s5); margin-bottom: var(--s2); }
.legal-body p, .legal-body li { color: var(--ink-soft); }
.legal-body p + p { margin-top: var(--s2); }
.legal-body ul { margin-top: var(--s2); }
.legal-body ul li { position: relative; padding-left: 1.25em; max-width: 38em; }
.legal-body ul li + li { margin-top: var(--s1); }
.legal-body ul li::before { content: "–"; position: absolute; left: 0; color: var(--muted); }
.legal-body strong { color: var(--ink); font-weight: 500; }
.legal-body a { color: var(--accent); }
.legal-body a:hover { color: var(--accent-ink); }

/* Tablet ----------------------------------------------------------------- */
@media (max-width: 960px) {
  .hero h1, .hero-lede, .hero-actions { grid-column: 1 / -1; }
  .hero-lede { max-width: 34em; }
  .hero-facts {
    grid-column: 1 / -1; grid-row: auto; margin-top: var(--s5);
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gutter);
  }
  .section-head, .section-body, .studio-intro { grid-column: 1 / -1; }
  .section-body { margin-top: var(--s5); }
  .footer-company { grid-column: 1 / -1; margin-bottom: var(--s5); }
  .footer-col, .footer-col:first-of-type { grid-column: span 6; }
  .legal-nav { grid-column: 1 / -1; position: static; margin-bottom: var(--s5); }
  .legal-nav ul { display: flex; flex-wrap: wrap; gap: 0 var(--s3); border-bottom: 1px solid var(--rule); }
  .legal-nav li { border: 0; }
  .legal-body { grid-column: 1 / -1; }
}

/* Phone ------------------------------------------------------------------ */
@media (max-width: 640px) {
  :root { --gutter: 1.25rem; --s7: 4rem; }
  body { font-size: 1rem; }
  .site-header .wrap { flex-direction: column; align-items: flex-start; gap: 0; padding-top: var(--s2); }
  .site-nav { width: 100%; }
  .site-nav ul { gap: 0; justify-content: space-between; }
  .site-nav a { padding: 12px 0; min-height: 44px; }
  .hero { padding-top: var(--s6); }
  .hero-actions .button { flex: 1 1 100%; justify-content: center; }
  .hero-facts { grid-template-columns: 1fr; }
  .title { grid-template-columns: 56px minmax(0, 1fr); }
  .title-icon { width: 56px; height: 56px; border-radius: 12px; }
  .title-stores { grid-column: 1 / -1; flex-direction: row; gap: var(--s3); text-align: left; margin-top: var(--s1); }
  .title-stores a { min-height: 44px; display: inline-flex; align-items: center; }
  .principles { grid-template-columns: 1fr; row-gap: var(--s4); margin-top: var(--s5); }
  .footer-col, .footer-col:first-of-type { grid-column: 1 / -1; }
  .footer-col + .footer-col { margin-top: var(--s4); }
  .footer-col a { padding: 8px 0; }
  .legal { padding-top: var(--s4); }
  .legal-nav ul { flex-direction: column; border-bottom: 0; }
  .legal-nav li { border-bottom: 1px solid var(--rule); }
}
