/* ===========================
   Open Works Institute
   Mobile-first base styles
   =========================== */

/* ---- Design tokens ---- */
:root{
  /* Neutral + trust palette */
  --bg: #0b1220;
  --bg2: #0e172a;
  --surface: rgba(255,255,255,0.06);
  --surface2: rgba(255,255,255,0.09);
  --border: rgba(255,255,255,0.14);
  --border2: rgba(255,255,255,0.22);

  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.72);
  --subtle: rgba(255,255,255,0.58);

  --brand: #4fd1c5;      /* teal */
  --brand2: #60a5fa;     /* blue */
  --warn: #fbbf24;       /* amber */
  --ok: #34d399;         /* green */
  --danger: #fb7185;     /* rose */

  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --shadow2: 0 8px 20px rgba(0,0,0,0.25);

  /* Typography */
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --radius: 16px;
  --radius2: 22px;

  /* Spacing scale */
  --s1: 6px;
  --s2: 10px;
  --s3: 14px;
  --s4: 18px;
  --s5: 22px;
  --s6: 28px;
  --s7: 36px;
  --s8: 48px;

  /* Layout */
  --container: 1120px;
}

/* ---- Reset / base ---- */
*{ box-sizing: border-box; }
html, body{ height: 100%; }
html{
  color-scheme: dark;
  scroll-behavior: smooth;
}
body{
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(96,165,250,0.22), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(79,209,197,0.18), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  color: var(--text);
  line-height: 1.5;
}

img{ max-width: 100%; height: auto; }
a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: underline; }
button, input, select, textarea{ font: inherit; }

/* Accessibility */
.tpi-skiplink{
  position: absolute;
  left: -9999px;
  top: 12px;
  padding: 10px 14px;
  background: #111827;
  color: #fff;
  border-radius: 10px;
  z-index: 9999;
}
.tpi-skiplink:focus{
  left: 12px;
  outline: 2px solid rgba(96,165,250,0.65);
  outline-offset: 2px;
}

/* ---- Utilities ---- */
.tpi-container{
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--s4);
}

.tpi-main{ display: block; }

/* ---- Top bar ---- */
.tpi-topbar{
  background: rgba(0,0,0,0.28);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
}
.tpi-topbar-row{
  display: flex;
  gap: var(--s3);
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}
.tpi-topbar-text{
  color: var(--muted);
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}

/* ---- Header ---- */
.tpi-header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11,18,32,0.72);
  border-bottom: 1px solid rgba(255,255,255,0.09);
  backdrop-filter: blur(12px);
}
.tpi-header-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: var(--s3);
}

/* Brand */
.tpi-brand{
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-width: 0;
}
.tpi-mark{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.95);
  background:
    linear-gradient(135deg, rgba(96,165,250,0.28), rgba(79,209,197,0.22)),
    rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: var(--shadow2);
}
.tpi-brandtext{ display: grid; min-width: 0; }
.tpi-brandname{
  font-weight: 750;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tpi-brandtag{
  color: var(--subtle);
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Nav toggle */
.tpi-navbtn{
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: var(--shadow2);
  cursor: pointer;
}
.tpi-navbtn:focus{
  outline: 2px solid rgba(96,165,250,0.6);
  outline-offset: 2px;
}
.tpi-navbtn-bars{
  width: 24px;
  height: 18px;
  display: grid;
  gap: 4px;
}
.tpi-navbtn-bars span{
  display: block;
  height: 2px;
  border-radius: 999px;
  background: rgba(255,255,255,0.85);
}

/* ---- Mobile nav drawer ---- */
.tpi-navpanel{
  position: fixed;
  inset: 0 auto 0 0;
  width: min(92vw, 360px);
  transform: translateX(-110%);
  transition: transform 240ms ease;
  background:
    radial-gradient(900px 500px at 10% 10%, rgba(96,165,250,0.18), transparent 60%),
    radial-gradient(700px 420px at 90% 15%, rgba(79,209,197,0.12), transparent 55%),
    rgba(12,20,38,0.96);
  border-right: 1px solid rgba(255,255,255,0.12);
  padding: 18px 16px 20px;
  box-shadow: 30px 0 60px rgba(0,0,0,0.45);
  z-index: 80;
  overflow: auto;
}
.tpi-navpanel[aria-hidden="false"],
.tpi-navpanel.is-open{
  transform: translateX(0);
}

.tpi-navlist{
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 2px;
}
.tpi-navlink{
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  border: 1px solid transparent;
}
.tpi-navlink:hover{
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.10);
  text-decoration: none;
}
.tpi-navcta{
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.tpi-navnote{
  margin-top: 14px;
  padding: 12px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--muted);
  font-size: 0.95rem;
}

/* Overlay */
.tpi-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 70;
}

/* ---- Type styles ---- */
.tpi-kicker{
  margin: 0 0 8px;
  color: rgba(96,165,250,0.9);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.tpi-h1{
  margin: 10px 0 12px;
  font-size: clamp(1.65rem, 3.8vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.tpi-h1-sm{
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.22;
  letter-spacing: -0.01em;
}
.tpi-h2{
  margin: 0 0 8px;
  font-size: 1.15rem;
  line-height: 1.25;
}
.tpi-h3{
  margin: 0 0 8px;
  font-size: 1.02rem;
  line-height: 1.28;
}
.tpi-lead{
  margin: 0;
  color: rgba(255,255,255,0.82);
  font-size: 1.02rem;
}
.tpi-p{
  margin: 0 0 12px;
  color: rgba(255,255,255,0.82);
}
.tpi-footnote{
  margin: 10px 0 0;
  color: var(--subtle);
  font-size: 0.92rem;
}
.tpi-sectionhead{
  margin-bottom: var(--s4);
}

/* ---- Chips ---- */
.tpi-chip{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.13);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.88);
  font-size: 0.86rem;
  letter-spacing: 0.01em;
}
.tpi-chip--status{
  border-color: rgba(251,191,36,0.35);
  background: rgba(251,191,36,0.10);
  color: rgba(255,255,255,0.92);
}
.tpi-chip--new{
  border-color: rgba(96,165,250,0.35);
  background: rgba(96,165,250,0.10);
}

/* ---- Buttons ---- */
.tpi-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow2);
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}
.tpi-btn:hover{
  text-decoration: none;
  transform: translateY(-1px);
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.18);
}
.tpi-btn:active{
  transform: translateY(0);
}
.tpi-btn[aria-disabled="true"],
.tpi-btn:disabled{
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.tpi-btn--primary{
  background: linear-gradient(135deg, rgba(96,165,250,0.95), rgba(79,209,197,0.92));
  border-color: rgba(255,255,255,0.10);
  color: rgba(11,18,32,0.92);
}
.tpi-btn--primary:hover{
  background: linear-gradient(135deg, rgba(96,165,250,1), rgba(79,209,197,1));
}
.tpi-btn--secondary{
  background: rgba(96,165,250,0.14);
  border-color: rgba(96,165,250,0.28);
}
.tpi-btn--ghost{
  background: transparent;
  border-color: rgba(255,255,255,0.18);
}

/* ---- Sections ---- */
.tpi-section{
  padding: var(--s7) 0;
}
.tpi-section--cta{
  padding: var(--s8) 0;
}
.tpi-hero{
  padding: var(--s7) 0 var(--s6);
}
.tpi-hero-card{
  border-radius: var(--radius2);
  padding: var(--s6) var(--s4);
  background:
    radial-gradient(1000px 500px at 20% 0%, rgba(96,165,250,0.18), transparent 55%),
    radial-gradient(900px 450px at 90% 10%, rgba(79,209,197,0.14), transparent 55%),
    rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: var(--shadow);
}
.tpi-hero-badges{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.tpi-hero-actions{
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: var(--s4);
}

/* Trust strip */
.tpi-truststrip{
  margin-top: var(--s5);
  display: grid;
  gap: 10px;
  padding: var(--s4);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
}
.tpi-trustitem{
  display: grid;
  gap: 2px;
}
.tpi-trusttitle{
  font-weight: 700;
  color: rgba(255,255,255,0.92);
}
.tpi-trustdesc{
  color: var(--subtle);
  font-size: 0.94rem;
}

/* ---- Grid + tiles ---- */
.tpi-grid{
  display: grid;
  gap: var(--s4);
}
.tpi-tile{
  border-radius: var(--radius);
  padding: var(--s4);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: var(--shadow2);
}
.tpi-tile--emph{
  background: rgba(255,255,255,0.055);
  border-color: rgba(255,255,255,0.14);
}
.tpi-panel{
  border-radius: var(--radius2);
  padding: var(--s5) var(--s4);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: var(--shadow2);
}
.tpi-cta{
  border-radius: var(--radius2);
  padding: var(--s6) var(--s4);
  background:
    radial-gradient(1000px 500px at 20% 0%, rgba(79,209,197,0.16), transparent 55%),
    radial-gradient(900px 450px at 90% 10%, rgba(96,165,250,0.14), transparent 55%),
    rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: var(--shadow);
}

/* Lists */
.tpi-list{
  margin: 10px 0 12px;
  padding-left: 18px;
  color: rgba(255,255,255,0.82);
}
.tpi-list li{ margin: 6px 0; }

/* ---- Callouts ---- */
.tpi-callout{
  margin-top: var(--s4);
  padding: 14px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.88);
}
.tpi-callout--note{
  border-color: rgba(96,165,250,0.30);
  background: rgba(96,165,250,0.10);
}
.tpi-callout--strong{
  border-color: rgba(79,209,197,0.30);
  background: rgba(79,209,197,0.10);
}
.tpi-callout--success{
  border-color: rgba(52,211,153,0.30);
  background: rgba(52,211,153,0.10);
}

/* ---- Accordion ---- */
.tpi-accordion{
  display: grid;
  gap: 10px;
}
.tpi-accbtn{
  width: 100%;
  text-align: left;
  padding: 14px 14px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.92);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tpi-accbtn:focus{
  outline: 2px solid rgba(96,165,250,0.60);
  outline-offset: 2px;
}
.tpi-accicon{
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  flex: 0 0 auto;
}
.tpi-accpanel{
  margin-top: -6px;
  padding: 14px 14px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.82);
}

/* ---- Forms ---- */
.tpi-form{
  display: grid;
  gap: 10px;
  margin-top: var(--s3);
}
.tpi-label{
  font-weight: 650;
  color: rgba(255,255,255,0.88);
  font-size: 0.95rem;
}
.tpi-input,
.tpi-select,
.tpi-textarea{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.92);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.tpi-select{
  appearance: none;
}
.tpi-input::placeholder,
.tpi-textarea::placeholder{
  color: rgba(255,255,255,0.50);
}
.tpi-input:focus,
.tpi-select:focus,
.tpi-textarea:focus{
  border-color: rgba(96,165,250,0.55);
  box-shadow: 0 0 0 4px rgba(96,165,250,0.15);
}

/* ---- Contact cards ---- */
.tpi-contactgrid{
  display: grid;
  gap: var(--s4);
  margin-top: var(--s4);
}
.tpi-contactcard{
  border-radius: var(--radius);
  padding: var(--s4);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: var(--shadow2);
}

/* ---- Fine print ---- */
.tpi-fineprint{
  margin-top: var(--s4);
  color: rgba(255,255,255,0.58);
  font-size: 0.92rem;
  line-height: 1.45;
}

/* ---- Footer ---- */
.tpi-footer{
  padding: var(--s7) 0 var(--s6);
  border-top: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
}
.tpi-footerrow{
  display: grid;
  gap: var(--s4);
  align-items: start;
}
.tpi-footerbrand{
  font-weight: 780;
  letter-spacing: 0.01em;
  margin-bottom: 6px;
}
.tpi-footertext{
  color: var(--muted);
  font-size: 0.96rem;
}
.tpi-footerlinks{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.tpi-footerlinks a{
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
}
.tpi-footerlinks a:hover{
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.10);
  text-decoration: none;
}
.tpi-footerfine{
  margin-top: var(--s4);
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: rgba(255,255,255,0.58);
  font-size: 0.90rem;
}

/* ---- Minor improvements for small screens ---- */
@media (min-width: 520px){
  .tpi-hero-actions{
    flex-direction: row;
    flex-wrap: wrap;
  }
  .tpi-truststrip{
    grid-template-columns: 1fr 1fr;
  }
  .tpi-footerfine{
    flex-direction: row;
    justify-content: space-between;
    gap: 12px;
  }
}

/* ---- Divider ---- */
.tpi-divider{
  height: 1px;
  background: rgba(255,255,255,0.10);
  margin: var(--s5) 0;
}

/* ---- Timeline ---- */
.tpi-timeline{
  margin-top: var(--s4);
  display: grid;
  gap: 12px;
}
.tpi-timeline-item{
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  align-items: start;
}
.tpi-timeline-dot{
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-top: 6px;
  background: rgba(79,209,197,0.9);
  box-shadow: 0 0 0 4px rgba(79,209,197,0.14);
}
.tpi-timeline-title{
  font-weight: 800;
  color: rgba(255,255,255,0.92);
  margin-bottom: 4px;
}
.tpi-timeline-desc{
  color: rgba(255,255,255,0.78);
  font-size: 0.96rem;
}

/* ---- Form helper ---- */
.tpi-form .tpi-footnote{
  grid-column: 1 / -1;
}
