/* lewpen.com — a customised build of stylesheet.org's framework.
 *
 * Semantic HTML + a handful of utility classes. No custom tags, no IDs, no
 * JavaScript. Write a normal page (header / main / footer, one h1 in main,
 * sections by depth) and it looks right; reach for a class only where HTML has
 * no element for the job (layout and a few presentational components).
 *
 * The file is in five sections plus site additions. A theme only ever changes
 * section 2.
 *   1. RESET          — constant
 *   2. THEME TOKENS   — :root variables (the "Lewpen Labs" cyan theme)
 *   3. LAYOUT         — constant: row, column, grid, flow, stretch
 *   4. ELEMENTS       — constant: semantic tags styled directly
 *   5. COMPONENTS     — constant: panel, card, chip, buttons, status, paging, menu
 *   6. SITE           — lewpen.com additions: hero, site cards, logo strip, helpers
 */

/* ============================================================
   1. RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; overflow-x: hidden; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg, video { max-width: 100%; height: auto; display: block; }

/* ============================================================
   2. THEME TOKENS  — the only section a theme changes  (developer indigo)
   ============================================================ */
:root {
  /* colour */
  --bg: #f5f8f9;               /* cool off-white page base */
  --surface: #ffffff;          /* panels, cards, the intro area */
  --surface-soft: #eef4f6;     /* nested panels / soft fills */
  --section-bg: #e9f1f4;       /* pale cyan-grey */
  --band: #e9f1f4;             /* the full-width section band */
  --pad: 28px;                 /* content side padding */
  --header-bg: #ffffff;        /* crisp white menu bar */
  --header-bg-2: #f1f7f9;      /* paler band for a stacked sub-nav */
  --fg: #2b3a40;               /* slate text */
  --heading: #0b1a1f;
  --muted: #64777e;
  --border: #e2ebee;           /* cool grey border */
  --border-strong: #cddce1;
  --accent: #0e7490;           /* cyan — buttons, links, active */
  --accent-hover: #155e75;
  --accent-fg: #ffffff;
  --accent-tint: #e2f4f9;      /* light cyan — hovers, focus, quotes */
  --accent-2: #b45309;         /* amber — for "active" chips/badges */
  --accent-2-tint: #fdf0d8;
  --code-bg: #0b1a1f;          /* deep ink code block */
  --code-fg: #dfeaee;
  --ok-fg: #04603e; --ok-bg: #e9fbf2; --ok-bd: #a6e9c8;
  --err-fg: #ad1b14; --err-bg: #fdf0ef; --err-bd: #f6c9c6;
  --info-fg: #0e5a72; --info-bg: #e9f5f9; --info-bd: #b8dde9;
  --warn-fg: #9a5a05; --warn-bg: #fff4d6; --warn-bd: #f3df9a;
  /* type */
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-hand: var(--font);    /* the wordmark — a bold sans, not a script */
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  /* space + shape */
  --space: 18px;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-pill: 999px;
  --maxw: 1080px;
  --shadow-sm: 0 1px 2px rgba(11, 26, 31, 0.05), 0 1px 3px rgba(11, 26, 31, 0.07);
  --shadow-md: 0 6px 14px -4px rgba(11, 26, 31, 0.13), 0 2px 6px -2px rgba(11, 26, 31, 0.07);
  --shadow-lg: 0 20px 30px -12px rgba(11, 26, 31, 0.20);
}

/* ============================================================
   3. LAYOUT  — structure only; references --space, never colour
   ============================================================ */
.row, .column { display: flex; gap: var(--space); }
.row { flex-direction: row; }
.column { flex-direction: column; }
.row > *, .column > * { flex: 0 0 auto; min-width: 0; min-height: 0; }   /* natural size, from the start */
.stretch { flex: 1 1 0; min-width: 0; min-height: 0; }                    /* eats / shares the remainder */
.stretch-2 { flex-grow: 2; }
.stretch-3 { flex-grow: 3; }
.grid { display: grid; gap: var(--space); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.flow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
/* explicit grids collapse gracefully on narrow screens */
@media (max-width: 860px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

/* ============================================================
   4. ELEMENTS  — semantic tags styled directly
   ============================================================ */
body {
  background: radial-gradient(130% 760px at 50% 120px, #e9f4f8, #ffffff);   /* cool light glow under the top of main */
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
}

/* typography */
h1, h2, h3, h4, h5, h6 { color: var(--heading); font-weight: 700; line-height: 1.2; letter-spacing: -0.015em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; letter-spacing: -0.01em; }
h4 { font-size: 1.02rem; letter-spacing: 0; }
h5, h6 { font-size: 0.9rem; letter-spacing: 0; }
a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
strong { font-weight: 650; color: var(--heading); }
small { color: var(--muted); font-size: 0.875em; }
ul, ol { padding-left: 1.4em; }
li { margin: 5px 0; }
li::marker { color: var(--accent); }
hr { border: none; border-top: 1px solid var(--border); }
code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-soft); border: 1px solid var(--border); padding: 0.1em 0.4em; border-radius: 6px; }
pre { background: var(--code-bg); color: var(--code-fg); border-radius: var(--radius-sm); padding: 16px 18px; overflow-x: auto; box-shadow: var(--shadow-sm); font-size: 0.85rem; line-height: 1.6; }
pre code { background: none; border: none; padding: 0; color: inherit; font-size: inherit; }
blockquote { padding: 10px 18px; border-left: 3px solid var(--accent); background: var(--accent-tint); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--fg); }

/* header: the site chrome — a crisp white menu, sticky, stacked bars */
header {
  position: sticky; top: 0; z-index: 10;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-strong);
  box-shadow: 0 2px 10px rgba(11, 26, 31, 0.07);
}
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
nav > a, nav > span { font-weight: 700; color: var(--heading); letter-spacing: -0.01em; }   /* a bar's title */
nav > a:hover { text-decoration: none; }
nav > ul { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }
nav > ul > li { margin: 0; }
nav ul a { display: block; padding: 7px 13px; border-radius: 8px; white-space: nowrap; color: var(--fg); font-size: 0.95rem; font-weight: 500; text-decoration: none; transition: background 0.15s, color 0.15s; }
nav ul a:hover { background: var(--surface-soft); color: var(--heading); text-decoration: none; }
nav a[aria-current] { background: var(--accent); color: #fff; }
nav a[aria-current]:hover { background: var(--accent); color: #fff; }
header > nav { padding: 12px 28px; }
header > nav:first-of-type > a { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-hand); font-weight: 750; font-size: 1.3rem; letter-spacing: -0.02em; line-height: 1; }   /* brand: mark + bold wordmark */
header > nav:first-of-type > a img { width: 30px; height: 30px; display: block; }
header > nav:first-of-type > ul { margin-left: auto; }                        /* brand left, links right */
header > nav ~ nav { border-top: 1px solid var(--border); background: var(--header-bg-2); padding-top: 9px; padding-bottom: 9px; }
header > nav ~ nav > span { font-size: 0.85rem; color: var(--accent-hover); text-transform: uppercase; letter-spacing: 0.05em; }
header > nav ~ nav ul a { font-size: 0.9rem; }

/* nav dropdowns (no JS): a nested <ul> in <details> (click) or bare (hover/focus) */
nav li { position: relative; }
nav li > ul, nav details > ul {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 20;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 210px; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
}
nav li > ul li, nav details > ul li { margin: 0; }
nav summary { display: block; padding: 7px 13px; border-radius: 8px; cursor: pointer; color: var(--fg); font-size: 0.95rem; font-weight: 500; list-style: none; }
nav summary:hover { background: var(--surface-soft); color: var(--heading); }
nav summary::-webkit-details-marker { display: none; }
nav summary::after { content: "  ▾" / ""; color: var(--muted); }
nav details[open] > summary { background: var(--surface-soft); color: var(--heading); }
nav details[open] > summary::after { content: "  ▴" / ""; }
nav li:has(> ul) > a::after { content: "  ▾" / ""; color: var(--muted); }
nav li > ul { visibility: hidden; opacity: 0; transform: translateY(-4px); transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s; }
nav li:hover > ul, nav li:focus-within > ul { visibility: visible; opacity: 1; transform: none; }

/* main: a white intro with a cool radial glow; sections sit on pale blue */
main {
  flex: 1 0 auto;                /* grow to fill: footer sticks to the bottom */
  width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 44px var(--pad) 0;
  display: flex; flex-direction: column; gap: 0;
}
main > :not(section) + :not(section) { margin-top: 28px; }
/* darker band filler — keeps short pages banded all the way down to the footer */
main::after { content: ""; flex: 1 0 auto; margin-inline: calc(var(--pad) * -1); background: var(--band); box-shadow: 0 0 0 100vw var(--band); clip-path: inset(0 -100vw); }
main > h1 { font-size: clamp(1.9rem, 4vw, 2.5rem); letter-spacing: -0.025em; line-height: 1.12; }
main > h1 + p { max-width: 72ch; font-size: 1.15rem; color: var(--muted); }
main > ul { padding-left: 1.3em; max-width: 70ch; }
main > ul > li { margin: 0 0 18px; }
main > ul > li:last-child { margin-bottom: 0; }
main > ul > li > strong { font-size: 1.05rem; }
main > ul > li > p { margin-top: 4px; color: var(--muted); }

/* sections: pale-blue bands; bare headings; spacing tightens with depth */
section { display: flex; flex-direction: column; gap: 16px; }
main > section { margin: 28px calc(var(--pad) * -1) 0; padding: 30px var(--pad); background: var(--band); box-shadow: 0 0 0 100vw var(--band); clip-path: inset(0 -100vw); }
main > section + section { margin-top: 0; }
main > section > h2 { padding-bottom: 8px; border-bottom: 2px solid var(--border-strong); }
section section { gap: 12px; }
section section section { gap: 9px; }

/* tables */
table { width: 100%; border-collapse: collapse; }
caption { text-align: left; padding: 8px 0; font-weight: 600; color: var(--muted); }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); }
thead th { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: var(--surface-soft); border-bottom: 1px solid var(--border-strong); }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: var(--accent-tint); }
tbody tr:last-child td { border-bottom: none; }

/* forms */
form { display: grid; gap: 15px; }
fieldset { padding: 16px; display: grid; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
legend { font-weight: 600; padding: 0 6px; color: var(--heading); }
label > p { font-weight: 550; font-size: 0.9rem; margin-bottom: 6px; color: var(--heading); }
input, select, textarea { width: 100%; padding: 9px 12px; font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); transition: border-color 0.15s, box-shadow 0.15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
textarea { min-height: 96px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; margin-right: 7px; accent-color: var(--accent); }

/* buttons (the element) + link buttons */
button, input[type="submit"], input[type="reset"], input[type="button"], a.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  width: auto; padding: 9px 18px; font: inherit; font-weight: 550; line-height: 1.4;
  cursor: pointer; text-align: center; text-decoration: none;
  background: var(--accent); color: var(--accent-fg);
  border: 1px solid var(--accent); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm); transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
button:hover, input[type="submit"]:hover, input[type="button"]:hover, a.button:hover {
  background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-fg);
  box-shadow: var(--shadow-md); text-decoration: none; transform: translateY(-1px);
}
.button.secondary, input[type="reset"], button.secondary { background: var(--surface); color: var(--fg); border-color: var(--border-strong); box-shadow: none; }
.button.secondary:hover, input[type="reset"]:hover, button.secondary:hover { background: var(--surface-soft); color: var(--fg); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.button.ghost, button.ghost { background: transparent; color: var(--accent); border-color: transparent; box-shadow: none; }
.button.ghost:hover, button.ghost:hover { background: var(--accent-tint); color: var(--accent-hover); }
.button.small, button.small { padding: 5px 12px; font-size: 0.9rem; }
.button.large, button.large { padding: 12px 24px; font-size: 1.05rem; }

/* menu: a sidebar nav */
menu { display: block; margin: 0; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
menu ol, menu ul { list-style: none; margin: 0; padding: 0; }
menu li { margin: 2px 0; }
menu p { margin: 12px 8px 4px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
menu a { display: block; padding: 7px 12px; color: var(--fg); border-radius: 8px; transition: background 0.15s; }
menu a:hover { background: var(--surface-soft); text-decoration: none; }
menu a[aria-current] { background: var(--accent-tint); color: var(--accent-hover); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); }

/* ============================================================
   5. COMPONENTS
   ============================================================ */
.panel, .card { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.panel .panel, .card .card { background: var(--surface-soft); box-shadow: none; }
.card { transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.12s ease; }
a.card { color: inherit; }
a.card:hover, .grid > a.card:hover { text-decoration: none; box-shadow: var(--shadow-md); border-color: var(--accent); transform: translateY(-2px); }
.card > h2, .card > h3 { color: var(--accent); }

.chip { display: inline-flex; align-self: flex-start; align-items: center; gap: 6px; padding: 4px 12px; font-size: 0.85rem; font-weight: 550; line-height: 1.5; color: var(--fg); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-pill); }
button.chip, a.chip { cursor: pointer; text-decoration: none; transition: background 0.15s, border-color 0.15s, color 0.15s; }
button.chip:hover, a.chip:hover { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-hover); text-decoration: none; }
.chip.accent { background: var(--accent-tint); border-color: transparent; color: var(--accent-hover); }
.chip.teal { background: var(--accent-2-tint); border-color: transparent; color: var(--accent-2); }

.buttons { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.status { display: block; padding: 11px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-weight: 500; }
.status.success { background: var(--ok-bg); border-color: var(--ok-bd); color: var(--ok-fg); }
.status.error   { background: var(--err-bg); border-color: var(--err-bd); color: var(--err-fg); }
.status.info    { background: var(--info-bg); border-color: var(--info-bd); color: var(--info-fg); }
.status.warning { background: var(--warn-bg); border-color: var(--warn-bd); color: var(--warn-fg); }

.paging { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.paging a, .paging span { display: inline-block; padding: 7px 13px; border-radius: 8px; color: var(--fg); text-decoration: none; }
.paging a:hover { background: var(--surface); box-shadow: var(--shadow-sm); text-decoration: none; }
.paging a[aria-current] { background: var(--accent); color: var(--accent-fg); }
.paging span { color: var(--muted); }

/* footer — full-width bar; content constrained and centred */
footer { flex-shrink: 0; background: var(--bg); border-top: 1px solid var(--border-strong); color: var(--muted); }
footer > .row { width: 100%; padding: 22px var(--pad); align-items: center; flex-wrap: wrap; }
footer a { color: var(--muted); text-decoration: underline; }

/* ============================================================
   6. SITE  — lewpen.com additions
   ============================================================ */
/* brand mark — the circled L next to the wordmark */
.brand-icon { width: 30px; height: 30px; display: block; }

/* one-page site: the sticky header must not cover a section it jumps to */
main > section[id] { scroll-margin-top: 78px; }

/* hero — a white band with a very light grey grid (sits at body level, between header and main) */
.hero { position: relative; overflow: hidden; background: #ffffff; border-bottom: 0; }
.hero::before {   /* faint grey grid */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(11, 26, 31, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(11, 26, 31, 0.07) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(120% 120% at 70% 0%, #000 30%, transparent 75%);
}
.hero::after {    /* corner glow */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 120% at 80% 0%, var(--accent-tint), transparent 62%);
  opacity: 0.7;
}
.hero-inner { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: 80px var(--pad) 84px; display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.hero .eyebrow { font-size: 0.78rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); font-weight: 650; margin: 0; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 3.6rem); letter-spacing: -0.03em; line-height: 1.05; color: var(--heading); max-width: 16ch; }
.hero h1 .accent { color: var(--accent); }
.hero p { color: var(--muted); max-width: 60ch; font-size: 1.2rem; }
.hero .buttons { margin-top: 8px; }

/* an eyebrow / kicker line above a heading anywhere */
.eyebrow { font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); font-weight: 650; }

/* cards that end in a call-to-action button pin it to the bottom */
.card:has(.card-cta) { display: flex; flex-direction: column; gap: 12px; }
.card-cta { margin-top: auto; align-self: start; }

/* a one-page site opens straight on a section band — nothing between hero and section */
.hero + main { padding-top: 0; }
main > section:first-child { margin-top: 0; }

/* the last section keeps clear of the footer */
main > section:last-of-type { padding-bottom: 68px; }

/* outbound cards — site cards carry a screenshot, client cards a logo; both put the
   text below and pin the domain to the bottom. Each card carries the linked site's
   own colour as --site-accent: the body is white at the centre and fades radially to
   a very light tint of it at the edge, and the border is a dark version of the same
   colour. */
.site, .client { --site-accent: var(--accent);
  padding: 0; overflow: hidden; display: flex; flex-direction: column; gap: 0;
  border: 2px solid color-mix(in srgb, var(--site-accent) 62%, #10161a); }
.site .shot { aspect-ratio: 1200 / 630; background: var(--surface-soft) center / cover no-repeat; border-bottom: 1px solid color-mix(in srgb, var(--site-accent) 30%, var(--border)); }
/* client cards: the logo, full colour, centred in a fixed-height white panel */
.client .mark { height: 84px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  padding: 0 18px; background: #ffffff; border-bottom: 1px solid color-mix(in srgb, var(--site-accent) 30%, var(--border)); }
.client .mark img { height: 17px; width: auto; max-width: 100%; object-fit: contain; }
.site .body, .client .body { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1;
  background: radial-gradient(115% 130% at 50% 45%, #ffffff 24%, color-mix(in srgb, var(--site-accent) 13%, #ffffff) 100%); }
.site .body h3, .client .body h3 { color: var(--heading); margin: 0; }
.site .body p, .client .body p { color: var(--muted); font-size: 0.95rem; flex: 1; }
.site .body .domain, .client .body .domain { margin-top: 4px; font-family: var(--mono); font-size: 0.85rem;
  color: color-mix(in srgb, var(--site-accent) 70%, #10161a); }
.site .body .domain::after, .client .body .domain::after { content: " ↗" / ""; }
a.card.site:hover, a.card.client:hover { border-color: color-mix(in srgb, var(--site-accent) 88%, #10161a); }
