/* ==========================================================================
   Obsidian Custom Technologies — obsidianct.com
   Light, minimal, black-on-white to match the logo. One accent: steel blue.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-alt: #f6f6f4;
  --text: #16181a;
  --text-soft: #4b5157;
  --line: #e4e4e0;
  --accent: #37536d;      /* restrained steel blue — links, buttons, badges */
  --accent-dark: #2a4156;
  --btn-text: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.94);
  --input-border: #c9c9c4;
  --tile-bg: #fdfdfe;     /* product logo tile */
  --success: #226231;
  --error: #b3382c;
  --radius: 10px;
  --font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

/* Dark theme, gray accents. Active while <html data-theme="dark">;
   remove that attribute to return to the light theme above. */
html[data-theme="dark"] {
  --bg: #101215;
  --bg-alt: #16191d;
  --text: #e7e9eb;
  --text-soft: #a4abb2;
  --line: #262b30;
  --accent: #aeb7bf;      /* gray accent — links, badges */
  --accent-dark: #d4dade;
  --btn-text: #14161a;
  --header-bg: rgba(16, 18, 21, 0.92);
  --input-border: #3a4046;
  --tile-bg: #0c0d10;     /* matches the dark product art backgrounds */
  --success: #7fc48f;
  --error: #e07a6e;
}

/* Theme-paired images: each spot has a light and a dark version */
.theme-dark-img { display: none; }
html[data-theme="dark"] .theme-dark-img { display: block; }
html[data-theme="dark"] .theme-light-img { display: none; }

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem; /* keep anchors clear of the sticky header */
}

body {
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5.5vw, 3.25rem); font-weight: 700; letter-spacing: -0.015em; }

/* Technical, aerospace-style section headings */
h2 {
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 1.25rem;
}
h3 { font-size: 1.3rem; }

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

p + p { margin-top: 0.85rem; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }

.container {
  width: min(100% - 2.5rem, 68rem);
  margin-inline: auto;
}
.container.narrow { max-width: 42rem; }

section { padding: 4rem 0; }
.section-alt { background: var(--bg-alt); }

/* --- Accessibility helpers ------------------------------------------------ */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* --- Header ---------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.25s ease;
}

/* Gains a soft shadow once the page is scrolled (added by script.js) */
.site-header.scrolled {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.brand img { width: 28px; height: 28px; }
.brand-sub {
  font-weight: 400;
  color: var(--text-soft);
  letter-spacing: 0.06em;
  font-size: 0.85em;
}

/* Hide the longer name on small phones so the header never wraps */
@media (max-width: 430px) {
  .brand-sub { display: none; }
}

/* --- Buttons ---------------------------------------------------------------- */

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--btn-text);
  text-decoration: none;
  border: none;
  border-radius: 3px;
  font-family: inherit;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--accent-dark); color: var(--btn-text); }

.btn-small { padding: 0.5rem 1rem; font-size: 0.8rem; }
.btn-large { padding: 0.9rem 2.1rem; font-size: 0.92rem; }

/* --- Hero ------------------------------------------------------------------- */

.hero {
  position: relative;
  text-align: center;
  padding: 3.5rem 0 5.5rem;
  min-height: calc(100svh - 3.9rem); /* fills the first screen, minus header */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Faint topographic contours behind the hero (dark theme) */
html[data-theme="dark"] .hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/assets/topo.png") 38% 50% / cover no-repeat;
  opacity: 0.09;
  pointer-events: none;
}
/* On landscape screens the pattern is scaled up and offset so no contour
   ring lands around the scroll cue — tune the two % values to shift it */
@media (min-aspect-ratio: 5/4) {
  html[data-theme="dark"] .hero::before {
    background-size: 118% auto;
    background-position: 20% 20%;
  }
}
/* Soft vignette so the contours fade toward the content */
html[data-theme="dark"] .hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 55% at 50% 45%,
              var(--bg) 0%, transparent 100%);
  opacity: 0.55;
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }

/* Scroll cue: quiet chevron at the bottom of the hero */
.scroll-cue {
  position: absolute;
  bottom: 1.75rem;
  left: 50%;
  translate: -50% 0;
  z-index: 1;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scroll-cue::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-right: 2px solid var(--text-soft);
  border-bottom: 2px solid var(--text-soft);
  transform: rotate(45deg);
}
@media (prefers-reduced-motion: no-preference) {
  .scroll-cue::before { animation: cue-drift 2.6s ease-in-out infinite; }
  @keyframes cue-drift {
    0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 0.7; }
    50% { transform: rotate(45deg) translate(4px, 4px); opacity: 1; }
  }
}

.hero-logo {
  width: min(30rem, 82vw);
  margin: 0 auto 1.5rem;
}

.hero h1 {
  max-width: 46rem;
  margin: 0 auto 1rem;
}

.subhead {
  max-width: 38rem;
  margin: 0 auto 2rem;
  font-size: 1.15rem;
  color: var(--text-soft);
}

/* --- Products ---------------------------------------------------------------- */

.products h2 { text-align: center; margin-bottom: 2.5rem; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 2rem;
  max-width: 58rem;
  margin-inline: auto;
}

.product-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--input-border);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
}

.product-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tile-bg);
  border-bottom: 1px solid var(--line);
  height: 11rem;
  padding: 1.5rem;
}
.product-logo img { max-height: 100%; width: auto; }

/* BoomBook art has a pure-black background baked in — tile matches it */
.product-logo-dark { background: #000; }
.product-logo-dark img { max-height: 9rem; }

/* Super Signup icon green, matched exactly so the tile fills seamlessly */
.product-logo-green { background: #46b46a; }
.product-logo-green img { max-height: 9rem; }

.product-body { padding: 1.5rem; }

.product-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.24rem 0.6rem;
  border-radius: 3px;
}
.badge-live { background: var(--accent); color: var(--btn-text); }
.badge-soon {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--line);
}

/* --- Contact form -------------------------------------------------------------- */

.contact { position: relative; }
html[data-theme="dark"] .contact::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/assets/topo.png") center / cover no-repeat;
  opacity: 0.05;
  pointer-events: none;
}
.contact .container { position: relative; z-index: 1; }

.contact p { color: var(--text-soft); }
.contact form { margin-top: 2rem; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-field { margin-bottom: 1.1rem; }

label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
  color: var(--text);
}
.req { color: var(--accent); }
.optional { font-weight: 400; color: var(--text-soft); }

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--input-border);
  border-radius: 3px;
  padding: 0.65rem 0.8rem;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(128, 140, 152, 0.25);
}

input.invalid, textarea.invalid { border-color: var(--error); }

textarea { resize: vertical; min-height: 7rem; }

/* Honeypot — visually gone, still in the DOM for bots */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.form-status {
  margin-top: 1rem;
  font-weight: 600;
  min-height: 1.5em;
}
.form-status.success { color: var(--success); }
.form-status.error { color: var(--error); }

.contact-alt {
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

/* --- Footer ------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
  background: var(--bg);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.95rem;
}
.footer-inner img { width: 36px; height: 36px; }

/* --- Scroll reveals ---------------------------------------------------------------
   Elements with [data-reveal] fade/rise in as they enter the viewport.
   Hidden state only applies when JS is running (html.js) and motion is OK. */

@media (prefers-reduced-motion: no-preference) {
  html.js [data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.65s ease, transform 0.65s ease;
    transition-delay: var(--reveal-delay, 0ms);
  }
  html.js [data-reveal].revealed {
    opacity: 1;
    transform: none;
  }
}

/* --- Motion preferences ---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
