/* ==========================================================================
   Magfish - design system
   Flat, grey surfaces with one solid green accent taken from the logo.
   No gradients, no glows. No external fonts, no CDNs, no trackers.
   ========================================================================== */

:root{
  /* Surfaces - neutral greys */
  --bg:        #16181a;
  --bg-elev:   #1c1f22;
  --bg-card:   #1f2225;
  --bg-card-2: #26292d;
  --bg-soft:   #2b2f33;
  --border:    #303438;
  --border-str:#42474c;

  /* Type */
  --text:     #e9ebed;
  --text-dim: #a2a8ad;
  --text-mut: #7b8288;

  /* Accent - the green from the logo, used flat */
  --accent:     #8ed44f;
  --accent-dim: #6fae3a;
  --accent-ink: #12200a;
  --accent-wash: rgba(142, 212, 79, 0.10);
  --accent-line: rgba(142, 212, 79, 0.38);

  --danger: #d98a80;

  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 18px;

  --shadow:    0 10px 28px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Container system.
     --gutter is the side padding of the centred content column.
     --edge lets full-bleed bars (header/footer) line their content up with
     that column once the viewport is wider than --maxw. */
  --maxw:   1240px;
  --gutter: clamp(18px, 5vw, 60px);
  --edge:   max(var(--gutter), calc((100% - var(--maxw)) / 2 + var(--gutter)));
}

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

html{
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a{ color: inherit; text-decoration: none; }

img{ max-width: 100%; }

h1, h2, h3, h4{
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
}

::selection{ background: var(--accent); color: var(--accent-ink); }

a:focus-visible,
button:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------- Header ---------------------------------------------------- */
header.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px var(--edge);
  background: rgba(22, 24, 26, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand{
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.brand img{
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: block;
  border: 1px solid var(--border-str);
  transition: border-color 0.2s var(--ease);
}

.brand:hover img{ border-color: var(--accent); }

nav.top-nav{
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-dim);
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav.top-nav a{
  position: relative;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 500;
  transition: color 0.16s var(--ease), background 0.16s var(--ease);
}

nav.top-nav a:not(.btn):hover{
  color: var(--text);
  background: var(--bg-soft);
}

/* Underline marker for the active page */
nav.top-nav a:not(.btn)::after{
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s var(--ease);
}

nav.top-nav a:not(.btn):hover::after,
nav.top-nav a[aria-current="page"]::after{ transform: scaleX(1); }

nav.top-nav a[aria-current="page"]{ color: var(--text); }

nav.top-nav a.nav-privacy{
  color: var(--accent);
  font-weight: 600;
  border: 1px solid var(--accent-line);
  background: var(--accent-wash);
  border-radius: 999px;
}

nav.top-nav a.nav-privacy:hover{
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

/* ---------- Buttons --------------------------------------------------- */
.btn{
  --btn-py: 11px;
  --btn-px: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: var(--btn-py) var(--btn-px);
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease),
              color 0.16s var(--ease);
}

/* Primary - solid green */
.btn-primary{
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.btn-primary:hover{
  background: var(--accent-dim);
  border-color: var(--accent-dim);
}

/* Pro - green outline on a tinted fill, so it reads as an offer, not a
   secondary link. Deliberately loud next to the solid green primary. */
.btn-pro{
  border-color: var(--accent);
  border-width: 2px;
  color: var(--accent);
  background: var(--accent-wash);
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(142, 212, 79, 0.18);
}

.btn-pro:hover{
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: none;
}

/* Ghost / outline */
.btn-ghost,
.btn-outline{
  border-color: var(--border-str);
  color: var(--text-dim);
  background: transparent;
}

.btn-ghost:hover,
.btn-outline:hover{
  color: var(--text);
  border-color: var(--text-mut);
  background: var(--bg-soft);
}

.btn-lg{ --btn-py: 14px; --btn-px: 28px; font-size: 15px; border-radius: 11px; }
.btn-sm{ --btn-py: 8px;  --btn-px: 14px; font-size: 12.5px; border-radius: 8px; }

/* Legacy hook kept so old markup never falls back to raw `lime` */
.btn-extragreen{ background: var(--accent); }

/* ---------- Hero ------------------------------------------------------ */
.hero{
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(56px, 9vw, 96px) var(--gutter) clamp(36px, 5vw, 56px);
  text-align: center;
}

.hero-badge{
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px 7px 12px;
  margin: 0 0 24px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-badge .dot{
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.hero h1{
  font-size: clamp(38px, 6vw, 62px);
  margin: 0 0 20px;
  letter-spacing: -0.035em;
}

.accent-text{ color: var(--accent); }

.hero p{
  color: var(--text-dim);
  font-size: clamp(16px, 1.6vw, 18px);
  line-height: 1.7;
  margin: 0 auto;
  max-width: 62ch;
}

.hero-actions{
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 32px;
}

/* Small stat / trust strip under the hero */
.hero-facts{
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 36px;
  color: var(--text-mut);
  font-size: 13px;
}

.hero-facts span{ display: inline-flex; align-items: center; gap: 8px; }

.hero-facts span::before{
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-mut);
}

/* ---------- Layout / section headings --------------------------------- */
main{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px var(--gutter) 90px;
}

.section-title{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: clamp(36px, 5vw, 64px) 0 clamp(24px, 3.5vw, 40px);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.section-title h2{
  font-size: clamp(24px, 3vw, 32px);
  margin: 0;
}

.section-title span{
  color: var(--text-mut);
  font-size: 13.5px;
}

/* ---------- App rows (alternating, one per row) ------------------------ */
.app-rows{
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 1.8vw, 20px);
}

/* One fixed artwork track so the icon stays compact and identical on both
   sides of a mirrored row. */
.app-row{
  --art: clamp(104px, 15vw, 168px);
  display: grid;
  grid-template-columns: var(--art) minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
  padding: clamp(16px, 2vw, 24px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.app-row:hover{
  border-color: var(--border-str);
  background: var(--bg-card-2);
}

/* Mirror every second row: image right, text left.
   The track widths are flipped too, so the artwork keeps the exact same
   size on both sides and every row stays the same height. */
.app-row:nth-child(even){
  grid-template-columns: minmax(0, 1fr) var(--art);
}

.app-row:nth-child(even) .app-visual{ order: 2; }
.app-row:nth-child(even) .app-body{ order: 1; }

/* --- visual side --- */
.app-visual{ position: relative; }

.app-icon{
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-str);
  background: var(--bg-elev);
  transition: border-color 0.2s var(--ease);
}

.app-icon img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-row:hover .app-icon{ border-color: var(--accent-line); }

/* Index number, sits over the corner of the artwork */
.app-index{
  position: absolute;
  z-index: 2;
  top: -9px;
  left: -8px;
  min-width: 34px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.app-row:nth-child(even) .app-index{ left: auto; right: -8px; }

/* --- text side --- */
.app-body{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
}

.app-kicker{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text-mut);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.app-kicker::before{
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.app-body h3{
  margin: 0;
  font-size: clamp(18px, 1.9vw, 22px);
}

.app-desc{
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
  max-width: 62ch;
}

.app-meta{ display: contents; }

.app-actions{
  display: flex;
  align-items: stretch;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.app-actions .btn{ --btn-py: 9px; --btn-px: 16px; font-size: 13px; }

.privacy-link{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.16s var(--ease), background 0.16s var(--ease),
              border-color 0.16s var(--ease);
}

.privacy-link:hover{
  color: var(--accent);
  background: var(--accent-wash);
  border-color: var(--accent-line);
}

/* Row of pill links under an app (details / templates / privacy) */
.app-privacy{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

a.app-icon{ display: block; }

.app-body h3 a:hover{ color: var(--accent); }

/* Small label next to an app name, e.g. "18+" or "New" */
.app-badge{
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-str);
  background: var(--bg-soft);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ---------- Contact --------------------------------------------------- */
.contact{
  margin-top: clamp(48px, 7vw, 84px);
  text-align: center;
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: clamp(40px, 5.5vw, 64px) 24px;
  background: var(--bg-card);
}

.contact h2{
  margin: 0 0 12px;
  font-size: clamp(24px, 3.2vw, 32px);
}

.contact p{
  color: var(--text-dim);
  margin: 0 auto 26px;
  font-size: 15.5px;
  line-height: 1.7;
  max-width: 52ch;
}

/* ---------- Privacy popup --------------------------------------------- */
.modal-backdrop{
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 11, 12, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
}

.modal-backdrop[hidden]{ display: none; }

.modal{
  background: var(--bg-elev);
  border: 1px solid var(--border-str);
  border-radius: var(--radius);
  width: 100%;
  max-width: 760px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.modal-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.modal-head h2{ margin: 0; font-size: 17.5px; }

.modal-close{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 36px;
  height: 36px;
  border-radius: 9px;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease), background 0.16s var(--ease);
}

.modal-close:hover{
  color: var(--accent-ink);
  border-color: var(--accent);
  background: var(--accent);
}

.modal-body{
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.75;
  word-wrap: break-word;
  scrollbar-color: var(--border-str) transparent;
}

.modal-body a{ color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* Formatting for the fetched per-app privacy.html content */
.modal-body h1, .modal-body h2, .modal-body h3, .modal-body h4{
  color: var(--text);
  margin: 26px 0 10px;
}

.modal-body h1{ font-size: 20px; margin-top: 0; }
.modal-body h2{ font-size: 17px; }
.modal-body h3{ font-size: 15px; }
.modal-body h4{ font-size: 14px; }

.modal-body p, .modal-body ul, .modal-body ol{ margin: 0 0 14px; }
.modal-body li{ margin-bottom: 7px; }
.modal-body strong{ color: var(--text); }
.modal-body address{ font-style: normal; }
.modal-body img{ max-width: 100%; height: auto; }
.modal-body hr{ border: 0; border-top: 1px solid var(--border); margin: 24px 0; }

.modal-body code{
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--accent);
  word-break: break-word;
}

.modal-body .meta{ color: var(--text-mut); }

.modal-body .card{
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin: 0 0 16px;
}

.modal-body table{
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px;
  font-size: 13.5px;
}

.modal-body th, .modal-body td{
  border: 1px solid var(--border);
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
}

.modal-body th{ color: var(--text); background: var(--bg-soft); }

body.modal-open{ overflow: hidden; }

/* ---------- Legal pages (Impressum / Privacy) ------------------------- */
.legal{
  max-width: 840px;
  margin: 0 auto;
  padding: clamp(40px, 6vw, 64px) var(--gutter) 90px;
  line-height: 1.75;
}

.legal h1{
  font-size: clamp(30px, 4.2vw, 42px);
  margin: 0 0 10px;
}

.legal .updated{
  color: var(--text-mut);
  font-size: 13px;
  margin: 0 0 38px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.legal h2{
  font-size: clamp(19px, 2.2vw, 23px);
  margin: 44px 0 14px;
  padding-left: 15px;
  border-left: 3px solid var(--accent);
}

.legal h3{ font-size: 17px; margin: 30px 0 8px; color: var(--text); }
.legal h4{ font-size: 15px; margin: 24px 0 6px; color: var(--text); }

.legal p, .legal ul, .legal ol{ color: var(--text-dim); font-size: 15.5px; margin: 0 0 15px; }
.legal li{ margin-bottom: 9px; }
.legal strong{ color: var(--text); }

.legal a{
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.legal a:hover{ color: var(--text); }

.legal .card{
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 0 0 16px;
}

.legal .card p{ margin: 0; color: var(--text); }

/* Tables, code and quotes inside policies (e.g. the per-app privacy.html) */
.legal table{
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--text-dim);
}

.legal th, .legal td{
  border: 1px solid var(--border);
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
}

.legal th{ color: var(--text); background: var(--bg-soft); }

.legal code{
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--accent);
  overflow-wrap: anywhere;
}

.legal blockquote{ margin: 0 0 16px; padding-left: 16px; border-left: 3px solid var(--border-str); }
.legal hr{ border: 0; border-top: 1px solid var(--border); margin: 28px 0; }

/* ---------- App page (/{app}/) and template page ---------------------- */
.app-hero{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(36px, 6vw, 64px) var(--gutter) clamp(12px, 2vw, 20px);
  display: grid;
  grid-template-columns: clamp(110px, 16vw, 180px) minmax(0, 1fr);
  gap: clamp(20px, 3.5vw, 44px);
  align-items: center;
}

.app-hero-icon{
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-str);
  background: var(--bg-elev);
}

.app-hero-icon img{ width: 100%; height: 100%; object-fit: cover; display: block; }

.app-hero-body{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.app-hero-body h1{
  margin: 0;
  font-size: clamp(30px, 4.6vw, 48px);
  letter-spacing: -0.03em;
}

.app-hero-body h1 .app-badge{ font-size: 13px; padding: 3px 10px; }

.app-hero-desc{
  margin: 0;
  color: var(--text-dim);
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.7;
  max-width: 64ch;
}

.app-hero-compact{ grid-template-columns: clamp(80px, 11vw, 120px) minmax(0, 1fr); }
.app-hero-compact .app-hero-body h1{ font-size: clamp(26px, 3.8vw, 40px); }

.app-page{ padding-top: 0; }

.app-section{ margin-top: clamp(28px, 4vw, 48px); }
.app-section .section-title{ margin-top: 0; }

/* Screenshots: one scrolling row, every image the same height */
.shots{
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 12px;
  scrollbar-color: var(--border-str) transparent;
}

.shot{
  flex: 0 0 auto;
  scroll-snap-align: start;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-str);
  background: var(--bg-elev);
  transition: border-color 0.2s var(--ease);
}

.shot:hover{ border-color: var(--accent-line); }

.shot img{
  display: block;
  height: clamp(260px, 42vw, 440px);
  width: auto;
  max-width: none;
}

/* Rich text from the backend (app description, template intro) */
.prose{
  color: var(--text-dim);
  font-size: 15.5px;
  line-height: 1.75;
  max-width: 78ch;
}

.prose > :first-child{ margin-top: 0; }
.prose > :last-child{ margin-bottom: 0; }
.prose h1, .prose h2, .prose h3, .prose h4{ color: var(--text); margin: 28px 0 10px; }
.prose h1{ font-size: 26px; }
.prose h2{ font-size: 21px; }
.prose h3{ font-size: 17px; }
.prose p, .prose ul, .prose ol{ margin: 0 0 14px; }
.prose li{ margin-bottom: 7px; }
.prose strong{ color: var(--text); }
.prose a{ color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose img{ max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.prose hr{ border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
.prose blockquote{ margin: 0 0 14px; padding-left: 16px; border-left: 3px solid var(--accent); }
.prose table{ width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 14px; }
.prose th, .prose td{ border: 1px solid var(--border); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose th{ color: var(--text); background: var(--bg-soft); }
.prose code{
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--accent);
}

.prose-intro{ font-size: 15px; margin: 0 0 22px; }
.app-hero-body .prose-intro{ margin: 0; }

/* Template download cards */
.file-cards{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.file-card{
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.file-card:hover{ border-color: var(--border-str); background: var(--bg-card-2); }

.file-preview{
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.file-preview img{ width: 100%; height: 100%; object-fit: cover; display: block; }

.file-ext{
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent);
  padding: 8px 14px;
  border: 1px solid var(--accent-line);
  border-radius: 9px;
  background: var(--accent-wash);
  word-break: break-all;
}

.file-body{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px 18px 18px;
  flex: 1;
}

.file-body h3{ margin: 0; font-size: 16.5px; }
.file-body p{ margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.6; }
.file-body .file-meta{ color: var(--text-mut); font-size: 12.5px; margin-top: auto; padding-top: 4px; word-break: break-all; }

/* Privacy hint box on the app page */
.info-box{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 20px 24px;
}

.info-box h2{ margin: 0 0 6px; font-size: 18px; }
.info-box p{ margin: 0; color: var(--text-dim); font-size: 14.5px; }

.back-link{ margin: clamp(32px, 5vw, 56px) 0 0; font-size: 14px; }
.back-link a{ color: var(--text-dim); }
.back-link a:hover{ color: var(--accent); }

/* ---------- Screenshot viewer ----------------------------------------- */
.lightbox{
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(10, 11, 12, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 64px;
}

.lightbox[hidden]{ display: none; }

.lightbox-figure{
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lightbox-figure img{
  max-width: 100%;
  max-height: calc(92vh - 40px);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

.lightbox-figure figcaption{ color: var(--text-dim); font-size: 14px; text-align: center; }

.lightbox-btn{
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border-str);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.lightbox-btn:hover{ background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.lightbox-btn[hidden]{ display: none; }
.lightbox-close{ top: 16px; right: 16px; font-size: 17px; }
.lightbox-prev{ left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox-next{ right: 12px; top: 50%; transform: translateY(-50%); }

/* ---------- Footer ---------------------------------------------------- */
footer.site-footer{
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 36px var(--edge);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--text-mut);
  font-size: 13px;
}

footer .footer-links{ display: flex; gap: 8px; flex-wrap: wrap; }

footer .footer-links a{
  padding: 6px 12px;
  border-radius: 7px;
  transition: color 0.16s var(--ease), background 0.16s var(--ease);
}

footer .footer-links a:hover{
  color: var(--text);
  background: var(--bg-soft);
}

/* ---------- Responsive ------------------------------------------------ */
@media (max-width: 760px){
  /* The even-row rule above is more specific than a bare `.app-row`,
     so it has to be repeated here to be overridden. */
  .app-row,
  .app-row:nth-child(even){
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    text-align: left;
  }

  /* Artwork always on top when stacked, whatever the row order is.
     Left aligned so it shares the text column's edge. */
  .app-row .app-visual,
  .app-row:nth-child(even) .app-visual{
    order: 1;
    width: min(100%, 132px);
    margin-inline: 0;
  }

  .app-row .app-body,
  .app-row:nth-child(even) .app-body{ order: 2; }

  .app-index,
  .app-row:nth-child(even) .app-index{
    top: -10px;
    left: -8px;
    right: auto;
  }
}

@media (max-width: 640px){
  header.site-header{ padding-block: 12px; gap: 10px; }
  .brand{ font-size: 17px; }
  .brand img{ width: 32px; height: 32px; }

  nav.top-nav{ gap: 2px; font-size: 13px; }
  nav.top-nav a{ padding: 7px 9px; }
  nav.top-nav a.btn{ padding: 9px 14px; }

  .hero{ padding-top: 44px; }
  .hero-actions .btn{ flex: 1 1 100%; }

  main{ padding-bottom: 64px; }

  .app-row{ padding: 18px; border-radius: var(--radius); }
  .app-actions{ width: 100%; }
  .app-actions .btn{ flex: 1 1 auto; }

  .modal{ max-height: 90vh; }
  .modal-body{ padding: 18px; }

  .legal table{ display: block; overflow-x: auto; }

  .app-hero{ grid-template-columns: minmax(0, 1fr); padding-top: 32px; }
  .app-hero-icon{ width: 112px; }
  .app-hero .app-actions .btn{ flex: 1 1 auto; }
  .shot img{ height: 300px; }
  .lightbox{ padding: 64px 8px; }
  .lightbox-prev, .lightbox-next{ top: auto; bottom: 14px; transform: none; }

  footer.site-footer{ justify-content: center; text-align: center; }
}

/* ---------- Motion & print preferences -------------------------------- */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }

  *, *::before, *::after{
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print{
  body{ background: #fff; color: #000; }
  header.site-header, footer.site-footer, .modal-backdrop, .lightbox{ display: none; }
  .legal p, .legal ul, .legal ol, .legal a{ color: #000; }
}
