/* Matches madfable.com (values read from the site's own styles, 2026-11-24):
   cream background, near-black text, deep teal buttons, sage sections,
   Libre Baskerville headings, Almarai text, 15 px rounded buttons.
   Both fonts are SIL Open Font License; copies are in fonts/. */
@font-face {
  font-family: 'Almarai'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/Almarai-400-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Almarai'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('fonts/Almarai-700-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Libre Baskerville'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('fonts/LibreBaskerville-latin.woff2') format('woff2');
}

:root {
  --cream: #f7f3e8;
  --ink: #171814;
  --teal: #164f56;
  --teal-soft: rgba(22, 79, 86, 0.14);
  --gold: #d9b254;
  --sage: #dce5d0;
  --muted: #4b4d46;
  --line: rgba(23, 24, 20, 0.16);
  --warn-bg: #f1e5c3;
  --warn-ink: #3f3108;
  --radius: 15px;
  --serif: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  --sans: 'Almarai', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.5;
  font-size: 17px;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--teal); }
[hidden] { display: none !important; }

h1, h2 {
  font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; line-height: 1.12;
  margin: 0 0 12px;
}
h1 { font-size: clamp(32px, 5.2vw, 54px); }
h2 { font-size: clamp(22px, 2.6vw, 30px); }
.lead { font-size: 20px; line-height: 1.5; margin: 0; }
.small { font-size: 15px; }
.muted { color: var(--muted); }

/* Full-page header */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1040px; margin: 0 auto; padding: 22px 24px;
}
.brand { font-family: var(--serif); font-size: 24px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.brand small { font-family: var(--sans); font-size: 14px; color: var(--muted); letter-spacing: 0; margin-left: 8px; }
.top-links { display: flex; align-items: center; gap: 18px; font-size: 16px; }
.top-links a { color: var(--ink); text-decoration: none; }
.top-links a:hover { text-decoration: underline; }

main { max-width: 1040px; margin: 0 auto; padding: 0 24px 24px; }
.intro { text-align: center; padding: 28px 0 8px; }

.panel { padding: 22px 0; margin: 0; }
.tool { max-width: 820px; margin: 0 auto; }

/* Choose / drop */
.drop {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 220px; border: 1.5px dashed rgba(22, 79, 86, 0.45); border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer; text-align: center; padding: 28px; transition: background .15s, border-color .15s;
}
.drop:hover, .drop.over { background: rgba(220, 229, 208, 0.6); border-color: var(--teal); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { outline: 3px solid rgba(22, 79, 86, 0.35); outline-offset: 3px; }
.drop-button {
  background: var(--teal); color: var(--cream); font-size: 17px;
  padding: 18px 34px; border-radius: var(--radius);
}
.drop-hint { color: var(--muted); }
.pick p { text-align: center; margin: 14px 0 0; }

/* Working */
.working { text-align: center; }
.stage { font-family: var(--serif); font-size: 22px; letter-spacing: -0.01em; margin: 0 0 14px; }
.bar { height: 8px; background: var(--teal-soft); border-radius: 999px; overflow: hidden; max-width: 560px; margin: 0 auto; }
#bar-fill { height: 100%; width: 0; background: var(--teal); }
.working .small { margin: 12px 0 0; }
.working .actions { justify-content: center; }

/* Result */
.checker {
  display: flex; justify-content: center; align-items: center;
  border-radius: var(--radius); overflow: hidden;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #dedbd2 25%, transparent 25%),
    linear-gradient(-45deg, #dedbd2 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #dedbd2 75%),
    linear-gradient(-45deg, transparent 75%, #dedbd2 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
#preview { display: block; max-width: 100%; max-height: 68vh; height: auto; }
.result .small { margin: 12px 0 0; }

/* Buttons, like the site's */
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; }
.primary, .secondary {
  display: inline-block; font: 400 16px/1.2 var(--sans); text-decoration: none; text-align: center;
  border-radius: var(--radius); padding: 18px 32px; cursor: pointer;
}
.primary { background: var(--teal); color: var(--cream); border: 1px solid var(--teal); }
.primary:hover { background: #0f3d43; }
.secondary { background: transparent; color: var(--teal); border: 1px solid var(--teal); }
.secondary:hover { background: var(--teal-soft); }
.primary.disabled { opacity: .5; pointer-events: none; }

.warning, .notice { background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 12px 16px; }
.warning { margin: 14px 0 0; }
.notice { margin: 18px auto 0; max-width: 820px; }
.unsupported { max-width: 820px; margin: 0 auto; }

/* Sections in the site's sage colour */
.upsell { background: var(--sage); border-radius: var(--radius); padding: 34px 36px; margin: 34px 0 10px; }
.upsell ul { margin: 10px 0 20px; padding-left: 22px; }
.upsell li { margin: 4px 0; }
.privacy { max-width: 820px; }
.foot { max-width: 1040px; margin: 0 auto; padding: 8px 24px 36px; }

/* Shown inside a page of madfable.com: no own background, header or
   sections; the website around it provides those. */
html.embed-root, body.embed, body.embed main { background: transparent; }
body.embed main { padding: 0 4px 4px; max-width: none; }
body.embed .panel { padding: 8px 0; }
body.embed .tool { max-width: none; }
body.embed .embed-foot { text-align: center; margin: 10px 0 0; }
/* The frame's height follows the content, so nothing inside may be sized
   by the frame's height (vh), or the two keep chasing each other. */
body.embed #preview { max-height: 560px; }

.licenses pre {
  white-space: pre-wrap; font-size: 13px; background: rgba(255, 255, 255, 0.5); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; max-height: 420px; overflow: auto;
}
.licenses .panel { max-width: 820px; }

@media (max-width: 600px) {
  :root { font-size: 16px; }
  .top { padding: 16px; }
  .top-links .site-link { display: none; }
  main { padding: 0 16px 16px; }
  .upsell { padding: 24px 20px; }
  .primary, .secondary { padding: 16px 24px; width: 100%; }
  .actions { flex-direction: column; }
}
