:root { color-scheme: light; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 "Segoe UI", system-ui, sans-serif;
}
a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; }
.skip {
  position: absolute; left: 12px; top: -40px; background: var(--paper); color: var(--ink);
  padding: 8px 12px; z-index: 5;
}
.skip:focus { top: 12px; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.site-header { background: var(--nav); color: #fff; position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
html { scroll-padding-top: 96px; }
[id] { scroll-margin-top: 96px; }
.site-header a { color: #fff; text-decoration: none; }
.bar {
  width: min(1100px, calc(100% - 28px));
  margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px;
}
.brand { font-family: var(--display); font-size: 22px; letter-spacing: 0.01em; }
.nav-button {
  display: none; border: 1px solid rgba(255,255,255,.35); padding: 6px 10px; border-radius: 8px; cursor: pointer;
}
.nav-links { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.nav-links a { padding: 8px 2px; border-bottom: 2px solid transparent; }
.nav-links a[aria-current="page"], .nav-links a:hover { border-bottom-color: var(--accent); color: var(--accent); }
details.sub { position: relative; }
details.sub summary { cursor: pointer; list-style: none; padding: 8px 0; }
details.sub summary::-webkit-details-marker { display: none; }
details.sub[open] { background: rgba(0,0,0,.18); padding: 0 8px 8px; border-radius: 8px; }
details.sub a { display: block; padding: 4px 0; }
.banner { width: min(1100px, calc(100% - 28px)); margin: 18px auto 0; }
.banner img { width: 100%; max-height: 320px; object-fit: cover; border-radius: 14px; display: block; }
main { width: min(1100px, calc(100% - 28px)); margin: 18px auto 40px; }
article {
  background: var(--paper); color: var(--ink);
  border-radius: 16px; padding: 28px 28px 36px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}
article h1, article h2, article h3 { font-family: var(--display); line-height: 1.25; font-weight: 600; }
article h1 { font-size: clamp(32px, 4vw, 46px); margin: 0 0 12px; }
article h2 { font-size: 28px; margin: 1.4em 0 .4em; }
article h3 { font-size: 22px; margin: 1.2em 0 .3em; }
article p { margin: 0 0 1em; }
.prose { max-width: 72ch; }
.prose a, .prose p, .prose li { overflow-wrap: anywhere; }
.prose figure { display: block; width: fit-content; max-width: 100%; margin: 12px 0 16px; }
.prose figcaption { font-size: 14px; color: var(--muted); }
.prose.gallery figure { display: inline-block; width: min(240px, 100%); margin: 8px 12px 12px 0; vertical-align: top; }
.prose img { border-radius: 10px; background: rgba(255,255,255,.55); }
.download { padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--ink) 15%, transparent); border-radius: 10px; }
.download .meta { color: var(--muted); margin-left: 8px; }
.paypal { margin: 12px 0 20px; }
.contact-form { display: grid; gap: 12px; max-width: 36rem; margin-top: 8px; }
.contact-form label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.contact-form input, .contact-form textarea {
  font: inherit; color: var(--ink); background: color-mix(in srgb, var(--paper) 85%, white);
  border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); border-radius: 10px; padding: 8px 10px;
}
.contact-form button {
  width: fit-content; background: var(--nav); color: white; border: 0; border-radius: 10px;
  padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer;
}
.hp { position: absolute; left: -9999px; }
.form-note { min-height: 1.2em; }
.site-footer { width: min(1100px, calc(100% - 28px)); margin: 0 auto 28px; color: var(--muted); font-size: 14px; }
@media (max-width: 800px) {
  .nav-button { display: inline-block; }
  .nav-links { display: none; width: min(1100px, calc(100% - 28px)); margin: 0 auto 12px; flex-direction: column; align-items: flex-start; }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .site-header { max-height: 100vh; max-height: 100dvh; overflow-y: auto; }
  html { scroll-padding-top: 76px; }
  [id] { scroll-margin-top: 76px; }
  article { padding: 20px 16px 28px; }
  .prose.gallery figure { width: calc(50% - 12px); }
}
.sub { position: relative; display: flex; align-items: center; gap: 2px; }
.sub-toggle {
  display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; margin: 0;
  background: transparent; color: inherit; border: 1px solid transparent; border-radius: 6px; cursor: pointer;
}
.sub-toggle:hover, .sub-toggle:focus-visible { border-color: rgba(255,255,255,.45); }
.sub-toggle:focus-visible, .sub-menu a:focus-visible, .sub-label:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sub-toggle svg { transition: transform .15s ease; }
.sub.open .sub-toggle svg { transform: rotate(180deg); }
.sub.in-section > .sub-label { border-bottom-color: var(--accent); }
.sub-menu { display: none; }
.sub-menu a { display: block; padding: 7px 14px; border-bottom: 0; white-space: nowrap; }
.sub-menu a:hover, .sub-menu a[aria-current="page"] { background: rgba(0,0,0,.22); }
.sub.open > .sub-menu { display: block; }
@media (min-width: 801px) {
  .sub-menu {
    position: absolute; top: 100%; left: 0; z-index: 50; min-width: 230px; max-height: 70vh; overflow-y: auto;
    padding: 6px 0; background: var(--nav); border: 1px solid rgba(255,255,255,.18); border-top: 3px solid var(--accent);
    border-radius: 0 0 10px 10px; box-shadow: 0 14px 30px rgba(0,0,0,.28);
  }
}
@media (min-width: 801px) and (hover: hover) {
  .sub:hover > .sub-menu { display: block; }
}
@media (max-width: 800px) {
  .sub { flex-wrap: wrap; width: 100%; }
  .sub-toggle { width: 40px; height: 40px; margin-left: 4px; border-color: rgba(255,255,255,.3); }
  .sub-menu { flex-basis: 100%; margin: 4px 0 8px; padding: 4px 0 4px 10px; border-left: 3px solid var(--accent); }
  .sub-menu a { white-space: normal; padding: 8px 10px; }
}

/* ---- Torah Codes (matches RayEl): professional, bold, phone-friendly layout ---- */
body {
  font-size: 18px; line-height: 1.7;
  background: linear-gradient(180deg, #F6ECD6 0, #EFE2C2 700px) no-repeat, #EFE2C2;
}
a:hover { color: #5E0C18; }
::selection { background: #E9D48A; color: #2B1D14; }
.skip { top: -80px; }
.skip:focus { top: 12px; }

/* Header: bold brand bar, nav aligned with the content column */
.site-header { border-bottom: 4px solid var(--accent); background: linear-gradient(180deg, #8B1E2D 0%, #7A1020 100%); }
.brand { color: #F3DC8A; }
.site-header a.brand { color: #F3DC8A; }
.bar, .nav-links, main, .site-footer { width: min(1000px, calc(100% - 28px)); }
.brand { font-weight: 700; font-size: 26px; letter-spacing: .06em; text-transform: uppercase; }
@media (min-width: 801px) {
  .nav-links { margin: 0 auto; padding-bottom: 6px; gap: 6px 22px; }
}
.nav-links a { font-weight: 600; letter-spacing: .02em; }
.nav-links a[aria-current="page"], .nav-links a:hover { color: #F3DC8A; border-bottom-color: var(--accent); }

/* Article and headings */
article {
  padding: 36px 40px 44px; border: 1px solid #D9C27A; border-top: 6px solid var(--nav);
  box-shadow: 0 0 0 1px #FBF5E6 inset, 0 12px 32px rgba(70,40,10,.12);
}
.prose hr { border: 0; border-top: 2px solid var(--accent); }
article h1 { font-weight: 700; letter-spacing: .01em; color: var(--nav); }
article h2 {
  font-weight: 700; color: var(--nav); text-transform: none; letter-spacing: .01em;
  font-size: clamp(24px, 3.2vw, 30px); margin: 1.6em 0 .55em; padding-bottom: .3em; border-bottom: 3px solid var(--accent);
}
article h4 { font-family: var(--display); font-weight: 700; color: var(--nav); font-size: 19px; }
article h3 { font-weight: 700; color: var(--nav); text-transform: none; font-size: clamp(20px, 2.4vw, 23px); }

/* Images: always the full width of the content column */
.prose { max-width: none; }
.prose figure,
.prose.gallery figure { display: block; width: 100%; max-width: 100%; margin: 20px 0 26px; }
.prose figure img,
.prose figure a img { display: block; width: 100%; height: auto; border-radius: 10px; }
.prose figure a { display: block; }

/* Responsive 16:9 YouTube embeds */
.video-title { margin: 1.6em 0 .5em; }
.video {
  position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 12px 0 28px;
  background: #000; border-radius: 12px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Links page: one link per row */
.link-list { list-style: none; padding: 0; margin: 20px 0 28px; display: grid; gap: 14px; }
.link-list li {
  margin: 0; padding: 14px 18px; background: #FFFBF1; border: 1px solid #D9C27A;
  border-left: 5px solid var(--nav); border-radius: 10px;
}
.link-list .label {
  display: block; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.link-list a { font-weight: 600; font-size: 18px; word-break: break-word; }

/* Contacts page: one person per row, image beside details */
.contacts { display: grid; gap: 22px; margin: 20px 0 28px; }
.contact {
  display: grid; grid-template-columns: 220px 1fr; gap: 26px; align-items: center;
  padding: 20px; border: 1px solid #D9C27A;
  border-left: 6px solid var(--nav); border-radius: 14px; background: #FFFBF1;
}
.contact img { display: block; width: 100%; height: auto; border-radius: 10px; }
.contact h3 { margin: 0 0 2px; font-size: 24px; }
.contact .role { margin: 0 0 12px; font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.contact-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.contact-links li { display: flex; align-items: center; gap: 10px; margin: 0; min-width: 0; }
.contact-links svg { flex: none; width: 22px; height: 22px; fill: var(--nav); }
.contact-links .k { flex: none; width: 96px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.contact-links a, .contact-links span.v { overflow-wrap: anywhere; min-width: 0; }
.contacts-note { font-style: italic; color: var(--muted); }

@media (max-width: 800px) {
  body { font-size: 17px; }
  article { padding: 22px 16px 30px; }
  .brand { font-size: 22px; }
  .contact { grid-template-columns: 1fr; gap: 14px; padding: 16px; }
  .contact img { max-width: 320px; margin: 0 auto; }
  .contact-links li { flex-wrap: wrap; row-gap: 2px; }
  .contact-links .k { width: auto; }
  .contact-links a { flex-basis: 100%; padding-left: 32px; }
}

/* Gold highlights */
.link-list li:hover, .contact:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(122,16,32,.12); }
.prose figure img { box-shadow: 0 6px 20px rgba(70,40,10,.15); }
.contact-form button:hover { background: #5E0C18; box-shadow: 0 0 0 2px var(--accent); }
.site-footer { color: #4A3826; border-top: 2px solid var(--accent); padding-top: 10px; }

/* Store: Starlink promo (image left, text right; stacks on mobile) */
.promo { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; margin: 24px 0 8px; }
.prose .promo figure.promo-media { margin: 0; }
.promo-text p { margin: 0 0 1em; }
.promo-cta {
  display: inline-block; background: var(--nav); color: #fff; text-decoration: none; font-weight: 700;
  padding: 10px 18px; border-radius: 10px; border: 2px solid var(--accent);
}
.promo-cta:hover { background: #5E0C18; color: #F3DC8A; }
.prose hr.gold-rule {
  border: 0; height: 3px; margin: 34px 0 6px;
  background: linear-gradient(90deg, transparent, var(--accent) 12%, #B8902A 50%, var(--accent) 88%, transparent);
}
@media (max-width: 800px) {
  .promo { grid-template-columns: 1fr; gap: 16px; }
}

/* Torah Codes extras */
.prose blockquote {
  margin: 14px 0; padding: 12px 18px; background: #FFFBF1;
  border-left: 5px solid var(--accent); border-radius: 0 10px 10px 0; color: var(--ink);
}
.prose blockquote p { margin: 0; }
.prose blockquote em { font-style: normal; font-weight: 700; color: var(--nav); margin-right: 4px; }
.callout {
  margin: 24px 0 8px; padding: 18px 22px; background: #FFFBF1;
  border: 2px solid var(--accent); border-left: 8px solid var(--nav); border-radius: 12px;
}
.callout p { margin: 0 0 .6em; }
.callout p:last-child { margin-bottom: 0; }
.callout-title { font-family: var(--display); font-weight: 700; font-size: 21px; color: var(--nav); }
.callout-cta {
  display: inline-block; background: var(--nav); color: #fff; text-decoration: none; font-weight: 700;
  padding: 10px 18px; border-radius: 10px; border: 2px solid var(--accent);
}
.callout-cta:hover { background: #5E0C18; color: #F3DC8A; }
.prose figure.portrait { max-width: 400px; }
.prose ul { padding-left: 1.3em; }
.prose ul li { margin: 0 0 .5em; }
.prose ul.link-list { padding-left: 0; }
.code-find {
  margin: 12px 0 18px; padding: 14px 20px; text-align: center; background: #FFFBF1;
  border: 1px solid #D9C27A; border-top: 4px solid var(--accent); border-radius: 10px;
}
.code-find p { margin: 0; }
.code-find .he { font-size: 26px; font-weight: 700; color: var(--nav); line-height: 1.4; }
.code-find .en { font-family: var(--display); font-size: 20px; font-weight: 700; color: var(--ink); }
.link-list .link-url { display: block; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
/* Bible Code App feature (front page) and showcase (researcher page) */
.app-feature {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 26px; align-items: center;
  margin: 22px 0 10px; padding: 22px; border-radius: 14px;
  background: linear-gradient(135deg, #7A1020 0%, #5E0C18 100%); color: #FBF5E6;
  border: 3px solid var(--accent); box-shadow: 0 12px 30px rgba(94,12,24,.28);
}
.app-feature-media img { display: block; width: 100%; height: auto; border-radius: 10px; border: 2px solid var(--accent); }
.app-feature-text p { margin: 0 0 .7em; }
.app-feature-kicker { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #F3DC8A; }
.app-feature-title { font-family: var(--display); font-size: clamp(22px, 2.6vw, 28px); font-weight: 700; line-height: 1.25; }
.app-feature .app-feature-title { color: #fff; }
.btn-app {
  display: inline-block; background: linear-gradient(180deg, #E3C15A, #C9A227); color: #3A0A12 !important;
  font-weight: 800; text-decoration: none; padding: 12px 22px; border-radius: 10px; border: 2px solid #8B6A12;
  box-shadow: 0 4px 14px rgba(0,0,0,.25); letter-spacing: .01em;
}
.btn-app:hover { background: linear-gradient(180deg, #F3DC8A, #D9B23A); color: #3A0A12 !important; }
.btn-more { color: #F3DC8A !important; font-weight: 700; margin-left: 14px; }
.app-showcase { margin-top: 8px; }
.app-head {
  display: grid; grid-template-columns: 120px 1fr; gap: 22px; align-items: center; padding: 20px;
  background: linear-gradient(135deg, #7A1020 0%, #5E0C18 100%); color: #FBF5E6; border: 3px solid var(--accent); border-radius: 14px;
}
.app-head img { width: 120px; height: auto; border-radius: 22px; }
.app-head p { margin: 0 0 .6em; } .app-head .app-feature-title { color: #fff; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 20px 0; }
.feature { background: #FFFBF1; border: 1px solid #D9C27A; border-top: 4px solid var(--nav); border-radius: 12px; padding: 14px 16px; }
.feature h3 { margin: 0 0 .3em; font-size: 19px; }
.feature p { margin: 0; font-size: 16px; }
.shot-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 12px 0; }
.prose .shot-grid figure { margin: 0; }
.prose .shot-grid figcaption { margin-top: 6px; font-weight: 700; color: var(--nav); font-size: 14px; }
.shot-credit { font-size: 14px; color: var(--muted); }
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 14px 0 18px; }
.price { background: #FFFBF1; border: 2px solid #D9C27A; border-radius: 12px; padding: 16px; }
.price p { margin: 0 0 .5em; font-size: 16px; }
.price-name { font-weight: 800; color: var(--nav); letter-spacing: .02em; }
.price-amt { font-family: var(--display); font-size: 32px; font-weight: 700; color: var(--ink); }
.price-amt span { font-size: 16px; color: var(--muted); }
#history { scroll-margin-top: 16px; }
@media (max-width: 800px) {
  .app-feature { grid-template-columns: 1fr; padding: 16px; }
  .app-head { grid-template-columns: 1fr; text-align: left; }
  .shot-grid { grid-template-columns: 1fr; }
  .btn-more { display: inline-block; margin: 10px 0 0; }
}
/* Dropdown menu, parchment/gold/red */
.sub-menu a { font-weight: 600; }
.sub-menu a:hover, .sub-menu a[aria-current="page"] { color: #F3DC8A; }
@media (min-width: 801px) { .sub-menu { background: #6A0E1C; } }

/* ---- Code Library (/code-library/) ---- */
.lib-intro { font-size: 19px; }
.lib-crumb { font-size: 15px; color: var(--muted); margin-bottom: .4em; }
.lib-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin: 18px 0 8px; }
.lib-cat {
  display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: var(--paper);
  border: 1px solid #D9C27A; border-top: 4px solid var(--nav); border-radius: 10px; overflow: hidden;
  box-shadow: 0 4px 12px rgba(70,40,10,.08); transition: transform .12s ease, box-shadow .12s ease;
}
.lib-cat:hover, .lib-cat:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(70,40,10,.16); color: var(--ink); }
.lib-cat img { width: 100%; height: auto; max-height: 220px; object-fit: contain; object-position: center; border-radius: 0; background: #F4E9D0; }
.lib-cat-name { font-family: var(--display); font-weight: 700; color: var(--nav); padding: 8px 10px 0; line-height: 1.25; }
.lib-cat-count { font-size: 14px; color: var(--muted); padding: 2px 10px 10px; }
.lib-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 14px 0 6px; padding: 12px 14px; background: var(--accent-soft); border: 1px solid #D9C27A; border-radius: 10px; }
.lib-search label { font-weight: 600; color: var(--nav); }
.lib-search input { flex: 1 1 240px; font: inherit; padding: 8px 12px; border: 1px solid #C9A227; border-radius: 8px; background: #FFFDF6; color: var(--ink); }
#lib-count { font-size: 14px; color: var(--muted); }
.lib-note { font-size: 14px; color: var(--muted); }
.lib-list-cat h3 { margin: 1.1em 0 .3em; }
.lib-list-cat h3 a { text-decoration: none; }
.lib-n, .lib-g { font-size: 14px; color: var(--muted); font-weight: 400; }
.lib-list { columns: 2 260px; column-gap: 28px; margin: 0; padding-left: 1.1em; }
.lib-list li { break-inside: avoid; font-size: 16px; line-height: 1.45; margin: 0 0 4px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin: 12px 0 22px; }
.code-card { background: var(--paper); border: 1px solid #D9C27A; border-radius: 10px; padding: 10px; box-shadow: 0 4px 12px rgba(70,40,10,.08); scroll-margin-top: 16px; }
.code-card:target { outline: 3px solid var(--accent); }
.code-card > a.lib-full { display: block; }
.code-card > a.lib-full img { display: block; width: 100%; height: auto; max-width: 100%; object-fit: contain; object-position: center; border-radius: 6px; background: #F4E9D0; }
.code-card h3 { font-size: 17px; line-height: 1.3; margin: 8px 2px 2px; }
.code-card h3 a { color: var(--nav); text-decoration: none; }
.lib-variants { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.lib-variants img { width: 52px; height: 52px; object-fit: contain; object-position: center; border-radius: 4px; border: 1px solid #D9C27A; }
.lib-vn, .lib-also { font-size: 13px; color: var(--muted); margin: 4px 2px 0; }
.lib-pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 2px solid var(--accent); padding-top: 12px; margin-top: 18px; }
.lib-box { max-width: min(96vw, 1200px); max-height: 94vh; padding: 12px; border: 3px solid var(--accent); border-radius: 12px; background: var(--paper); }
.lib-box::backdrop { background: rgba(30,15,5,.75); }
.lib-box img { display: block; max-width: 100%; max-height: 78vh; margin: 0 auto; border-radius: 6px; }
.lib-cap { text-align: center; font-family: var(--display); font-weight: 700; color: var(--nav); margin: 8px 0 2px; }
.lib-open { display: block; text-align: center; font-size: 14px; }
.lib-close { position: absolute; top: 6px; right: 8px; font-size: 26px; line-height: 1; background: var(--nav); color: #fff; border: 0; border-radius: 50%; width: 36px; height: 36px; cursor: pointer; }
.lib-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin: 14px 0 24px; }
@media (max-width: 800px) {
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .code-card > a.lib-full img { height: auto; }
  .lib-cats { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
