/* churchcreative.dev: blueprint paper, ink and safety orange, in light and dark.
   Helvetica for type, IBM Plex Mono (self-hosted) for the dev details, and faded NIV scripture
   on the paper behind the hero (a baked texture: no live filters). One left edge for all text. */

@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/plex-mono-500.woff2") format("woff2"); }

:root {
  --paper: #eae0cb;
  --paper-2: #f4eee2;
  --ink: #181512;
  --ink-2: rgba(24, 21, 18, 0.68);
  --ink-3: rgba(24, 21, 18, 0.44);
  --line: rgba(24, 21, 18, 0.14);
  --guide: rgba(24, 21, 18, 0.035);
  --orange: #ff5b1f;
  --shadow: #181512;
  --tag-bg: #181512;
  --tag-fg: #f4eee2;
  --script: rgba(40, 32, 22, 0.17);
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.32  0 0 0 0 0.26  0 0 0 0 0.18  0 0 0 0.42 -0.08'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --grid: 112px;
  --pad: 18px;
  --r-card: 22px;
  --r-shot: 13px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
/* dark: OLED-friendly true black (pixels off) with cream ink; cards barely lifted */
:root[data-theme="dark"] {
  --paper: #000;
  --paper-2: #0b0a09;
  --ink: #ede4d1;
  --ink-2: rgba(237, 228, 209, 0.68);
  --ink-3: rgba(237, 228, 209, 0.42);
  --line: rgba(237, 228, 209, 0.13);
  --guide: rgba(237, 228, 209, 0.035);
  --orange: #ff6b33;
  --shadow: #000;
  --tag-bg: #ede4d1;
  --tag-fg: #13110e;
  --script: rgba(237, 222, 190, 0.11);
  --grain: none; /* OLED: no lit grain pixels on the black */
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #000; --paper-2: #0b0a09; --ink: #ede4d1; --ink-2: rgba(237, 228, 209, 0.68); --ink-3: rgba(237, 228, 209, 0.42);
    --line: rgba(237, 228, 209, 0.13); --guide: rgba(237, 228, 209, 0.035); --orange: #ff6b33; --shadow: #000;
    --tag-bg: #ede4d1; --tag-fg: #13110e; --script: rgba(237, 222, 190, 0.11); --grain: none;
    color-scheme: dark;
  }
}
@media (max-width: 759px) { :root { --grid: 96px; --pad: 14px; --r-card: 18px; --r-shot: 11px; } }

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; overflow-x: hidden; overflow-x: clip;
  background-color: var(--paper);
  background-image: var(--grain), linear-gradient(to right, var(--guide) 1px, transparent 1px), linear-gradient(to bottom, var(--guide) 1px, transparent 1px);
  background-size: 220px 220px, var(--grid) var(--grid), var(--grid) var(--grid);
}
body { margin: 0; min-height: 100vh; color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
::selection { background: var(--orange); color: #fff; }
.wrap { position: relative; z-index: 2; max-width: 1240px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
@media (min-width: 760px) { .wrap { padding-left: 40px; padding-right: 40px; } }
.mono { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.02em; }

/* ---------- scripture on the paper behind the hero: one baked, weathered texture used as a mask ---------- */
.scripture {
  position: absolute; z-index: 1; left: 0; right: 0; top: 70px; height: 980px; pointer-events: none;
  background-color: var(--script);
  -webkit-mask: url("/img/scripture.webp") center top / 1600px 980px no-repeat;
  mask: url("/img/scripture.webp") center top / 1600px 980px no-repeat;
}
@media (max-width: 759px) { .scripture { top: 60px; height: 760px; -webkit-mask-size: 1241px 760px; mask-size: 1241px 760px; } }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0 14px; border-bottom: 1.5px solid var(--ink); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.tld { color: var(--orange); }
.mark { width: 20px; height: 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.mark i { border-radius: 50%; background: var(--ink); transition: background-color 120ms ease; }
.mark i:nth-child(5), .mark i.hot { background: var(--orange); }

/* ---------- intro: the 3x3 mark chases from all orange to the logo, then flies into the header ---------- */
.loader {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: var(--paper); transition: background-color 300ms ease 80ms;
}
html:not(.intro) .loader:not(.is-done) { display: none; }
.loader.is-done { background-color: transparent; pointer-events: none; }
.mark--xl { width: 76px; height: 76px; gap: 8px; transition: transform 420ms cubic-bezier(.7, 0, .2, 1); }
.loader .mark i { background: var(--orange); transition: background-color 70ms ease; }
.loader .mark i.ink { background: var(--ink); }
.loader .mark i:nth-child(5) { background: var(--orange); }
/* while the intro plays, hold the page's entrance and hide the header mark it will land on */
.intro .rise { animation-play-state: paused; }
.intro .top .mark, .landing .top .mark { visibility: hidden; }
.top__right { display: flex; align-items: center; gap: 14px; }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 22%, transparent); }
.theme {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--ink); background: var(--paper-2); color: var(--ink); transition: transform 200ms var(--ease), background-color 300ms ease;
}
.theme:hover { transform: rotate(-20deg); }
.theme:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.theme svg { width: 16px; height: 16px; }
.theme .moon { display: none; }
:root[data-theme="dark"] .theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme .sun { display: none; } :root:not([data-theme="light"]) .theme .moon { display: block; } }

/* ---------- hero ---------- */
.hero { padding-top: 64px; padding-bottom: 72px; }
@media (min-width: 960px) { .hero { padding-top: 104px; padding-bottom: 120px; } }
.prompt { margin: 0 0 26px; color: var(--ink-2); }
.prompt .p { color: var(--orange); }
.caret { display: inline-block; width: 0.6em; height: 1.1em; vertical-align: -0.2em; margin-left: 2px; background: var(--ink); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
h1 { margin: 0; font-weight: 700; font-size: clamp(52px, 8.2vw, 124px); line-height: 0.98; letter-spacing: -0.035em; }
h1 .line { display: block; }
h1 .it { color: var(--ink-3); font-weight: 400; }
.verb { position: relative; z-index: 0; display: inline-block; cursor: default; transition: color 250ms ease; }
.verb svg { position: absolute; left: -2%; bottom: -0.04em; width: 104%; height: 0.14em; overflow: visible; pointer-events: none; z-index: -1; }
.verb svg path { fill: none; stroke: var(--orange); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; transition: stroke-dashoffset 600ms var(--ease), opacity 0s linear 600ms; }
.verb.is-lit svg path { stroke-dashoffset: 0; opacity: 1; transition: stroke-dashoffset 600ms var(--ease), opacity 0s; }
.verb.is-lit { color: var(--orange); }
.lede { font-size: clamp(18px, 1.55vw, 21px); line-height: 1.5; color: var(--ink-2); max-width: 40ch; margin: 34px 0 0; letter-spacing: -0.005em; }
.lede strong { color: var(--ink); font-weight: 600; }

/* ---------- apps ---------- */
.section-label { display: flex; align-items: center; gap: 14px; margin: 0 0 24px; }
.section-label::after { content: ""; flex: 1; border-top: 1.5px dashed var(--ink); opacity: 0.4; }
.grid { display: grid; gap: 28px; grid-template-columns: 1fr; padding-bottom: 88px; }
@media (min-width: 760px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.sheet {
  position: relative; display: flex; flex-direction: column; text-decoration: none; outline: none;
  background: var(--paper-2) var(--grain); background-size: 220px 220px;
  border: 1.5px solid var(--ink); border-radius: var(--r-card); box-shadow: 6px 6px 0 var(--orange);
  transition: transform 150ms ease-out, box-shadow 150ms ease-out;
}
.sheet:hover, .sheet.is-lit { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--orange); }
.sheet:active { transform: translate(1px, 1px); box-shadow: 4px 4px 0 var(--orange); transition-duration: 80ms; }
.sheet:focus-visible { box-shadow: 8px 8px 0 var(--orange), 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 14px var(--pad); border-bottom: 1.5px dashed var(--line); }
.word { color: #fff; background: var(--orange); padding: 3px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; }
.key { font-family: var(--mono); font-size: 11px; color: var(--ink-2); min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; border: 1.5px solid var(--ink-3); border-radius: 7px; }

.shot { position: relative; margin: var(--pad) var(--pad) 0; aspect-ratio: 16 / 11; overflow: hidden; border: 1.5px solid var(--ink); border-radius: var(--r-shot); background: var(--paper); }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; object-position: top center; }

.sheet__body { padding: 20px var(--pad) 0; flex: 1; }
.sheet__body h2 { margin: 0; font-weight: 700; font-size: clamp(23px, 2vw, 27px); letter-spacing: -0.025em; line-height: 1.1; }
.desc { margin: 8px 0 0; font-size: 15.5px; line-height: 1.5; color: var(--ink-2); }
.sheet__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; padding: 14px var(--pad); border-top: 1.5px dashed var(--line); }
.host { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.host .sub { color: var(--orange); }
.go { display: inline-block; color: var(--orange); transition: transform 150ms ease-out; }
.sheet:hover .go, .sheet.is-lit .go { transform: translateX(3px); }

/* ---------- footer ---------- */
footer.wrap { padding-bottom: 40px; }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-top: 16px; border-top: 1.5px solid var(--ink); color: var(--ink-2); }
.foot-row strong { color: var(--ink); font-weight: 600; }
.notice { margin: 18px 0 0; max-width: 72ch; font-size: 11.5px; line-height: 1.55; color: var(--ink-3); }

/* ---------- phones: the sheets become a compact list ---------- */
@media (max-width: 759px) {
  .grid { gap: 14px; padding-bottom: 64px; }
  .sheet { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; grid-template-areas: "shot head go" "shot body go"; column-gap: 14px; padding: 12px; box-shadow: 4px 4px 0 var(--orange); }
  .sheet:hover, .sheet.is-lit { transform: none; box-shadow: 4px 4px 0 var(--orange); }
  .sheet:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--orange); }
  .sheet__head { grid-area: head; padding: 0; border: 0; }
  .sheet__head .key { display: none; }
  .shot-wrap { grid-area: shot; align-self: center; }
  .shot { margin: 0; width: 72px; aspect-ratio: 1; }
  .sheet__body { grid-area: body; padding: 6px 0 0; }
  .sheet__body h2 { font-size: 19px; }
  .desc { font-size: 13.5px; line-height: 1.4; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .sheet__foot { grid-area: go; margin: 0; padding: 0; border: 0; align-self: center; }
  .sheet__foot .host { display: none; }
  .top .status { display: none; }
}

/* ---------- entrance ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rise { animation: rise 0.45s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 35ms); }
@media (prefers-reduced-motion: reduce) {
  .rise, .caret { animation: none; }
  .sheet, .verb svg path, .go, .theme { transition: none !important; }
}
