/* ============================================================
   Overton Forge — styles.css  (Warm Heritage palette)
   Derived from the actual logo: iron-oxide flame on coal-black,
   cream serif wordmark. Heritage workshop with modern restraint.

   The earlier cool/streaming palette is preserved in
   styles.recaptr-palette.css for reuse on Recaptr's eventual site.
   ============================================================ */

/* -------------------- Tokens -------------------- */

:root {
  /* Brand palette — derived from the logo */
  --of-coal:        #15110E;   /* near-black with warm undertone, primary bg */
  --of-coal-2:      #1F1A17;   /* surface */
  --of-coal-3:      #2A2420;   /* elevated surface */

  --of-ember:        #B83228;  /* flame red — primary brand mark, primary CTA */
  --of-ember-bright: #D44B3E;  /* hover / hot state */
  --of-ember-glow:   #E89A3F;  /* amber glow — "live"/"active" semantic */
  --of-copper:       #9C7A3A;  /* burnished mid-tone, third card-tint */

  --of-cream:       #E8DFCE;   /* high-contrast text / headings */
  --of-cream-warm:  #C8BAA0;   /* body text */
  --of-cream-dim:   rgba(232, 223, 206, 0.50);
  --of-cream-muted: rgba(232, 223, 206, 0.70);

  --of-iron:        #4A3F36;   /* borders, dividers */

  /* Recaptr cool-palette tokens (Phase 6.7) — used by the
     data-palette="recaptr" project card to island its own
     micro-environment without affecting the rest of the site.
     Mirrors the tokens that ship in styles.recaptr-palette.css
     and in Recaptr's own Brand.swift. */
  --rc-graphite:    #1B1F23;
  --rc-signal:      #8DFCB7;
  --rc-violet:      #A179F2;
  --rc-restore:     #5EB2D6;

  /* Functional aliases */
  --color-bg:        var(--of-coal);
  --color-surface:   var(--of-coal-2);
  --color-surface-2: var(--of-coal-3);
  --color-text:      var(--of-cream-warm);
  --color-text-bright: var(--of-cream);
  --color-text-muted: var(--of-cream-muted);
  --color-text-dim:   var(--of-cream-dim);

  --color-border:        rgba(74, 63, 54, 0.55);
  --color-border-strong: rgba(200, 186, 160, 0.18);
  --color-border-ember:  rgba(184, 50, 40, 0.45);

  /* Per-card tint maps */
  --tint-ember:   var(--of-ember);
  --tint-amber:   var(--of-ember-glow);
  --tint-copper:  var(--of-copper);

  /* Gradients */
  --gradient-fire: linear-gradient(
    135deg,
    var(--of-ember) 0%,
    var(--of-ember-bright) 48%,
    var(--of-ember-glow) 100%
  );
  --gradient-hero-glow: radial-gradient(
    ellipse 80% 55% at 50% 0%,
    rgba(184, 50, 40, 0.20) 0%,
    rgba(232, 154, 63, 0.10) 35%,
    transparent 70%
  );

  /* Typography */
  --font-heading: "Fraunces", "Source Serif 4", "PT Serif", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  /* Layout */
  --max-width: 1140px;
  --section-pad-y: clamp(80px, 11vw, 140px);
  --container-pad-x: clamp(24px, 5vw, 40px);

  /* Radii */
  --radius-card: 14px;       /* tighter — heritage feel, less SaaS */
  --radius-chip: 999px;

  /* Shadows */
  --shadow-card: 0 24px 80px rgba(0, 0, 0, 0.55);
  --shadow-card-hover: 0 28px 90px rgba(0, 0, 0, 0.70), 0 0 0 1px var(--color-border-ember);
}

/* -------------------- Reset -------------------- */

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

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

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

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

a {
  color: var(--of-ember-bright);
  text-decoration: none;
}

a:hover {
  color: var(--of-ember-glow);
}

ul {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
}

::selection {
  background: var(--of-ember);
  color: var(--of-cream);
}

/* -------------------- Typography -------------------- */

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-text-bright);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.1;
  font-feature-settings: "ss01", "ss02";
}

h2 {
  font-size: clamp(2rem, 4.2vw, 3rem);
  margin-top: 0.5rem;
  font-weight: 600;
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
}

h4 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

p {
  font-size: 1rem;
  color: var(--color-text);
}

.lede {
  font-size: 1.2rem;
  color: var(--color-text-bright);
  line-height: 1.55;
}

.mono-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.10em;
  color: var(--color-text);
  text-transform: uppercase;
}

.mono-tag.dim {
  color: var(--color-text-dim);
}

.eyebrow {
  margin-bottom: 1.2rem;
}

/* -------------------- Layout primitives -------------------- */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--container-pad-x);
  padding-right: var(--container-pad-x);
}

.section {
  padding: var(--section-pad-y) 0;
  position: relative;
}

.section-header {
  margin-bottom: clamp(36px, 5vw, 60px);
}

.section-header .mono-tag {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--of-ember);
}

/* -------------------- Status strip -------------------- */

.status-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px var(--container-pad-x);
  border-bottom: 1px solid var(--color-border);
  background: rgba(21, 17, 14, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.10em;
  color: var(--color-text-dim);
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--of-ember-glow);
  box-shadow: 0 0 12px var(--of-ember-glow);
}

.status-dot.pulse {
  animation: dotPulse 2.4s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.9);
  }
}

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

.hero {
  position: relative;
  padding: clamp(120px, 18vh, 200px) 0 clamp(80px, 12vh, 140px);
  overflow: hidden;
  isolation: isolate;
}

.hero-grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0.30;
  background-image:
    linear-gradient(to right, rgba(200, 186, 160, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(200, 186, 160, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black 0%, transparent 75%);
}

.hero-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--gradient-hero-glow);
  pointer-events: none;
}

.hero-inner {
  max-width: 880px;
}

.hero-headline {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 6.5vw, 4.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 1.4rem;
  color: var(--color-text-bright);
  font-feature-settings: "ss01", "ss02";
}

.hero-accent {
  background: var(--gradient-fire);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subhead {
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  color: var(--color-text);
  max-width: 640px;
  margin-bottom: 2.4rem;
  line-height: 1.55;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  border: 1px solid transparent;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--of-ember);
  color: var(--of-cream);
  border-color: var(--of-ember);
}

.btn-primary:hover {
  background: var(--of-ember-bright);
  border-color: var(--of-ember-bright);
  color: var(--of-cream);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text-bright);
  border-color: var(--color-border-strong);
}

.btn-secondary:hover {
  border-color: var(--of-ember);
  color: var(--of-ember-glow);
}

.btn-arrow {
  font-size: 0.85em;
}

/* -------------------- About -------------------- */

.prose {
  max-width: 760px;
}

.prose p + p {
  margin-top: 1.2rem;
}

/* -------------------- Projects -------------------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(20px, 2.5vw, 28px);
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
  isolation: isolate;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, var(--card-tint, transparent) 0%, transparent 40%);
  opacity: 0.07;
  pointer-events: none;
}

/* Updated tint mapping for warm palette.
   ember = primary lead (ChainKeeper)
   amber = live/media accent (Back-Up Drive)
   copper = burnished mid-tone (Recaptr, Liquid Depths) */
.project-card[data-tint="restore"] { --card-tint: var(--tint-ember); }
.project-card[data-tint="signal"]  { --card-tint: var(--tint-amber); }
.project-card[data-tint="violet"]  { --card-tint: var(--tint-copper); }

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--card-tint, var(--color-border-strong));
}

/* -------------------- Recaptr palette accent (Phase 6.7) -------------------- */
/*
   Recaptr's brand palette is cool (graphite + signal-green + violet +
   restore-blue) — the inverse of the warm Overton Forge palette. The
   Recaptr card carries data-palette="recaptr" and gets a localized
   palette swap: the gradient fade-in uses cool tokens, the hover border
   lights up signal-green instead of ember-red, and the link text reads
   in restore-blue. Everything else on the page stays in the warm
   heritage palette — a single-card preview of the broader
   "hover-shifts-ambient-palette" effect coming in a later pass. */

.project-card[data-palette="recaptr"]::before {
  background: linear-gradient(
    180deg,
    rgba(94, 178, 214, 0.28) 0%,
    rgba(161, 121, 242, 0.16) 35%,
    transparent 70%
  );
  opacity: 0.55;
}

.project-card[data-palette="recaptr"]:hover {
  border-color: rgba(141, 252, 183, 0.55);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.70),
              0 0 0 1px rgba(141, 252, 183, 0.45),
              0 0 60px -10px rgba(141, 252, 183, 0.30);
}

.project-card[data-palette="recaptr"] .project-link {
  color: var(--rc-restore);
}

.project-card[data-palette="recaptr"] .project-link:hover {
  color: var(--rc-signal);
}

.project-card[data-palette="recaptr"] .project-link .arrow {
  color: inherit;
}

.project-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.project-name {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--color-text-bright);
  letter-spacing: -0.015em;
}

.project-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text);
  margin-bottom: 18px;
  flex-grow: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 22px;
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-chip);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.project-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 0;
  border-top: 1px solid var(--color-border);
  margin-top: auto;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--card-tint, var(--of-ember-bright));
  transition: color 0.15s ease, transform 0.15s ease;
}

.project-link:hover {
  color: var(--of-ember-glow);
}

.project-link:hover .arrow {
  transform: translateX(4px);
}

.project-link .arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.project-link.disabled {
  color: var(--color-text-dim);
  cursor: default;
  pointer-events: none;
}

/* -------------------- Status chips -------------------- */

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-chip);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-text-muted);
}

.status-chip::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}

.status-chip.status-active {
  color: var(--of-ember-glow);
  border-color: rgba(232, 154, 63, 0.35);
  background: rgba(232, 154, 63, 0.07);
}

.status-chip.status-active::before {
  background: var(--of-ember-glow);
  box-shadow: 0 0 8px var(--of-ember-glow);
  animation: dotPulse 2.4s ease-in-out infinite;
}

.status-chip.status-planning {
  color: var(--of-cream-warm);
  border-color: rgba(200, 186, 160, 0.22);
  background: rgba(200, 186, 160, 0.04);
}

.status-chip.status-paused {
  color: var(--color-text-muted);
}

/* Phase 6.7 — Beta status chip uses Recaptr signal-green. Carried in
   the OF stylesheet so any project can pick it up without needing the
   recaptr-palette stylesheet loaded. */
.status-chip.status-beta {
  color: var(--rc-signal);
  border-color: rgba(141, 252, 183, 0.40);
  background: rgba(141, 252, 183, 0.08);
}

.status-chip.status-beta::before {
  background: var(--rc-signal);
  box-shadow: 0 0 10px rgba(141, 252, 183, 0.75);
  animation: dotPulse 2.4s ease-in-out infinite;
}

/* -------------------- Philosophy -------------------- */

.principles {
  display: grid;
  gap: clamp(20px, 2vw, 28px);
  max-width: 820px;
}

.principles li {
  display: flex;
  gap: 22px;
  padding: 22px 0;
  border-top: 1px solid var(--color-border);
}

.principles li:first-child {
  border-top: none;
  padding-top: 0;
}

.principle-num {
  flex-shrink: 0;
  color: var(--of-ember);
  font-size: 0.78rem;
  padding-top: 4px;
  min-width: 30px;
}

.principles h4 {
  margin-bottom: 6px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.15rem;
}

.principles p {
  color: var(--color-text-muted);
}

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

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.contact-card {
  position: relative;
  padding: 28px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  display: block;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.contact-card:hover:not(.disabled) {
  border-color: var(--of-ember);
  transform: translateY(-2px);
}

.contact-card .mono-tag {
  display: block;
  margin-bottom: 10px;
}

.contact-card h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text-bright);
}

.contact-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}

.contact-arrow {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 1.2rem;
  color: var(--color-text-dim);
}

.contact-card.disabled {
  opacity: 0.55;
  cursor: default;
}

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

.footer {
  padding: 60px 0 36px;
  margin-top: 80px;
  border-top: 1px solid var(--color-border);
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.30) 100%);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 40px;
}

.wordmark {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  color: var(--color-text-bright);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.footer-tagline {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  max-width: 360px;
  font-style: italic;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  font-size: 0.95rem;
}

.footer-nav a {
  color: var(--color-text);
  transition: color 0.15s ease;
}

.footer-nav a:hover {
  color: var(--of-ember-glow);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

/* -------------------- Responsive -------------------- */

@media (max-width: 720px) {
  .hero-headline {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .status-strip {
    gap: 8px;
    font-size: 0.62rem;
  }

  .principles li {
    flex-direction: column;
    gap: 8px;
  }

  .footer-grid {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: stretch;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .status-dot.pulse,
  .status-chip.status-active::before,
  .status-chip.status-beta::before {
    animation: none;
  }
}

:focus-visible {
  outline: 2px solid var(--of-ember-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

.btn:focus-visible {
  outline-offset: 2px;
}
