/* ==========================================================================
   Texas K Energy — design system

   Colour carries meaning here rather than decoration: gold marks the supply
   charges a broker can actually shop, slate marks the CenterPoint delivery
   charges nobody can. That pairing is used identically in the hero bill
   diagram, the charge tables and the pricing explainers, so a reader who
   learns it once reads it everywhere.
   ========================================================================== */

:root {
  /* Ink — from the logo seal */
  --ink-900: #0a1329;
  --ink-800: #0e1b38;
  --ink-700: #16284d;
  --ink-600: #22355f;

  /* Gold — the shoppable half */
  --gold-300: #e6ce86;
  --gold-400: #d4b465;
  --gold-500: #c9a24a;
  --gold-600: #b08a34;

  /* Slate — the regulated half */
  --slate-600: #64748b;
  --slate-500: #8494a8;

  /* Paper */
  --paper: #fcfcfd;
  --paper-sunk: #f4f6f9;
  --paper-line: #dde3ec;
  --white: #ffffff;

  --text: var(--ink-800);
  --text-soft: #465268;
  --text-on-ink: #e7ecf5;
  --text-on-ink-soft: #a9b6cd;

  --ok: #1d7a4f;
  --warn: #9a5b13;

  --font-display: 'Newsreader', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-sans: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Major-third-ish scale, fluid between 380px and 1240px */
  --step--1: clamp(0.86rem, 0.83rem + 0.14vw, 0.94rem);
  --step-0: clamp(1.05rem, 1rem + 0.22vw, 1.18rem);
  --step-1: clamp(1.25rem, 1.16rem + 0.4vw, 1.5rem);
  --step-2: clamp(1.5rem, 1.34rem + 0.7vw, 1.95rem);
  --step-3: clamp(1.8rem, 1.53rem + 1.15vw, 2.5rem);
  --step-4: clamp(2.1rem, 1.68rem + 1.8vw, 3.2rem);
  --step-5: clamp(2.5rem, 1.83rem + 2.9vw, 4.2rem);

  --measure: 68ch;
  --wide: 1180px;
  --gutter: clamp(1.15rem, 4vw, 3rem);

  --radius: 3px;
  --radius-lg: 5px;

  --space-section: clamp(3.5rem, 7vw, 6.5rem);
}

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

* {
  margin: 0;
}

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

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

body {
  font-family: var(--font-display);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.68;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.014em;
  text-wrap: balance;
}

h1 {
  font-size: var(--step-5);
}
h2 {
  font-size: var(--step-3);
}
h3 {
  font-size: var(--step-1);
  line-height: 1.28;
}
h4 {
  font-size: var(--step-0);
  font-weight: 600;
  line-height: 1.35;
}

p,
li {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-color: var(--gold-500);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--gold-600);
  outline-offset: 3px;
  border-radius: 1px;
}

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

.shell {
  width: min(100% - (var(--gutter) * 2), var(--wide));
  margin-inline: auto;
}

.measure {
  max-width: var(--measure);
}

.section {
  padding-block: var(--space-section);
}

.section--sunk {
  background: var(--paper-sunk);
  border-block: 1px solid var(--paper-line);
}

.section--ink {
  background: var(--ink-800);
  color: var(--text-on-ink);
}

.section--ink h1,
.section--ink h2,
.section--ink h3,
.section--ink h4 {
  color: var(--white);
}

.section--ink a {
  color: var(--gold-300);
}

/* A section heading sits above a gold rule that is as wide as the heading —
   the site's one recurring structural device. */
.rule-head {
  margin-bottom: 2rem;
}

/* The rule belongs to the heading, not the block — it must sit directly
   under the heading and above any intro paragraph. */
.rule-head > :is(h1, h2, h3) {
  margin-bottom: 0;
}

.rule-head > :is(h1, h2, h3)::after {
  content: '';
  display: block;
  width: 4.5rem;
  height: 2px;
  margin-top: 0.9rem;
  background: var(--gold-500);
}

.rule-head p {
  margin-top: 1.1rem;
  max-width: var(--measure);
  color: var(--text-soft);
  font-size: var(--step-1);
  line-height: 1.5;
}

.section--ink .rule-head p {
  color: var(--text-on-ink-soft);
}

/* --- Prose --------------------------------------------------------------- */

.prose {
  max-width: var(--measure);
}

.prose > * + * {
  margin-top: 1.15em;
}

.prose h2 {
  margin-top: 2.4em;
  font-size: var(--step-2);
}

.prose h3 {
  margin-top: 2em;
}

.prose ul,
.prose ol {
  padding-left: 1.35rem;
}

.prose li + li {
  margin-top: 0.5em;
}

.prose ul {
  list-style: none;
  padding-left: 0;
}

.prose ul > li {
  position: relative;
  padding-left: 1.5rem;
}

.prose ul > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 0.5rem;
  height: 2px;
  background: var(--gold-500);
}

.prose strong {
  font-weight: 600;
}

.lede {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--text-soft);
}

.section--ink .lede {
  color: var(--text-on-ink-soft);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: 1;
  padding: 0.95rem 1.6rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.btn--primary {
  background: var(--ink-800);
  color: var(--white);
  border-color: var(--ink-800);
}

.btn--primary:hover {
  background: var(--ink-600);
  border-color: var(--ink-600);
}

.btn--ghost {
  background: transparent;
  color: var(--ink-800);
  border-color: color-mix(in srgb, var(--ink-800) 28%, transparent);
}

.btn--ghost:hover {
  border-color: var(--ink-800);
  background: color-mix(in srgb, var(--ink-800) 4%, transparent);
}

.section--ink .btn--primary,
.btn--onink {
  background: var(--white);
  color: var(--ink-800);
  border-color: var(--white);
}

.section--ink .btn--primary:hover,
.btn--onink:hover {
  background: var(--gold-300);
  border-color: var(--gold-300);
}

.section--ink .btn--ghost {
  color: var(--white);
  border-color: color-mix(in srgb, var(--white) 38%, transparent);
}

.section--ink .btn--ghost:hover {
  border-color: var(--gold-400);
  background: transparent;
}

.btn--lg {
  padding: 1.1rem 2rem;
  font-size: 1rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
}

/* --- Cards --------------------------------------------------------------- */

.card {
  background: var(--white);
  border: 1px solid var(--paper-line);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 2.6vw, 2rem);
}

.card h3 {
  margin-bottom: 0.6rem;
}

.card p {
  color: var(--text-soft);
  font-size: var(--step--1);
  line-height: 1.6;
}

.section--ink .card {
  background: color-mix(in srgb, var(--white) 5%, transparent);
  border-color: color-mix(in srgb, var(--white) 14%, transparent);
}

.section--ink .card p {
  color: var(--text-on-ink-soft);
}

.grid {
  display: grid;
  gap: 1.15rem;
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr));
}

/* --- Small type / meta --------------------------------------------------- */

.meta {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-soft);
  line-height: 1.5;
}

.section--ink .meta {
  color: var(--text-on-ink-soft);
}

.sans {
  font-family: var(--font-sans);
}

/* --- Tables -------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--paper-line);
  border-radius: var(--radius);
  background: var(--white);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 0.92rem;
}

th,
td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--paper-line);
  vertical-align: top;
}

th {
  font-weight: 600;
  background: var(--paper-sunk);
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* Charge classification, used wherever supply and delivery are compared. */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
  white-space: nowrap;
}

.tag--supply {
  background: color-mix(in srgb, var(--gold-500) 20%, var(--white));
  color: #6d5416;
}

.tag--delivery {
  background: color-mix(in srgb, var(--slate-600) 16%, var(--white));
  color: #44506a;
}

/* --- FAQ ----------------------------------------------------------------- */

.faq {
  border-top: 1px solid var(--paper-line);
}

.faq details {
  border-bottom: 1px solid var(--paper-line);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1.15rem 2.5rem 1.15rem 0;
  position: relative;
  font-weight: 500;
  font-size: var(--step-1);
  line-height: 1.35;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '';
  position: absolute;
  right: 0.4rem;
  top: 1.6rem;
  width: 0.7rem;
  height: 0.7rem;
  border-right: 2px solid var(--gold-600);
  border-bottom: 2px solid var(--gold-600);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: rotate(-135deg);
  top: 1.9rem;
}

.faq details > div {
  padding-bottom: 1.35rem;
  max-width: var(--measure);
  color: var(--text-soft);
}

/* --- Forms --------------------------------------------------------------- */

.field {
  display: block;
  margin-bottom: 1.05rem;
}

.field > span {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.87rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.field .hint {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.79rem;
  font-weight: 400;
  color: var(--text-soft);
  margin-top: 0.3rem;
}

input,
select,
textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text);
  background: var(--white);
  border: 1px solid #c3ccda;
  border-radius: var(--radius);
  padding: 0.72rem 0.85rem;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ink-700);
}

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

.field-row {
  display: grid;
  gap: 0 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}

.hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

/* --- Utility ------------------------------------------------------------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink-800);
  color: var(--white);
  padding: 0.8rem 1.2rem;
  z-index: 200;
}

.skip:focus {
  left: 0;
}

.stack > * + * {
  margin-top: 1.15rem;
}

.stack-lg > * + * {
  margin-top: 2.2rem;
}

.center-narrow {
  max-width: 46rem;
}
