/* ============================================================
   Innersanctum Tech, site styles.
   All color lives in the tokens below. Pages and rules use the
   semantic tokens only, so a brand change is a one-line edit here.
   Source of truth: innersanctumtech-business, brand/IST-Design-System.
   Logo colors (#30206A, #D8B86C) are logo-only and never used here.
   ============================================================ */

/* Self-hosted brand fonts (SIL OFL) */
@font-face { font-family: 'Marcellus'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/Marcellus-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 300 900; font-display: swap; src: url('/fonts/Figtree-Variable.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 300 700; font-display: swap; src: url('/fonts/CormorantGaramond-Variable.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 300 700; font-display: swap; src: url('/fonts/CormorantGaramond-Italic-Variable.woff2') format('woff2'); }

/* ---------- 1. Brand palette (raw values, never used directly in rules) ---------- */
:root {
  --ist-paper: #FCFBF9;
  --ist-white: #FFFFFF;
  --ist-ink: #17151F;
  --ist-black: #0B0A0E;
  --ist-stone: #5C5868;       /* 6.7:1 on paper */
  --ist-slate: #8B8798;       /* metadata only */
  --ist-silver: #C4C6CF;
  --ist-line: #ECE9E3;

  --ist-gold: #B98A2F;        /* on paper 3.0:1: large text and ornaments; on night 5.2:1 */
  --ist-gold-deep: #8F6A1F;   /* dark gold, 4.8:1 on paper: text, links, buttons on light */
  --ist-gold-light: #C29A3D;  /* gold hover on dark */
  --ist-violet: #453997;      /* structure on light */

  /* Night: the dark surface */
  --ist-night: #231947;
  --ist-night-deep: #130E27;
  --ist-night-raised: #2D2257;
  --ist-violet-on-dark: #8B7BD8;
  --ist-moon: #C9C3DE;
  --ist-haze: #A39CC0;

  --ist-accent-geometria: #2F8F86;
  --ist-accent-love: #B0476A;

  --serif: 'Marcellus', Georgia, serif;
  --sans: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --quote: 'Cormorant Garamond', Georgia, serif;
}

/* ---------- 2. Theme: white and dark gold (default) ----------
   Dark gold #8F6A1F is 4.8:1 on paper, so it carries headings, links and
   buttons at any size. Bright gold #B98A2F stays for lines and ornaments. */
:root {
  --bg: var(--ist-paper);
  --bg-raised: var(--ist-white);
  --line: var(--ist-line);
  --text: var(--ist-ink);
  --heading: var(--ist-gold-deep);
  --muted: var(--ist-stone);
  --faint: var(--ist-stone);
  --signal: var(--ist-gold);            /* lines, borders, ornaments */
  --link: var(--ist-gold-deep);
  --link-hover: var(--ist-ink);
  --button-bg: var(--ist-gold-deep);    /* white text 4.9:1 */
  --button-bg-hover: var(--ist-ink);
  --button-text: var(--ist-white);
  --structure: var(--ist-violet);
  --bg-footer: transparent;
  --focus: var(--ist-gold-deep);
}

/* ---------- 3. Theme: night violet dark (decided 2026-10-13) ----------
   Mirrors innersanctumtech-business brand/IST-Design-System/tokens/colors.css.
   Use with <html data-theme="dark"> or on any section. */
[data-theme="dark"] {
  --bg: var(--ist-night);
  --bg-raised: var(--ist-night-raised);
  --bg-footer: var(--ist-night-deep);
  --line: rgba(255, 255, 255, 0.12);
  --text: var(--ist-paper);             /* 15.6:1 */
  --heading: var(--ist-paper);
  --muted: var(--ist-moon);             /* 9.5:1 */
  --faint: var(--ist-haze);             /* 6.2:1 */
  --signal: var(--ist-gold);            /* 5.2:1 */
  --link: var(--ist-gold);
  --link-hover: var(--ist-gold-light);  /* 6.1:1 */
  --button-bg: var(--ist-gold);
  --button-bg-hover: var(--ist-gold-light);
  --button-text: var(--ist-night);      /* 5.2:1 */
  --structure: var(--ist-violet-on-dark);
  --focus: var(--ist-violet-on-dark);
}

/* ---------- Logo (IST Logo Classic v1.0, from innersanctumtech-business) ---------- */
.hero-mark { display: block; width: 140px; height: 140px; margin: 0 auto 24px; }
.logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }

/* ---------- Dark theme page background (decided 2026-10-13) ----------
   One diagonal gradient across the whole page, #130E27 to #2D2257.
   Header, hero and footer stay transparent so there are no seams. */
[data-theme="dark"] body {
  background: linear-gradient(140deg, var(--ist-night-deep) 0%, var(--ist-night-raised) 100%) no-repeat;
  background-size: 100% 100%;
  background-attachment: scroll;
}
[data-theme="dark"] .site-header,
[data-theme="dark"] .site-footer { background: transparent; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0; margin-left: 4px;
  background: transparent; border: 1px solid var(--line); border-radius: 50%;
  color: var(--muted); cursor: pointer;
  transition: color 300ms ease-in-out, border-color 300ms ease-in-out;
}
.theme-toggle:hover { color: var(--link); border-color: var(--structure); }
.theme-toggle svg { width: 19px; height: 19px; display: block; }
/* The icon shows the theme you are switching TO, not the current one. */
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* ---------- Base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: var(--sans);
  font-weight: 300;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--link); transition: color 300ms ease-in-out; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 20px; }
.prose { max-width: 720px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; padding-top: 16px; padding-bottom: 16px;
}
.brand {
  font-family: var(--serif); color: var(--heading); text-decoration: none;
  letter-spacing: 0.15em; text-transform: uppercase; font-size: 1.05rem;
  display: inline-flex; align-items: center; gap: 10px;
}
.brand-mark { width: 30px; height: 30px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: 0.85rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--link); }

main { flex: 1; padding: 48px 0 64px; }

/* Typography */
h1, h2, h3 { font-family: var(--serif); font-weight: 400; color: var(--heading); line-height: 1.3; }
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); letter-spacing: 0.06em; margin-bottom: 12px; }
h2 { font-size: 1.4rem; margin: 40px 0 12px; }
h3 { font-size: 1.1rem; margin: 24px 0 8px; }
p, li { color: var(--text); margin-bottom: 12px; }
ul, ol { padding-left: 22px; margin-bottom: 16px; }
.lead { font-size: 1.35rem; color: var(--muted); font-style: italic; font-family: var(--quote); }
.meta { color: var(--faint); font-size: 0.9rem; margin-bottom: 28px; }

/* Hero */
.hero { text-align: center; padding: 40px 0 24px; }
.hero svg { width: 140px; height: 140px; margin-bottom: 24px; color: var(--signal); }
.hero h1 { text-transform: uppercase; letter-spacing: 0.15em; }
.tagline { letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); font-size: 0.9rem; font-weight: 500; margin-bottom: 24px; }
.divider { width: 60px; height: 1px; background: linear-gradient(90deg, transparent, var(--signal), transparent); margin: 0 auto 24px; }
.hero .lead { max-width: 560px; margin: 0 auto; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 20px; }
.card {
  background: var(--bg-raised); border: 1px solid var(--line); border-top: 3px solid var(--signal);
  border-radius: 8px; padding: 24px;
}
.card h3 { margin-top: 0; }
.badge {
  display: inline-block; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; color: var(--muted); margin: 0 6px 10px 0;
}
.badge.live { color: var(--text); border-color: var(--structure); }
.button {
  display: inline-block; background: var(--button-bg); color: var(--button-text); text-decoration: none;
  font-family: inherit; padding: 8px 18px; line-height: 1.3; border-radius: 40px; font-weight: 500; font-size: 0.9rem; border: 0; cursor: pointer;
  transition: background 300ms ease-in-out, color 300ms ease-in-out;
}
.button:hover { background: var(--button-bg-hover); color: var(--button-text); }
.button.ghost { background: transparent; color: var(--link); border: 1px solid var(--link); }
.button.ghost:hover { background: var(--button-bg); color: var(--button-text); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Contact block */
.contact-box {
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: 8px; padding: 20px 24px; margin: 20px 0;
}
.contact-box p { margin-bottom: 6px; }

/* FAQ */
details { border-bottom: 1px solid var(--line); padding: 14px 0; }
summary { cursor: pointer; color: var(--heading); font-family: var(--serif); font-size: 1.05rem; }
details p { margin: 10px 0 0; }

/* Form */
form { display: grid; gap: 14px; margin-top: 16px; }
label { display: grid; gap: 6px; font-size: 0.9rem; color: var(--muted); }
input, textarea {
  font: inherit; color: var(--text); background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: 6px; padding: 10px 12px; width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
textarea { min-height: 140px; resize: vertical; }
.form-note { font-size: 0.85rem; color: var(--faint); }

/* Footer */
.site-footer { background: var(--bg-footer); border-top: 1px solid var(--line); padding: 28px 0 36px; font-size: 0.88rem; color: var(--faint); }
.site-footer p { color: var(--faint); margin-bottom: 6px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 12px; }
.site-footer .footer-social { gap: 6px; margin: -4px 0 12px -8px; }
.footer-social a { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; color: var(--faint); transition: color 0.2s ease; }
.footer-social a:hover { color: var(--link); }
.footer-social a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.footer-social svg { display: block; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--link); }

/* Company details shown as an image so bots cannot scrape them */
.details-img { display: block; width: 100%; max-width: 400px; height: auto; margin: 20px 0; border-radius: 8px; }
.footer-img { display: block; width: 100%; max-width: 400px; height: auto; margin: 4px 0; }
.hp { position: absolute; left: -9999px; }

/* Theme-matched image pairs (contact details) */
.theme-dark-only { display: none; }
[data-theme="dark"] .theme-light-only { display: none; }
[data-theme="dark"] .theme-dark-only { display: block; }
.gs-doc .faq-item { border-bottom: 1px solid var(--line); padding: 14px 0; }
.gs-doc .faq-item strong { color: var(--heading); font-family: var(--serif); font-weight: 400; font-size: 1.05rem; }
.gs-doc .faq-item p { margin: 8px 0 0; }
.gs-doc .contact { margin-top: 24px; }
