/*
Theme Name: Open Intelligence Foundation
Theme URI: https://openintelligence.foundation
Author: The Open Intelligence Foundation
Author URI: https://openintelligence.foundation
Description: A minimalist, black-on-white single-page theme for The Open Intelligence Foundation, a 501(c)(3) built by and for the open source AI community. Features a slogan hero, editable social links, and a native contact form. No page builder or extra plugins required.
Version: 1.6.3
Requires at least: 6.0
Tested up to: 7.0.2
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: open-intelligence-foundation
Tags: minimalist, one-page, custom-colors, custom-logo, translation-ready, footer-widgets
*/

/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --oif-bg: #ffffff;
  --oif-fg: #000000;
  --oif-muted: #565656;
  --oif-line: #e6e6e6;
  --oif-line-strong: #111111;
  --oif-accent: #000000;
  --oif-max: 1080px;
  --oif-topbar-h: 64px;
  --oif-darkgrey: #1f1f1f;
  --oif-contact-grey: #383838;
  --oif-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --oif-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
    Helvetica, Arial, sans-serif;
}

/* ==========================================================================
   Reset / base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--oif-topbar-h);
}

body {
  margin: 0;
  background: var(--oif-bg);
  color: var(--oif-fg);
  font-family: var(--oif-font);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; }

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

.oif-container {
  width: 100%;
  max-width: var(--oif-max);
  margin: 0 auto;
  padding: 0 24px;
}

.screen-reader-text {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  width: 1px; height: 1px;
  overflow: hidden;
  white-space: nowrap;
}

.oif-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #000;
  color: #fff;
  padding: 12px 20px;
  z-index: 1000;
}
.oif-skip-link:focus { left: 8px; top: 8px; }

/* ==========================================================================
   Background canvas (animated neural net)
   ========================================================================== */
#oif-net {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.oif-page { position: relative; z-index: 1; }

/* ==========================================================================
   Announcement banner (above the top bar)
   ========================================================================== */
.oif-banner {
  display: block;
  background: var(--oif-darkgrey);
  color: #ffffff;
  text-align: center;
  text-decoration: none;
  padding: 11px 24px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: background-color 0.3s var(--oif-ease);
}
.oif-banner span { text-decoration: underline; text-underline-offset: 3px; }
.oif-banner:hover,
.oif-banner:focus-visible { background: #2b2b2b; outline: none; }

/* ==========================================================================
   Top bar / primary menu
   ========================================================================== */
.oif-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--oif-topbar-h);
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.35s var(--oif-ease), box-shadow 0.35s var(--oif-ease);
}
.oif-topbar.is-scrolled {
  border-bottom-color: var(--oif-line);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.05);
}
.oif-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 100%;
}
.oif-topbar__brand {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--oif-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55vw;
}

.oif-menu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
}
.oif-menu li { margin: 0; }
.oif-menu a {
  position: relative;
  display: inline-block;
  padding: 4px 0;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--oif-fg);
}
.oif-menu a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--oif-ease);
}
.oif-menu a:hover::after,
.oif-menu a:focus-visible::after,
.oif-menu .current-menu-item > a::after,
.oif-menu .current_page_item > a::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.oif-hero {
  min-height: calc(100vh - var(--oif-topbar-h));
  min-height: calc(100svh - var(--oif-topbar-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 96px 24px 64px;
}

.oif-hero__logo {
  margin-bottom: 28px;
  opacity: 0;
  transform: translateY(18px);
  animation: oif-rise 1s var(--oif-ease) 0.1s forwards;
}
.oif-hero__logo img { max-height: 96px; width: auto; }

.oif-hero__title {
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}
.oif-hero__title .oif-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(28px) rotate(2deg);
  animation: oif-word-in 0.9s var(--oif-ease) forwards;
}

.oif-hero__badge {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--oif-muted);
  border: 1px solid var(--oif-line);
  border-radius: 999px;
  padding: 7px 16px;
  margin-bottom: 34px;
  opacity: 0;
  transform: translateY(14px);
  animation: oif-rise 0.9s var(--oif-ease) 0.05s forwards;
}

.oif-hero__slogan {
  font-size: clamp(1.05rem, 2.4vw, 1.6rem);
  font-weight: 400;
  color: var(--oif-muted);
  max-width: 620px;
  margin: 22px auto 0;
  opacity: 0;
  transform: translateY(16px);
  animation: oif-rise 1s var(--oif-ease) 0.85s forwards;
}

/* Animated divider */
.oif-hero__rule {
  width: 0;
  height: 2px;
  background: var(--oif-fg);
  margin: 40px auto 0;
  animation: oif-rule 1.1s var(--oif-ease) 1.1s forwards;
}

/* ==========================================================================
   Social icons
   ========================================================================== */
.oif-social {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 44px;
  opacity: 0;
  animation: oif-fade 1s ease 1.35s forwards;
}

.oif-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--oif-line);
  border-radius: 50%;
  color: var(--oif-fg);
  text-decoration: none;
  transition: transform 0.35s var(--oif-ease),
    background-color 0.35s var(--oif-ease), color 0.35s var(--oif-ease),
    border-color 0.35s var(--oif-ease);
  will-change: transform;
}
.oif-social a:hover,
.oif-social a:focus-visible {
  transform: translateY(-6px) scale(1.06);
  background: var(--oif-fg);
  color: var(--oif-bg);
  border-color: var(--oif-fg);
  outline: none;
}
.oif-social svg { width: 22px; height: 22px; display: block; }

/* ==========================================================================
   Reveal on scroll
   ========================================================================== */
.oif-reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.9s var(--oif-ease), transform 0.9s var(--oif-ease);
}
.oif-reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   Contact
   ========================================================================== */
.oif-contact {
  padding: 110px 24px 90px;
  border-top: 1px solid var(--oif-line);
  background: var(--oif-bg);
}
.oif-contact__inner { max-width: 640px; margin: 0 auto; }

.oif-contact__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--oif-muted);
  margin: 0 0 12px;
}
.oif-contact__title {
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.oif-contact__lead {
  color: var(--oif-muted);
  margin: 0 0 40px;
}

.oif-form { display: grid; gap: 22px; }

.oif-field { position: relative; }
.oif-field label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--oif-muted);
  margin-bottom: 8px;
}
.oif-field input,
.oif-field textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--oif-fg);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--oif-line);
  padding: 10px 2px;
  border-radius: 0;
  transition: border-color 0.4s var(--oif-ease);
}
.oif-field textarea { resize: vertical; min-height: 130px; }
.oif-field input:focus,
.oif-field textarea:focus {
  outline: none;
  border-bottom-color: var(--oif-line-strong);
}

/* Honeypot */
.oif-hp { position: absolute; left: -9999px; opacity: 0; }

.oif-submit {
  justify-self: start;
  position: relative;
  overflow: hidden;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--oif-bg);
  background: var(--oif-fg);
  border: 2px solid var(--oif-fg);
  padding: 15px 38px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.4s var(--oif-ease);
}
.oif-submit::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--oif-bg);
  transform: translateY(101%);
  transition: transform 0.45s var(--oif-ease);
  z-index: -1;
}
.oif-submit:hover,
.oif-submit:focus-visible { color: var(--oif-fg); outline: none; }
.oif-submit:hover::after,
.oif-submit:focus-visible::after { transform: translateY(0); }
.oif-submit[disabled] { opacity: 0.5; cursor: progress; }

.oif-form__status {
  min-height: 1.4em;
  font-size: 0.95rem;
  margin: 4px 0 0;
}
.oif-form__status.is-ok { color: #0a7d2c; }
.oif-form__status.is-err { color: #b00020; }

/* ==========================================================================
   Petition (front page, below the hero)
   ========================================================================== */
.oif-petition {
  position: relative;
  z-index: 1;
  background: var(--oif-bg);
  color: var(--oif-fg);
  padding: 20px 0 100px;
}

/* 80% of the screen width, i.e. a 10% gutter on each side. */
.oif-petition__inner {
  width: 80%;
  margin: 0 auto;
}

/* Divider above the form — carries the #petition anchor. */
.oif-petition__divider {
  width: 64px;
  height: 2px;
  border: 0;
  background: var(--oif-fg);
  margin: 0 auto 56px;
}

.oif-petition__notice { color: var(--oif-muted); }

@media (max-width: 700px) {
  .oif-petition__inner { width: 88%; }
}

/* ==========================================================================
   Interior pages / posts (page.php, single.php, index.php)
   ========================================================================== */
.oif-page-content { padding: 128px 0 90px; }
.oif-entry { margin-bottom: 56px; }
.oif-entry__header { margin-bottom: 32px; }
.oif-entry__title {
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 8px;
}
.oif-entry__title a { text-decoration: none; }
.oif-entry__title a:hover { text-decoration: underline; }
.oif-entry__meta { color: var(--oif-muted); font-size: 0.9rem; margin: 0; }
.oif-entry__content { max-width: 720px; }
.oif-entry__content > * { margin-top: 0; margin-bottom: 1.2em; }
.oif-entry__content a { text-underline-offset: 3px; }
.oif-entry__content img { border-radius: 4px; }
.oif-page-links { margin-top: 24px; font-size: 0.9rem; }
.oif-page-links a { margin: 0 4px; }

/* ==========================================================================
   Dark site footer (contact form + social + copyright)
   Flips the design tokens to dark, so the form fields and social icons —
   which are all built on these variables — invert automatically.
   ========================================================================== */
.oif-site-footer {
  --oif-bg: #000000;
  --oif-fg: #ffffff;
  --oif-muted: #a6a6a6;
  --oif-line: #333333;
  --oif-line-strong: #ffffff;
  background: #000000;
  color: #ffffff;
}

/* Contact block sits inside the footer: dark grey, while the rest stays black. */
.oif-site-footer .oif-contact {
  background: var(--oif-contact-grey);
  border-top: none;
  padding: 96px 24px 56px;
}

.oif-site-footer__base {
  padding: 8px 24px 60px;
  text-align: center;
}

/* Social row: always visible in the footer (not part of the hero entrance). */
.oif-site-footer .oif-social {
  margin: 0 auto 30px;
  opacity: 1;
  animation: none;
}

.oif-copyright {
  margin: 0;
  color: var(--oif-muted);
  font-size: 0.85rem;
  line-height: 1.7;
}
.oif-copyright strong { color: #ffffff; font-weight: 600; }

/* Brighter status colors for legibility on black. */
.oif-site-footer .oif-form__status.is-ok { color: #4ade80; }
.oif-site-footer .oif-form__status.is-err { color: #f87171; }

/* ==========================================================================
   WPForms — restyle the plugin's markup to match the native contact form.
   Scoped to .oif-contact and uses !important to override WPForms' own CSS.
   ========================================================================== */
.oif-contact .oif-form__notice { color: var(--oif-muted); margin: 0; }
.oif-contact .wpforms-container { margin: 0 !important; }
.oif-contact .wpforms-form .wpforms-field { padding: 0 0 22px !important; }

.oif-contact .wpforms-form .wpforms-field-label {
  display: block !important;
  margin: 0 0 8px !important;
  font-size: 0.78rem !important;
  font-weight: 400 !important;
  line-height: 1.3 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: var(--oif-muted) !important;
}
.oif-contact .wpforms-required-label { color: var(--oif-muted) !important; }
.oif-contact .wpforms-field-sublabel { color: var(--oif-muted) !important; }

.oif-contact .wpforms-form input[type="text"],
.oif-contact .wpforms-form input[type="email"],
.oif-contact .wpforms-form input[type="url"],
.oif-contact .wpforms-form input[type="tel"],
.oif-contact .wpforms-form textarea {
  width: 100% !important;
  max-width: 100% !important;
  font: inherit !important;
  font-size: 1rem !important;
  color: var(--oif-fg) !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 2px solid var(--oif-line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 10px 2px !important;
}
.oif-contact .wpforms-form textarea {
  min-height: 130px !important;
  resize: vertical !important;
}
.oif-contact .wpforms-form input[type="text"]:focus,
.oif-contact .wpforms-form input[type="email"]:focus,
.oif-contact .wpforms-form input[type="url"]:focus,
.oif-contact .wpforms-form input[type="tel"]:focus,
.oif-contact .wpforms-form textarea:focus {
  outline: none !important;
  border-bottom-color: var(--oif-line-strong) !important;
  background: transparent !important;
  box-shadow: none !important;
}
.oif-contact .wpforms-form input::placeholder,
.oif-contact .wpforms-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.4) !important;
}

.oif-contact .wpforms-submit-container { margin-top: 4px !important; padding: 0 !important; }
.oif-contact .wpforms-form button.wpforms-submit {
  display: inline-block !important;
  width: auto !important;
  font: inherit !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  color: var(--oif-bg) !important;
  background: var(--oif-fg) !important;
  border: 2px solid var(--oif-fg) !important;
  padding: 15px 38px !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  box-shadow: none !important;
  transition: color 0.3s var(--oif-ease), background-color 0.3s var(--oif-ease) !important;
}
.oif-contact .wpforms-form button.wpforms-submit:hover,
.oif-contact .wpforms-form button.wpforms-submit:focus {
  background: var(--oif-bg) !important;
  color: var(--oif-fg) !important;
}

/* Validation + confirmation messages on the dark background. */
.oif-contact .wpforms-error,
.oif-contact label.wpforms-error { color: #f87171 !important; font-size: 0.85rem !important; }
.oif-contact .wpforms-form input.wpforms-error,
.oif-contact .wpforms-form textarea.wpforms-error { border-bottom-color: #f87171 !important; }
.oif-contact .wpforms-confirmation-container-full {
  background: transparent !important;
  border: none !important;
  color: var(--oif-fg) !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* ==========================================================================
   Keyframes
   ========================================================================== */
@keyframes oif-rise {
  to { opacity: 1; transform: none; }
}
@keyframes oif-fade {
  to { opacity: 1; }
}
@keyframes oif-word-in {
  to { opacity: 1; transform: none; }
}
@keyframes oif-rule {
  to { width: 64px; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  .oif-hero__word,
  .oif-hero__logo,
  .oif-hero__slogan,
  .oif-hero__badge,
  .oif-hero__rule,
  .oif-social,
  .oif-reveal {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    width: auto;
  }
  .oif-hero__rule { width: 64px; }
  html { scroll-behavior: auto; }
  #oif-net { display: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 600px) {
  body { font-size: 17px; }
  .oif-social a { width: 48px; height: 48px; }
  .oif-contact { padding: 80px 22px 70px; }

  /* Keep the top bar on one line: shorten the brand, tighten the menu. */
  .oif-topbar__brand { max-width: 42vw; font-size: 0.85rem; }
  .oif-menu { gap: 16px; }
  .oif-menu a { font-size: 0.85rem; white-space: nowrap; }
}
