/* groundedsecurity.io — one page, read in under a minute.
   No webfonts, no script, no third-party requests. */

:root {
  /* contrast on --paper: ink 15.45, soft 6.20, mute 5.49, accent 5.66 */
  --paper:  #edf0f3;
  --ink:    #16191a;
  --soft:   #525a57;
  --mute:   #5a625e;
  --rule:   #d3d8de;
  --accent: #1d6b46;

  --pad: 1.5rem;
  --mark: 40px;
  --top: 4.5rem;

  --serif: Charter, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* dark: deep green-black, same brand. ink 16.07, soft 8.66, mute 6.28, accent 8.54 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #101613; --ink: #edf1ee; --soft: #aab5ae;
    --mute: #8e9a93; --rule: #26302b; --accent: #5cc496;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #101613; --ink: #edf1ee; --soft: #aab5ae;
  --mute: #8e9a93; --rule: #26302b; --accent: #5cc496;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.62;
  overflow-wrap: break-word;
}

.page { position: relative; max-width: 34rem; margin: 0 auto; padding: var(--top) var(--pad) 5rem; }

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

/* masthead: lockup on the left. On phones and tablets the theme toggle is positioned
   against .page, level with the mark; the right padding keeps the name clear of it. It lives
   at the end of the header in the markup because on a laptop it sits in the rail, in flow.
   Nothing inside .page other than .page itself may be positioned below 64rem, or it will
   capture the toggle. */
.top { display: flex; align-items: center; gap: 1rem; margin: 0 0 1.5rem; padding-right: calc(33px + 1rem); }
.lockup { display: flex; align-items: center; gap: 0.85rem; margin: 0; text-decoration: none; color: inherit; min-width: 0; }
.mark { display: block; width: var(--mark); height: var(--mark); flex: 0 0 auto; overflow: visible; }
.mark path { fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: square; }
.lockup .nm {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(1.4rem, 1.25rem + 0.6vw, 1.7rem);
  line-height: 1;
  letter-spacing: -0.021em;
  margin: 0;
}
a.lockup:hover .nm { color: var(--accent); }

/* theme toggle: an icon in the mark's line style, 44px target, centred on the mark's row
   with its glyph flush with the right edge of the column. Hidden until theme.js reveals it;
   theme.js sets data-next. */
.theme {
  position: absolute;
  top: calc(var(--top) + var(--mark) / 2 - 22px);
  right: calc(var(--pad) - 11px);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  color: var(--soft);
  background: none;
  border: 0;
  cursor: pointer;
}
.theme[hidden] { display: none; }   /* author display: grid would otherwise override hidden */
.theme svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: square; stroke-linejoin: round; }
.theme .sun, .theme[data-next="light"] .moon { display: none; }
.theme[data-next="light"] .sun { display: block; }
.theme:hover { color: var(--ink); }
.theme:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
.theme .lbl { display: none; }   /* the text label is laptop only */
.theme[data-next="dark"] .to-light, .theme[data-next="light"] .to-dark { display: none; }

/* the tagline, now a subhead under the name */
.tagline {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 1.1rem + 0.55vw, 1.4rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.014em;
  margin: 0 0 0.85rem;
  text-wrap: balance;
}

/* byline: who is behind the page, straight after what it is */
.byline { display: flex; align-items: center; gap: 0.85rem; margin: 0; }
.byline p { margin: 0; line-height: 1.4; }
.byline strong { display: block; }
.who { color: var(--soft); }
.portrait { width: 4rem; height: 4rem; flex: 0 0 auto; display: block; border: 1px solid var(--rule); }

/* section headings: sentence case, carried by size, weight and the space above them.
   Scale: name 1.7rem/800, tagline 1.4rem serif/600, these 1.25rem/700. */
h2 {
  font-family: var(--sans);
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

section { margin-top: 3.5rem; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 650; }

/* get started */
.steps { margin: 0; padding-left: 1.2rem; }
.steps li { margin: 0 0 0.85rem; padding-left: 0.2rem; }
.steps li::marker { color: var(--mute); font-variant-numeric: tabular-nums; }

/* prices */
.price { display: flex; justify-content: space-between; align-items: baseline; gap: 1.25rem; padding: 0.7rem 0; border-top: 1px solid var(--rule); }
.price:last-of-type { border-bottom: 1px solid var(--rule); }
.price .n { min-width: 0; }
.price .n small { display: block; color: var(--mute); font-size: 0.875rem; line-height: 1.45; margin-top: 0.1rem; }
.price .v { font-family: var(--serif); font-size: 1.125rem; font-weight: 600; color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }
.price .v.q { font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; }
.after { font-size: 0.9375rem; color: var(--mute); margin-top: 0.9rem; }

/* contact + footer */
.mail { font-size: 1.125rem; margin-bottom: 0.8rem; }
footer { margin-top: 2.5rem; font-size: 0.8125rem; color: var(--mute); }
footer p { margin: 0 0 0.3rem; }

/* ---- narrow: the container has stopped having margins ---- */
@media (max-width: 34rem) {
  :root { --mark: 34px; }
  .lockup { gap: 0.7rem; }
}

/* ---- phones ---- */
@media (max-width: 30rem) {
  :root { --pad: 1.15rem; --top: 3rem; }
  .portrait { width: 3.5rem; height: 3.5rem; }
  .byline { gap: 0.75rem; }
  section { margin-top: 3rem; }
  .price { gap: 0.85rem; padding: 0.8rem 0; }
  .price .v { font-size: 1.0625rem; }
  .tagline { letter-spacing: -0.01em; }
}

/* ---- very small phones: 320px still has to work ---- */
@media (max-width: 22rem) {
  :root { --pad: 0.95rem; }
  .top { gap: 0.5rem; padding-right: calc(33px + 0.5rem); }
  .lockup { gap: 0.55rem; }
  .price { gap: 0.6rem; }
  .price .n small { font-size: 0.84rem; }
}

/* ---- short viewports, mostly phones in landscape ---- */
@media (max-height: 30rem) {
  :root { --top: 2.25rem; }
}

/* ===== LAPTOP: identity rail on the left, sections on the right ===== */
@media (min-width: 64rem) {
  :root { --pad: 2rem; --top: 6rem; }

  body { font-size: 1.125rem; }

  /* two columns, centred together: the rail is wide enough for the name and toggle on one
     line, the reading column stays near 70 characters */
  .page { max-width: 68rem; display: grid; grid-template-columns: 23rem minmax(0, 36rem);
          column-gap: 4rem; justify-content: center; align-items: start; }

  /* the rail spans every row on the right (five sections and the footer), so it can stay
     in view for the whole page. Add a section and this span grows by one. */
  .intro { grid-column: 1; grid-row: 1 / span 6; }
  .page > section, .page > footer { grid-column: 2; }

  /* the theme toggle leaves the rail for the page's top right corner, in the band above the
     columns, its glyph flush with the right edge of the text */
  /* theme toggle: a quiet text link at the foot of the rail, icon plus label, underlined so
     it reads as clickable */
  .top { padding-right: 0; }
  .theme { position: static; width: auto; height: auto; display: inline-flex; align-items: center;
           gap: 0.5rem; margin: 1.5rem 0 0 -1px; padding: 0.3rem 0; font: inherit; font-size: 0.9375rem; }
  .theme svg { width: 18px; height: 18px; }
  .theme .lbl { display: inline; text-decoration: underline; text-decoration-color: var(--rule);
                text-decoration-thickness: 1px; text-underline-offset: 4px; }
  .theme:hover .lbl { text-decoration-color: currentColor; }
  .theme:focus-visible { outline-offset: 2px; }

  .tagline { font-size: 2.625rem; line-height: 1.12; letter-spacing: -0.02em; margin: 2rem 0 1.75rem; }
  .byline { flex-direction: column; align-items: flex-start; gap: 0.9rem; }
  .portrait { width: 9rem; height: 9rem; }

  section { margin-top: 4.5rem; }
  .page > section:first-of-type { margin-top: 0; padding-top: 0.35rem; }
  section > h2 { font-size: 1.375rem; margin: 0 0 1rem; }

  .price { padding: 0.85rem 0; }
  footer { margin-top: 4rem; }
}

/* pinned only when the rail fits the window; on a short laptop screen it scrolls */
@media (min-width: 64rem) and (min-height: 44rem) {
  .intro { position: sticky; top: var(--top); }
}

@media print {
  :root { --paper:#fff; --ink:#000; --soft:#333; --mute:#555; --rule:#ccc; --accent:#000; }
  .page { max-width: none; padding: 0; }
  a { text-decoration: none; }
  section, .price { break-inside: avoid; }
  .theme { display: none; }
  .page a[href^="mailto"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
