/* =====================================================================
   Digital Sheriff Designs: the one stylesheet for the whole site.

   How it's organised (top to bottom):
     1. Fonts           which typefaces load, from our own server
     2. Colors & sizes  every color and spacing value, in one place
     3. Basics          page defaults: text, links, images
     4. Layout          the centered column, sections, grids
     5. Header & footer
     6. Building blocks buttons, labels, dividers, cards, status tags
     7. Page parts      hero, promises, project pages, gallery, FAQ
     8. Small screens   adjustments for phones

   To change a color everywhere, change it once in section 2.
   ===================================================================== */


/* ---------------------------------------------------------------------
   1. Fonts. The files live in /assets/fonts/ (all free, open-licensed).
   --------------------------------------------------------------------- */
@font-face {
  font-family: "Poiret One";            /* headings: thin 1930s Art Deco letters */
  src: url("/assets/fonts/poiret-one.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;                   /* show text right away, swap font in when loaded */
}
@font-face {
  font-family: "Josefin Sans";          /* labels, menus, buttons: geometric 1920s style */
  src: url("/assets/fonts/josefin-sans.woff2") format("woff2");
  font-weight: 100 700;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";   /* body text: designed to be easy to read */
  src: url("/assets/fonts/atkinson-hyperlegible-next.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/fonts/atkinson-hyperlegible-next-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}


/* ---------------------------------------------------------------------
   2. Colors & sizes. These are "custom properties" (variables).
      Anywhere below that says var(--gold) uses the value set here.
   --------------------------------------------------------------------- */
:root {
  /* Backgrounds: a deep green-black, like lacquer */
  --bg:        #0e1615;
  --bg-raised: #121d1c;    /* alternate sections */
  --panel:     #152221;    /* cards */

  /* Text */
  --ink:   #ede6d4;        /* main text: warm ivory */
  --ink-2: #b9b19d;        /* softer text for paragraphs */
  --ink-3: #8e8775;        /* quiet text: captions, small print */

  /* Gold, the signature color */
  --gold:       #c8a35a;
  --gold-light: #e6c983;
  --gold-dark:  #9c7a3a;
  --line:       rgba(200, 163, 90, .28);   /* thin gold lines */
  --line-soft:  rgba(200, 163, 90, .14);

  /* Each project page can set its own --accent (see the <body> tag on a
     project page). It tints the glow behind the app icon. */
  --accent: var(--gold);

  /* Typefaces */
  --font-display: "Poiret One", "Josefin Sans", sans-serif;
  --font-label:   "Josefin Sans", "Segoe UI", system-ui, sans-serif;
  --font-body:    "Atkinson Hyperlegible Next", "Segoe UI", system-ui, sans-serif;

  /* Spacing and widths */
  --page-width: 1120px;
  --gutter: 24px;          /* space at the left and right edges of the page */
  --section-gap: clamp(64px, 9vw, 112px);

  color-scheme: dark;      /* tells the browser this is a dark site (scrollbars, form fields) */
}


/* ---------------------------------------------------------------------
   3. Basics
   --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.65;
  overflow-wrap: break-word;
}

img, svg { display: block; max-width: 100%; height: auto; }

a { color: var(--gold-light); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

/* A clear gold ring shows where you are when moving around with the keyboard */
:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }

h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

/* "Skip to content" link: hidden until a keyboard user presses Tab */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  padding: 10px 16px; background: var(--gold); color: var(--bg);
  font-family: var(--font-label); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* Text that's only for screen readers */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}


/* ---------------------------------------------------------------------
   4. Layout
   --------------------------------------------------------------------- */
.wrap {
  max-width: calc(var(--page-width) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { padding: var(--section-gap) 0; }
.section--raised {
  background: var(--bg-raised);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head--center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { margin: 14px 0 16px; }
.section-head p { color: var(--ink-2); }

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6.4vw, 4.75rem);
  line-height: 1.06;
  letter-spacing: .005em;
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.2vw, 3rem);
  line-height: 1.12;
}
h3 {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 1.12rem;
  letter-spacing: .02em;
  line-height: 1.35;
}

.lead { font-size: 1.18rem; color: var(--ink-2); max-width: 46ch; }


/* ---------------------------------------------------------------------
   5. Header & footer
   --------------------------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 84px;
}

.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; }
.brand img { width: 46px; height: 46px; }
.brand-name {
  display: block; font-family: var(--font-label); font-weight: 600;
  font-size: 15px; letter-spacing: .32em; text-transform: uppercase; line-height: 1;
}
.brand-sub {
  display: block; margin-top: 7px; font-family: var(--font-label); font-weight: 400;
  font-size: 10.5px; letter-spacing: .62em; text-transform: uppercase; line-height: 1;
  color: var(--gold);
}

.site-nav ul { display: flex; gap: 30px; margin: 0; padding: 0; list-style: none; }
.site-nav a {
  font-family: var(--font-label); font-size: 13px; letter-spacing: .26em;
  text-transform: uppercase; color: var(--ink-2); text-decoration: none;
  padding: 8px 0; border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--gold-light); }
.site-nav a[aria-current="page"] { color: var(--gold-light); border-bottom-color: var(--gold); }

.site-footer { border-top: 1px solid var(--line); padding: 48px 0 40px; margin-top: var(--section-gap); }
.site-footer .wrap { display: grid; grid-template-columns: 1fr auto; gap: 28px 40px; align-items: center; }
.footer-motto {
  margin-top: 14px; font-family: var(--font-display); font-size: 1.35rem; color: var(--gold-light);
}
.footer-nav ul { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 0; padding: 0; list-style: none; }
.footer-nav a {
  font-family: var(--font-label); font-size: 12.5px; letter-spacing: .24em;
  text-transform: uppercase; color: var(--ink-2); text-decoration: none;
}
.footer-nav a:hover { color: var(--gold-light); }
.footer-small {
  grid-column: 1 / -1; padding-top: 24px; border-top: 1px solid var(--line-soft);
  font-size: 14px; color: var(--ink-3);
}


/* ---------------------------------------------------------------------
   6. Building blocks
   --------------------------------------------------------------------- */

/* Small gold label above a heading, with a short line in front of it */
.eyebrow {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-label); font-size: 12.5px; font-weight: 400;
  letter-spacing: .4em; text-transform: uppercase; color: var(--gold);
}
.eyebrow::before { content: ""; width: 34px; height: 1px; background: var(--gold); }
.section-head--center .eyebrow { justify-content: center; }
.section-head--center .eyebrow::after { content: ""; width: 34px; height: 1px; background: var(--gold); }

/* Buttons */
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 15px 26px 13px;
  font-family: var(--font-label); font-size: 13px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; text-decoration: none;
  border: 1px solid var(--gold); transition: background-color .15s, color .15s;
}
.btn--gold { background: var(--gold); color: var(--bg); }
.btn--gold:hover { background: var(--gold-light); color: var(--bg); }
.btn--ghost { background: transparent; color: var(--gold-light); }
.btn--ghost:hover { background: rgba(200, 163, 90, .12); color: var(--gold-light); }

/* Deco divider: two thin lines with a small diamond in the middle */
.deco-rule {
  display: flex; align-items: center; gap: 16px; margin: 0 auto;
  max-width: var(--page-width); color: var(--gold);
}
.deco-rule::before, .deco-rule::after {
  content: ""; flex: 1; height: 5px;
  border-top: 1px solid var(--gold); border-bottom: 1px solid var(--line);
}
.deco-rule span { width: 9px; height: 9px; background: currentColor; transform: rotate(45deg); }

/* "Work in progress" tag (also used for "Free" etc.) */
.status {
  display: inline-block; padding: 8px 14px 6px; white-space: nowrap;
  font-family: var(--font-label); font-size: 11.5px; font-weight: 600;
  letter-spacing: .26em; text-transform: uppercase;
  color: var(--gold-light); border: 1px solid var(--gold);
}

/* Deco frame: a thin border with a second, inset line, used on cards */
.frame { position: relative; background: var(--panel); border: 1px solid var(--line); }
.frame::after {
  content: ""; position: absolute; inset: 6px; pointer-events: none;
  border: 1px solid var(--line-soft);
}

/* App icons. Projects without an icon get a lettered tile instead. */
.app-icon { width: 76px; height: 76px; border-radius: 18px; flex: none; }
.app-icon--pixel { image-rendering: pixelated; }
.icon-tile {
  display: grid; place-items: center; width: 76px; height: 76px; border-radius: 18px; flex: none;
  background: var(--tile, #1f2a33); color: var(--tile-ink, var(--ink));
  font-family: var(--font-label); font-weight: 600; font-size: 24px; letter-spacing: .08em;
}


/* ---------------------------------------------------------------------
   7. Page parts
   --------------------------------------------------------------------- */

/* --- Home hero --- */
.hero { padding: clamp(56px, 8vw, 104px) 0 clamp(56px, 8vw, 96px); }
.hero .wrap { display: grid; grid-template-columns: 1.2fr .8fr; gap: 48px; align-items: center; }
.hero h1 { margin: 22px 0 26px; }
.hero .lead { margin-bottom: 34px; }
.hero-emblem { justify-self: center; width: min(100%, 400px); }

/* --- How we build (the three promises) --- */
.rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin: 0; padding: 0; list-style: none; }
.rules li { padding: 34px 30px 32px; }
.rule-num {
  display: block; margin-bottom: 18px; font-family: var(--font-display);
  font-size: 2.6rem; line-height: 1; color: var(--gold);
}
.rules h3 { margin-bottom: 10px; }
.rules p { color: var(--ink-2); font-size: 1rem; }

/* --- Project cards on the Home page --- */
.project-list { display: grid; gap: 22px; margin: 0; padding: 0; list-style: none; }
.project-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 26px; align-items: center;
  padding: 30px 32px; color: inherit; text-decoration: none;
  transition: border-color .15s, background-color .15s;
}
.project-card:hover { border-color: var(--gold); background: #182726; color: inherit; }
.project-no {
  font-family: var(--font-label); font-size: 11.5px; letter-spacing: .4em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 8px;
}
.project-card h3 {
  font-family: var(--font-display); font-weight: 400; font-size: 2.1rem;
  letter-spacing: 0; line-height: 1.1; margin-bottom: 6px;
}
.project-card p { color: var(--ink-2); font-size: 1rem; max-width: 60ch; }
.project-meta {
  display: flex; flex-direction: column; align-items: flex-end; gap: 14px;
  font-family: var(--font-label); font-size: 12px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink-3);
}
.project-meta .more { color: var(--gold-light); }

/* --- Project page hero --- */
.crumbs {
  padding-top: 28px; font-family: var(--font-label); font-size: 12px;
  letter-spacing: .24em; text-transform: uppercase; color: var(--ink-3);
}
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--gold-light); }
.crumbs span[aria-hidden] { margin: 0 10px; color: var(--gold); }

.project-hero { padding: 40px 0 clamp(56px, 7vw, 88px); }
.project-hero .wrap { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; }
.project-hero h1 { margin: 18px 0 10px; }
.project-tagline {
  font-family: var(--font-display); font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  line-height: 1.3; color: var(--gold-light); margin-bottom: 22px; max-width: 30ch;
}

/* The app icon, centered in a deco sunburst and tinted with the project's --accent */
.icon-halo { position: relative; width: 260px; aspect-ratio: 1; display: grid; place-items: center; }
.icon-halo::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--accent) 32%, transparent) 0%, transparent 62%),
    repeating-conic-gradient(from 0deg, var(--line) 0deg .6deg, transparent .6deg 7.5deg);
  -webkit-mask: radial-gradient(circle, #000 55%, transparent 71%);
          mask: radial-gradient(circle, #000 55%, transparent 71%);
}
.icon-halo::after {
  content: ""; position: absolute; inset: 14px; border-radius: 50%;
  border: 1px solid var(--line); box-shadow: 0 0 0 6px var(--bg), 0 0 0 7px var(--line-soft);
}
.icon-halo .app-icon, .icon-halo .icon-tile {
  position: relative; z-index: 1; width: 112px; height: 112px; border-radius: 26px; font-size: 34px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}

/* Box that says where the project stands (later: the download button) */
.release-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 22px;
  margin-top: 30px; padding: 22px 24px; max-width: 620px;
}
.release-box p { margin: 0; color: var(--ink-2); font-size: 1rem; flex: 1 1 260px; }
.release-box strong { color: var(--ink); }

/* Big screenshot under the project hero */
.showcase { margin: 0; }
.showcase img { width: 100%; border: 1px solid var(--line); box-shadow: 0 30px 70px rgba(0, 0, 0, .5); }
.showcase figcaption, .gallery figcaption { margin-top: 14px; font-size: 15px; color: var(--ink-3); }

/* Feature grid */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin: 0; padding: 0; list-style: none; }
.features li { padding: 30px 28px; }
.features h3 { margin-bottom: 10px; color: var(--gold-light); }
.features p { color: var(--ink-2); font-size: 1rem; }

/* "Made for" list: who a project is for, three across with thin gold rules */
.uses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 40px; margin: 0; padding: 0; list-style: none; }
.uses li { padding: 22px 0 24px; border-top: 1px solid var(--line); }
.uses h3 { color: var(--gold-light); margin-bottom: 6px; }
.uses p { color: var(--ink-2); font-size: 1rem; }

/* Screenshot gallery: click a picture to open it full size */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 34px 28px; }
.gallery figure { margin: 0; }
.gallery a { display: block; border: 1px solid var(--line); transition: border-color .15s; }
.gallery a:hover { border-color: var(--gold); }

/* "Placeholder" panel for screenshots that don't exist yet */
.placeholder {
  display: grid; place-items: center; min-height: 260px; padding: 32px; text-align: center;
  color: var(--ink-3); font-family: var(--font-label); letter-spacing: .24em;
  text-transform: uppercase; font-size: 13px;
}

/* Two-column text block */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.split .section-head { margin-bottom: 0; }
.checklist { margin: 0; padding: 0; list-style: none; }
.checklist li { position: relative; padding: 0 0 14px 30px; color: var(--ink-2); }
.checklist li::before {
  content: ""; position: absolute; left: 4px; top: .6em; width: 8px; height: 8px;
  background: var(--gold); transform: rotate(45deg);
}
.checklist strong { color: var(--ink); font-weight: 600; }

/* Questions and answers: click a question to open it (no code needed, it's built into HTML) */
.faq { max-width: 780px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 22px 40px 22px 0; position: relative;
  font-family: var(--font-label); font-weight: 600; font-size: 1.08rem; letter-spacing: .02em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-display); font-size: 1.8rem; color: var(--gold);
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--ink-2); padding: 0 0 22px; max-width: 64ch; }

/* Plain reading pages (About) */
.page-emblem { width: 240px; }
.prose { max-width: 680px; }
.prose h2 { margin: 56px 0 18px; font-size: clamp(1.9rem, 3.4vw, 2.4rem); }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--ink-2); }

/* --- Forms (the Feedback page) --- */
.form { display: grid; gap: 28px; max-width: 680px; }
.field { display: grid; gap: 9px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field-label {
  font-family: var(--font-label); font-weight: 600; font-size: 1.02rem;
  letter-spacing: .02em; color: var(--ink); padding: 0;
}
.optional { font-weight: 400; color: var(--ink-3); }
.hint { margin: 0; font-size: 15px; color: var(--ink-3); }

.input, .select, .textarea {
  width: 100%; padding: 13px 16px; border: 1px solid var(--line); border-radius: 0;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 17px;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200, 163, 90, .18);
}
.textarea { min-height: 180px; resize: vertical; line-height: 1.55; }

/* The drop-down: the browser's own arrow is swapped for a gold one */
.select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 50px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23c8a35a' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 18px center; background-size: 14px 9px;
}
.select option { background: var(--panel); color: var(--ink); }

/* "What's it about?" choices: real radio buttons, styled as tags */
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  display: inline-block; padding: 11px 16px 9px; cursor: pointer;
  border: 1px solid var(--line); color: var(--ink-2);
  font-family: var(--font-label); font-size: 14px; letter-spacing: .06em;
  transition: border-color .15s, background-color .15s, color .15s;
}
.choice span:hover { border-color: var(--gold); color: var(--ink); }
.choice input:checked + span { background: var(--gold); border-color: var(--gold); color: var(--bg); font-weight: 600; }
.choice input:focus-visible + span { outline: 2px solid var(--gold-light); outline-offset: 3px; }

/* A hidden field that only spam robots fill in */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-status { display: none; padding: 16px 18px; border: 1px solid var(--line); font-size: 1rem; }
.form-status.is-ok { display: block; border-color: #6fae7f; color: #cfe9d5; background: rgba(111, 174, 127, .08); }
.form-status.is-error { display: block; border-color: #d27b6a; color: #f3d3cb; background: rgba(210, 123, 106, .08); }
.form-note { font-size: 15px; color: var(--ink-3); max-width: 60ch; }
.btn:disabled { opacity: .6; cursor: wait; }

/* 404 page */
.notfound { min-height: 62vh; display: grid; place-items: center; text-align: center; padding: 72px 0; }
.notfound img { width: 150px; margin: 0 auto 30px; opacity: .85; }
.notfound .eyebrow { justify-content: center; }
.notfound .eyebrow::after { content: ""; width: 34px; height: 1px; background: var(--gold); }
.notfound h1 { margin: 18px 0 20px; }
.notfound p { color: var(--ink-2); margin: 0 auto 32px; max-width: 44ch; }
.notfound .btn-row { justify-content: center; }


/* ---------------------------------------------------------------------
   8. Small screens (tablets and phones)
   --------------------------------------------------------------------- */
@media (max-width: 900px) {
  .rules, .features { grid-template-columns: 1fr; }
  .uses { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; gap: 28px; }
  .project-hero .wrap { grid-template-columns: 1fr; gap: 28px; }
  .project-hero .icon-halo { order: -1; width: 200px; }
  .page-emblem { order: -1; width: 140px; }
  .project-hero .icon-halo .app-icon, .project-hero .icon-halo .icon-tile { width: 92px; height: 92px; border-radius: 22px; }
}

@media (max-width: 760px) {
  :root { --gutter: 18px; }
  body { font-size: 17px; }
  .eyebrow { letter-spacing: .24em; gap: 10px; font-size: 12px; }
  .eyebrow::before, .eyebrow::after { width: 22px !important; }

  .site-header .wrap { flex-direction: column; align-items: flex-start; gap: 12px; padding-top: 16px; padding-bottom: 12px; }
  .site-nav ul { gap: 22px; }
  .brand img { width: 40px; height: 40px; }
  .brand-name { font-size: 13px; letter-spacing: .26em; }
  .brand-sub { letter-spacing: .5em; }

  .hero .wrap { grid-template-columns: 1fr; gap: 8px; }
  .hero-emblem { order: -1; width: 170px; justify-self: start; }

  .project-card { grid-template-columns: auto 1fr; padding: 24px 22px; gap: 18px; }
  .project-card .app-icon, .project-card .icon-tile { width: 60px; height: 60px; border-radius: 14px; font-size: 19px; }
  .project-meta {
    grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: 10px 18px; letter-spacing: .14em;
  }
  .project-meta .more { margin-left: auto; }

  .gallery { grid-template-columns: 1fr; }
  .uses { grid-template-columns: 1fr; }
  .site-footer .wrap { grid-template-columns: 1fr; }
}
