/* ── Graflio · site.css ──────────────────────────────────────────────
   The shared layer under every page: tokens, type, buttons, the header
   and the footer. Page stylesheets (landing.css, styles.css, the inline
   CSS of the blog / SEO / legal shells) sit on top of this one and only
   describe their own content.

   The look is "quiet paper": a warm off-white field, white surfaces with
   hairlines, ink text in three strengths, one emerald accent. Hierarchy
   comes from type (Archivo headings and UI, Fragment Mono labels),
   weight and whitespace — never from decoration. */

:root {
  /* field & surfaces */
  --paper: #fbfaf7;
  --cream: #ffffff;
  --surface-2: #f5f3ee;
  --surface-3: #eeebe3;

  /* text: three strengths only */
  --ink: #131e2b;
  --body: #4c5866;
  --dim: #949288;

  /* lines */
  --line: #eae7df;
  --line-strong: #d9d5ca;

  /* the one accent, plus the status colours */
  --accent: #0c8a5f;
  --accent-deep: #0a6e4c;
  --accent-soft: #e8f4ee;
  --accent-line: #c5e3d4;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --warn: #b4551f;
  --warn-soft: #fdf1e8;
  --star: #e59400;

  /* names the app stylesheet grew up with */
  --bg: var(--paper);
  --surface: var(--cream);
  --txt-2: var(--body);
  --muted: var(--dim);

  /* elevation, warm-tinted so shadows read as paper on paper */
  --shadow-xs: 0 1px 2px rgba(35, 30, 15, 0.05);
  --shadow-sm: 0 1px 2px rgba(35, 30, 15, 0.05), 0 2px 6px -2px rgba(35, 30, 15, 0.07);
  --shadow-md: 0 10px 30px -12px rgba(35, 30, 15, 0.16);
  --shadow-lg: 0 24px 60px -24px rgba(35, 30, 15, 0.28);
  --ring: 0 0 0 3px rgba(12, 138, 95, 0.12);

  /* radii — small, like a tool, not a toy */
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 10px;
  --r-xl: 12px;

  /* type */
  --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif; /* headings: the wordmark's own grotesk */
  --mono: 'Fragment Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* layout: every page sits in one centred container with the same side margins */
  --container: 1180px;
  --pad-x: 24px;
  --gutter: var(--pad-x);
  --space-section: clamp(64px, 8vw, 104px);
  --nav-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: var(--accent-soft); }
img, svg, video { max-width: 100%; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.hidden { display: none !important; }

/* App pages are a column: the footer sits at the bottom of the viewport on
   short pages and after the content on long ones — never floating mid-page
   and never clipped. */
body.page-app {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
body.page-app > main { flex: 1 0 auto; width: 100%; }

/* ── wordmark ── */
.wordmark {
  display: inline-block;
  font-family: 'Archivo', var(--sans);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.028em;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}
.wordmark:hover { color: var(--ink); text-decoration: none; }
.wordmark.sm { font-size: 19px; }
.wm-l { color: var(--accent); }
.wm-i { position: relative; }
.wm-i::before {
  content: ''; position: absolute; width: .165em; height: .165em; border-radius: 50%;
  background: var(--accent); left: .0625em; top: .075em;
}

/* ── type helpers ── */
.kicker {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase; font-weight: 600;
  color: var(--accent-deep);
}
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--pad-x); }
.lede { font-size: 17px; color: var(--body); line-height: 1.65; }
.sec-label {
  font-family: var(--sans); font-size: 11.5px; letter-spacing: .1em;
  text-transform: uppercase; font-weight: 600; color: var(--dim);
  padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 20px;
}
.page-head { text-align: center; margin: 0 auto 34px; max-width: 640px; }
.page-head .kicker { display: block; margin-bottom: 12px; }
.page-head h1, .page-head h2 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(28px, 3.4vw, 36px); letter-spacing: -0.025em; line-height: 1.12;
  margin: 0 0 8px;
}
.page-head p { margin: 0; color: var(--body); font-size: 15px; line-height: 1.6; }

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--sans); font-weight: 600; font-size: 14px; line-height: 1.2;
  padding: 10px 18px; border-radius: var(--r);
  border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.08s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-deep); color: #fff; text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
/* a cost inside a button: "Generate 7 images [◈ 14]" */
.btn .btn-cost {
  display: inline-flex; align-items: center; gap: 2px; margin-left: 2px;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.22); color: #fff;
  font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap;
}
.btn.ghost .btn-cost, .btn.quiet .btn-cost, .btn.dark .btn-cost { background: var(--accent-soft); color: var(--accent-deep); }
.btn.ghost { background: var(--cream); color: var(--body); border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent-deep); text-decoration: none; }
.btn.quiet { background: transparent; color: var(--body); box-shadow: none; }
.btn.quiet:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.btn.sm { font-size: 13px; padding: 8px 14px; }
.btn.big, .btn.lg { font-size: 16px; padding: 14px 28px; border-radius: 12px; }
.btn.full { width: 100%; }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.45; cursor: not-allowed; }

/* pop-over menus shared by the language switcher, the burger and the account */
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50;
  min-width: 170px; padding: 6px;
  background: var(--cream); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg);
  display: grid; gap: 2px;
  animation: pop-in 0.14s ease;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.menu-pop a, .menu-pop button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 11px; border-radius: 8px;
  font: inherit; font-size: 13.5px; font-weight: 500; color: var(--ink);
  background: none; border: none; text-align: left; cursor: pointer; text-decoration: none;
}
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.menu-pop a[aria-current='true'] { color: var(--accent-deep); background: var(--accent-soft); font-weight: 600; }
.caret { width: 10px; height: 6px; flex: none; color: var(--dim); }
details[open] > summary .caret { transform: rotate(180deg); }

/* ══════════════════════════════════════════════════════════════════
   marketing header
   ══════════════════════════════════════════════════════════════════ */
.site-nav {
  position: sticky; top: 0; z-index: 40;
  height: var(--nav-h);
  background: rgba(251, 250, 247, 0.86);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-in {
  max-width: var(--container); margin: 0 auto; padding: 0 var(--pad-x);
  height: 100%; display: flex; align-items: center; gap: 16px;
}
.site-links { display: flex; gap: 2px; margin: 0 auto; }
.site-links a {
  color: var(--body); text-decoration: none; font-weight: 500; font-size: 14px;
  padding: 7px 12px; border-radius: 8px;
}
.site-links a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.site-links a[aria-current='page'] { color: var(--ink); font-weight: 600; }
.site-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-signin {
  color: var(--body); text-decoration: none; font-weight: 500; font-size: 14px;
  padding: 8px 12px; border-radius: 8px; margin-right: 4px;
}
.nav-signin:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }

.lang-menu { position: relative; }
.lang-menu summary {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--sans); font-size: 13.5px; font-weight: 500; color: var(--body);
  padding: 7px 9px; border-radius: 8px;
}
.lang-menu summary:hover, .lang-menu[open] > summary { color: var(--ink); background: var(--surface-2); }
.lang-list { min-width: 160px; }
.lang-list a { font-weight: 500; }

.site-burger { display: none; position: relative; }
.site-burger summary { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; }
.site-burger summary:hover, .site-burger[open] > summary { background: var(--surface-2); }
.site-burger summary span { position: relative; display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; }
.site-burger summary span::before, .site-burger summary span::after {
  content: ''; position: absolute; left: 0; width: 18px; height: 2px; background: var(--ink); border-radius: 2px;
}
.site-burger summary span::before { top: -6px; }
.site-burger summary span::after { top: 6px; }
.site-drawer { width: min(280px, 88vw); }
.site-drawer a { font-size: 15px; padding: 11px 12px; }
.site-drawer a:last-child { border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; }

@media (max-width: 960px) {
  .site-links, .nav-signin { display: none; }
  .site-burger { display: block; }
}
@media (max-width: 480px) {
  :root { --nav-h: 56px; --pad-x: 18px; }
  .wordmark { font-size: 23px; }
  .site-right .btn { display: none; }
}

/* ══════════════════════════════════════════════════════════════════
   app header
   ══════════════════════════════════════════════════════════════════ */
.app-bar {
  position: sticky; top: 0; z-index: 40;
  height: 60px;
  background: rgba(251, 250, 247, 0.88);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.bar-in {
  max-width: var(--container); margin: 0 auto; padding: 0 var(--pad-x);
  height: 100%; display: flex; align-items: center; gap: 14px;
}
/* the studio's bar spans the workbench, so its contents do too */
.studio-bar .bar-in { max-width: none; padding: 0 18px; }

/* app pages: one column, one rhythm */
.app-col { max-width: 880px; margin: 0 auto; padding: 56px var(--pad-x) 96px; }
.app-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.credits-chip {
  display: inline-flex; align-items: center; gap: 3px;
  font-family: var(--sans); font-size: 13.5px; font-weight: 600; line-height: 1;
  color: var(--accent-deep); background: var(--accent-soft);
  border: 1px solid var(--accent-line); border-radius: 999px;
  padding: 7px 12px; text-decoration: none; white-space: nowrap;
  transition: box-shadow 0.14s;
}
.credits-chip:hover { box-shadow: var(--ring); text-decoration: none; }
.credits-chip.low { color: var(--danger); background: var(--danger-soft); border-color: #f0c9c4; }
.credits-chip .cr { width: 0.9em; height: 0.9em; margin-right: 0.2em; }

.acct { position: relative; }
.acct > summary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--cream);
  font-size: 13px; color: var(--body); max-width: 250px;
  box-shadow: var(--shadow-xs);
}
.acct > summary:hover, .acct[open] > summary { border-color: var(--line-strong); color: var(--ink); }
.acct-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--ink); color: #fff;
  font-family: var(--sans); font-size: 12px; text-transform: uppercase; font-weight: 600; letter-spacing: .1em;
  display: grid; place-items: center;
}
.user-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-menu { min-width: 240px; }
.acct-id {
  font-family: var(--sans); font-size: 13px; color: var(--dim);
  padding: 8px 11px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px;
  overflow-wrap: anywhere;
}
.acct-id:empty { display: none; }
.acct-lang {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 11px 8px; font-size: 13px; color: var(--body);
  border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.acct-lang .lang-switch {
  font: inherit; font-size: 13px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 4px 8px; margin: 0; width: auto; box-shadow: none; cursor: pointer;
}
.acct-menu #btn-signout { color: var(--danger); border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; }
.acct-menu #btn-signout:hover { background: var(--danger-soft); }

@media (max-width: 760px) {
  .user-email { display: none; }
  .acct > summary { padding: 3px; gap: 0; }
  .acct > summary .caret { display: none; }
  #btn-brand { display: none; }
}

/* ══════════════════════════════════════════════════════════════════
   footer
   ══════════════════════════════════════════════════════════════════ */
.site-foot {
  margin-top: auto;
  background: var(--cream);
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 14px;
}
.sf-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 36px clamp(24px, 4vw, 56px);
  max-width: 1180px; margin: 0 auto;
  padding: clamp(40px, 5vw, 64px) var(--gutter) clamp(30px, 4vw, 44px);
}
.sf-brand p { margin: 16px 0 18px; max-width: 300px; color: var(--body); line-height: 1.55; font-size: 14px; }
.sf-langs { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
.sf-langs a { color: var(--dim); text-decoration: none; }
.sf-langs a:hover { color: var(--ink); text-decoration: none; }
.sf-langs a[aria-current='true'] { color: var(--accent-deep); font-weight: 600; }
.sf-col { display: grid; gap: 9px; align-content: start; justify-items: start; }
.sf-col h4 {
  margin: 0 0 6px; font-family: var(--sans); font-weight: 600;
  font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim);
}
.sf-col a, .sf-cookies { color: var(--body); text-decoration: none; font-size: 14px; line-height: 1.4; }
.sf-col a:hover, .sf-cookies:hover { color: var(--accent-deep); text-decoration: none; }
.sf-cookies { font: inherit; background: none; border: none; padding: 0; cursor: pointer; text-align: left; }
.sf-bottom { border-top: 1px solid var(--line); }
.sf-bottom-in {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: 1180px; margin: 0 auto; padding: 18px var(--gutter) 24px;
  font-size: 12.5px; color: var(--dim);
}
@media (max-width: 900px) {
  .sf-grid { grid-template-columns: 1fr 1fr 1fr; }
  .sf-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .sf-grid { grid-template-columns: 1fr 1fr; }
}

/* the slim variant on app pages: one quiet row */
.site-foot.slim { font-size: 12.5px; }
.sf-slim {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  max-width: 1180px; margin: 0 auto;
  padding: 18px var(--gutter) 22px;
}
.sf-slim nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.sf-slim nav a, .sf-slim .sf-cookies { color: var(--dim); text-decoration: none; font-size: 12.5px; }
.sf-slim nav a:hover, .sf-slim .sf-cookies:hover { color: var(--accent-deep); text-decoration: none; }
.sf-copy { margin-left: auto; color: var(--dim); white-space: nowrap; }
/* leave the corner free for the floating feedback button */
@media (min-width: 761px) { .sf-slim { padding-right: max(var(--gutter), 170px); } }
@media (max-width: 760px) { .sf-copy { margin-left: 0; } }
