/* ==========================================================================
   Myndos Studio: studio.css
   Base, components and the light studio theme (paper #F5F0E6, ink #1C1A17).
   imbik.css loads after this file on /imbik/ pages and only re-themes it.

   Fonts: Bodoni Moda, Hanken Grotesk, IBM Plex Mono, self-hosted in /assets/fonts
   under the SIL Open Font License 1.1 (OFL-*.txt sit next to the files).

   Everything under /assets is cached for a year: when you edit this file,
   bump the ?v= on the <link> in each page.
   ========================================================================== */

/* ---- Fonts ------------------------------------------------------------- */
@font-face { font-family: "Bodoni Moda"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/BodoniModa-Medium.woff2") format("woff2"); }
@font-face { font-family: "Bodoni Moda"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/BodoniModa-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Bodoni Moda"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/BodoniModa-Italic.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/HankenGrotesk-Regular.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/HankenGrotesk-Medium.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/HankenGrotesk-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/IBMPlexMono-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/IBMPlexMono-Medium.woff2") format("woff2"); }

/* Local stand-ins scaled to the web fonts' metrics, so text does not jump when they arrive. */
@font-face { font-family: "Hanken Grotesk Fallback"; src: local("Arial"), local("Liberation Sans"), local("Helvetica"); size-adjust: 101.65%; ascent-override: 98.38%; descent-override: 29.81%; line-gap-override: 0%; }
@font-face { font-family: "Bodoni Moda Fallback"; src: local("Times New Roman"), local("Liberation Serif"), local("Times"); size-adjust: 117.06%; ascent-override: 96.11%; descent-override: 34.17%; line-gap-override: 0%; }
@font-face { font-family: "IBM Plex Mono Fallback"; src: local("Courier New"), local("Liberation Mono"), local("Courier"); size-adjust: 99.98%; ascent-override: 102.52%; descent-override: 27.5%; line-gap-override: 0%; }

/* ---- Tokens ------------------------------------------------------------ */
:root {
  color-scheme: light;

  --bg: #F5F0E6;
  --surface: #FBF8F1;
  --ink: #1C1A17;
  --muted: #5E584E;          /* 6.1:1 on bg */
  --line: #D9D3C7;
  --line-strong: #BFB9AD;
  --link: var(--ink);
  --focus: var(--ink);

  --font-display: "Bodoni Moda", "Bodoni Moda Fallback", "Bodoni 72", Didot, "Times New Roman", serif;
  --font-text: "Hanken Grotesk", "Hanken Grotesk Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "IBM Plex Mono Fallback", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --step--1: .875rem;
  --step-0: 1.0625rem;
  --step-1: clamp(1.125rem, 1.05rem + .4vw, 1.375rem);
  --step-2: clamp(1.375rem, 1.2rem + .8vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  --step-4: clamp(2rem, 1.5rem + 2.4vw, 3rem);
  --step-5: clamp(2.75rem, 1.4rem + 6vw, 5.5rem);

  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 6.5rem;

  --gutter: clamp(1.25rem, 4vw + .5rem, 2.5rem);
  --wrap: 60rem;
  --radius: 1.25rem;
}

/* ---- Base -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 4.5rem;          /* keeps #tr / #en clear of the sticky header */
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.6;
  font-kerning: normal;
  font-synthesis: none;                /* never fake a weight or a slant */
  overflow-wrap: break-word;
}

main { flex: 1 0 auto; }
main:focus { outline: none; }          /* skip-link target only */

:where(h1, h2, h3, p, ul, ol, figure) { margin: 0; }
:where(ul, ol) { padding: 0; list-style: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  text-wrap: balance;
}
p { text-wrap: pretty; }

img { display: block; max-width: 100%; height: auto; }

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: .0625em;
  text-underline-offset: .22em;
}
a:hover { text-decoration-thickness: .125em; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---- Skip link ---------------------------------------------------------- */
.skip-link {
  position: fixed;
  inset-block-start: .5rem;
  inset-inline-start: var(--gutter);
  z-index: 100;
  padding: .7rem 1rem;
  border-radius: .5rem;
  background: var(--ink);
  color: var(--bg);
  font-size: .9375rem;
  line-height: 1.2;
  text-decoration: none;
  transform: translateY(-400%);
}
.skip-link:focus { transform: none; }

/* ---- Layout ------------------------------------------------------------- */
.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 3.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin-inline-end: auto;
}

.lang-nav { margin-inline-start: auto; margin-inline-end: -.6rem; }
.lang-nav ul { display: flex; align-items: center; }
.lang-nav li + li::before {
  content: "·";
  content: "·" / "";
  color: var(--muted);
}
.lang-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: .6rem;
  color: var(--muted);
  font-size: var(--step--1);
  line-height: 1;
  text-decoration: none;
}
.lang-nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .3em; }

.lang-section { padding-block: 0 var(--space-8); }
.lang-section + .lang-section { border-top: 1px solid var(--line-strong); }

/* ---- Hero (studio home, 404) -------------------------------------------- */
.hero { padding-block: var(--space-7); }
.hero__title {
  font-size: var(--step-5);
  line-height: 1;
  letter-spacing: -.02em;
}
.hero__lede {
  max-width: 34rem;
  margin-block-start: clamp(1rem, .5rem + 1.6vw, 1.75rem);
  color: var(--muted);
  font-size: var(--step-1);
  line-height: 1.45;
}
.hero__lede + .hero__link { margin-block-start: var(--space-5); }
.hero__link { display: inline-block; }
.hero__kicker {
  margin-block-end: var(--space-3);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .1em;
}
.hero__title--sm { font-size: var(--step-4); line-height: 1.05; }
.hero--notfound { padding-block: var(--space-7) var(--space-6); }

/* ---- Rows: a mono label hanging beside its content ----------------------- */
.row {
  display: grid;
  gap: var(--space-3) var(--space-6);
  padding-block: var(--space-6);
  border-top: 1px solid var(--line);
}
.row__label {
  font-family: var(--font-mono);
  font-size: .8125rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.row__body { min-width: 0; }

/* ---- App card ------------------------------------------------------------ */
.app-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-4);
  max-width: 40rem;
  padding: var(--space-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .2s ease, background-color .2s ease;
}
.app-card:hover { border-color: var(--ink); background: #fff; text-decoration: none; }
.app-card__icon {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 22.37%;               /* the iOS icon curve */
  box-shadow: 0 0 0 1px rgba(28, 26, 23, .14);
}
@media (min-width: 30em) {
  .app-card__icon { width: 5.5rem; height: 5.5rem; }
}
.app-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}
.app-card__name {
  font-size: var(--step-3);
  line-height: 1.05;
  letter-spacing: -.01em;
}
.app-card__desc {
  margin-block-start: var(--space-2);
  color: var(--muted);
  font-size: .9375rem;
  line-height: 1.45;
}
.app-card__arrow {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  transition: transform .2s ease, color .2s ease;
}
.app-card:hover .app-card__arrow { color: var(--ink); transform: translateX(.25rem); }
@media (prefers-reduced-motion: reduce) {
  .app-card, .app-card__arrow { transition: none; }
  .app-card:hover .app-card__arrow { transform: none; }
}

.stamp {
  display: inline-block;
  padding: .3em .55em .25em;
  border: 1px solid currentColor;
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .06em;
  vertical-align: .15em;
}

.contact-link {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}

.nb { white-space: nowrap; }           /* keeps a hyphenated compound on one line */

/* ---- Footer -------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: var(--space-6);
  color: var(--muted);
  font-size: var(--step--1);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
}
.site-footer a { color: inherit; }
.site-footer a:hover { color: var(--ink); }

/* ---- Wider screens ------------------------------------------------------- */
@media (min-width: 48em) {
  .hero { padding-block: var(--space-9) var(--space-8); }
  .row {
    grid-template-columns: 12rem minmax(0, 1fr);
    gap: var(--space-6);
    padding-block: var(--space-7);
  }
  .row__label { padding-block-start: .5rem; }
  .row--text { align-items: baseline; }            /* label and first line of text share a baseline */
  .row--text > .row__label,
  .row--text > .row__title { padding-block-start: 0; }
  .lang-section { padding-block-end: var(--space-9); }
}

/* ---- Print --------------------------------------------------------------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --ink: #000; --muted: #333; --line: #bbb; --line-strong: #888; --link: #000; }
  .skip-link, .site-header { display: none; }
  .lang-section + .lang-section { break-before: page; }
  a[href^="http"]::after, a[href^="mailto"]::after { content: " (" attr(href) ")"; font-size: .85em; }
}
