/* Emerytury.co.uk — calm, readable, accessible. No web fonts, no tracking. */
:root {
  --ink: #17212b;
  --ink-soft: #3d4a57;
  --bg: #fbf8f3;
  --surface: #ffffff;
  --line: #d9d2c5;
  --brand: #124e66;
  --brand-deep: #0b3547;
  --brand-tint: #e7f1f4;
  --sun: #f2b65a;
  --sun-tint: #fdf2df;
  --warn: #8a4b08;
  --warn-tint: #fdf1e2;
  --green: #2f5d34;
  --green-tint: #edf5ec;
  --focus: #ffcf6e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 33, 43, .06), 0 6px 20px rgba(23, 33, 43, .06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1.5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 1.125rem; line-height: 1.7;
  overflow-wrap: break-word;
}
@media (min-width: 48em) { body { font-size: 1.1875rem; } }
img, svg { max-width: 100%; height: auto; }
.wrap { width: min(100% - 2.5rem, 72rem); margin-inline: auto; }
.narrow { max-width: 46rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* Links & focus */
a { color: var(--brand); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--brand-deep); text-decoration-thickness: .14em; }
a.ext::after { content: "↗"; display: inline-block; margin-left: .2em; font-size: .85em; text-decoration: none; }
:focus-visible { outline: 3px solid var(--brand-deep); outline-offset: 3px; box-shadow: 0 0 0 7px var(--focus); border-radius: 4px; }
main:focus { outline: none; }
.skip-link { position: absolute; left: 1rem; top: -10rem; z-index: 10; background: var(--brand-deep); color: #fff; padding: .8rem 1.2rem; border-radius: 8px; font-weight: 700; }
.skip-link:focus { top: 1rem; color: #fff; }

/* Headings */
h1, h2, h3, .h3 { font-family: var(--serif); color: var(--brand-deep); line-height: 1.22; font-weight: 700; letter-spacing: -.005em; }
h1 { font-size: clamp(2rem, 1.35rem + 2.6vw, 3.1rem); margin: .3em 0 .45em; }
h2 { font-size: clamp(1.6rem, 1.3rem + 1.1vw, 2.1rem); margin: 2.4em 0 .6em; }
h3, .h3 { font-size: clamp(1.3rem, 1.15rem + .6vw, 1.55rem); margin: 1.8em 0 .5em; }
p, ul, ol { margin: 0 0 1.1em; }
li + li { margin-top: .45em; }
strong { font-weight: 700; }
.small { font-size: .95rem; color: var(--ink-soft); }
.lead { font-size: 1.22em; line-height: 1.6; color: var(--ink); }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; margin: 0; font-weight: 700; font-size: .95rem; letter-spacing: .02em; color: var(--brand); text-transform: uppercase; }
.icon-inline { width: 1.2em; height: 1.2em; vertical-align: -.22em; flex: none; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.75rem; }
.logo { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--brand-deep); min-height: 48px; }
.logo-mark { width: 2.5rem; height: 2.5rem; flex: none; }
.logo-text { font-family: var(--serif); font-weight: 700; font-size: 1.35rem; letter-spacing: -.01em; }
.logo-tld { color: var(--ink-soft); font-weight: 400; }
.main-nav ul, .mobile-menu ul, .site-footer ul { list-style: none; margin: 0; padding: 0; }
.main-nav ul { display: flex; gap: .25rem; }
.main-nav li + li, .mobile-menu li + li { margin-top: 0; }
.main-nav a { display: flex; align-items: center; min-height: 48px; padding: .4rem .85rem; border-radius: 10px; text-decoration: none; font-weight: 600; color: var(--ink); font-size: 1rem; }
.main-nav a:hover { background: var(--brand-tint); color: var(--brand-deep); }
.main-nav a[aria-current="page"] { background: var(--brand-tint); color: var(--brand-deep); box-shadow: inset 0 -3px 0 var(--brand); }
.mobile-menu { display: none; }
@media (max-width: 62em) {
  .main-nav { display: none; }
  .mobile-menu { display: block; }
  .mobile-menu summary { display: flex; align-items: center; gap: .6rem; min-height: 48px; min-width: 48px; padding: .5rem 1rem; border: 2px solid var(--brand); border-radius: 10px; font-weight: 700; color: var(--brand-deep); cursor: pointer; list-style: none; }
  .mobile-menu summary::-webkit-details-marker { display: none; }
  .menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 1.2rem; height: 2px; background: currentColor; border-radius: 2px; position: relative; }
  .menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
  .menu-icon::before { top: -6px; } .menu-icon::after { top: 6px; }
  .mobile-menu[open] .menu-icon { background: transparent; }
  .mobile-menu[open] .menu-icon::before { top: 0; transform: rotate(45deg); }
  .mobile-menu[open] .menu-icon::after { top: 0; transform: rotate(-45deg); }
  .mobile-menu nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); padding: .75rem 1.25rem 1.25rem; }
  .mobile-menu nav a { display: flex; align-items: center; min-height: 52px; padding: .5rem .75rem; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 1.125rem; color: var(--ink); border-bottom: 1px solid #eee7da; }
  .mobile-menu nav a[aria-current="page"] { background: var(--brand-tint); color: var(--brand-deep); }
}

/* Buttons */
.button { display: inline-flex; align-items: center; gap: .55rem; min-height: 52px; padding: .75rem 1.4rem; border-radius: 12px; background: var(--brand); color: #fff; font-weight: 700; text-decoration: none; }
.button:hover { background: var(--brand-deep); color: #fff; }

/* Home */
.hero { background: linear-gradient(180deg, #fff 0%, var(--bg) 100%); border-bottom: 1px solid var(--line); padding: clamp(2.5rem, 6vw, 5rem) 0; }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 60em) { .hero-grid { grid-template-columns: 1.25fr .9fr; } }
.hero h1 { max-width: 20ch; }
.hero .lead { max-width: 40rem; }
.hero-art svg { width: 100%; height: auto; display: block; }
@media (max-width: 59.99em) { .hero-art { max-width: 26rem; } }
.choose, .figures, .principles, .related { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.choose h2, .figures h2, .related h2 { margin-top: 0; }
.section-lead { max-width: 44rem; color: var(--ink-soft); }
.guide-grid { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16.5rem), 1fr)); }
.guide-grid li + li { margin-top: 0; }
.guide-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-top: 6px solid var(--tone, var(--brand)); border-radius: var(--radius); padding: 1.5rem 1.4rem 1.35rem; box-shadow: var(--shadow); }
.guide-card:hover { border-color: var(--tone, var(--brand)); }
.guide-card:focus-within { box-shadow: 0 0 0 4px var(--focus), var(--shadow); }
.tone-teal { --tone: #124e66; --tone-tint: #e7f1f4; }
.tone-sun { --tone: #9a5b0f; --tone-tint: #fdf2df; }
.tone-green { --tone: #2f5d34; --tone-tint: #edf5ec; }
.tone-plum { --tone: #6b3a5b; --tone-tint: #f6ecf3; }
.guide-icon { display: inline-grid; place-items: center; width: 3.4rem; height: 3.4rem; border-radius: 12px; background: var(--tone-tint); color: var(--tone); margin-bottom: 1rem; }
.guide-title { margin: 0 0 .4rem; font-size: 1.4rem; }
.guide-title a { color: var(--brand-deep); text-decoration: none; }
.guide-title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.guide-title a:focus-visible { box-shadow: none; outline: none; }
.guide-question { font-weight: 700; color: var(--tone); margin-bottom: .5rem; }
.guide-desc { color: var(--ink-soft); margin-bottom: 1rem; }
.guide-more { margin-top: auto; display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; color: var(--tone); }
.guide-card:hover .guide-title a { text-decoration: underline; }
.figures { background: var(--brand-deep); color: #fff; }
.figures h2 { color: #fff; }
.figure-list { list-style: none; padding: 0; margin: 1.5rem 0 1.25rem; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.figure-list li { margin: 0; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.22); border-radius: var(--radius); padding: 1.2rem 1.25rem; }
.figure-list strong { display: block; font-family: var(--serif); font-size: 1.9rem; line-height: 1.15; color: var(--sun); }
.figure-list span { display: block; margin-top: .35rem; color: #eef3f5; font-size: 1.02rem; }
.figures .small { color: #d6e2e7; }
.principles-grid { display: grid; gap: 2rem; }
@media (min-width: 60em) { .principles-grid { grid-template-columns: 1.3fr 1fr; align-items: start; } }
.principles h2 { margin-top: 0; }
.check-list { list-style: none; padding: 0; }
.check-list li { position: relative; padding-left: 2.2rem; margin-top: 1rem; }
.check-list li::before { content: ""; position: absolute; left: 0; top: .35em; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--green-tint) no-repeat center/70% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f5d34' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E"); border: 1px solid #b8d2b5; }
.official-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.official-box h2 { margin-top: 0; }
.official-box ul { padding-left: 1.2rem; }
.official-box a { display: inline-block; padding: .2rem 0; }

/* Article */
.article-header { background: #fff; border-bottom: 1px solid var(--line); padding: 1.25rem 0 2rem; }
.article-header h1 { max-width: 30ch; }
.article-intro { max-width: 46rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem .5rem; padding: 0; margin: 0 0 1.25rem; font-size: 1rem; color: var(--ink-soft); }
.breadcrumbs li { margin: 0; }
.breadcrumbs li + li::before { content: "›"; margin-right: .5rem; color: var(--ink-soft); }
.breadcrumbs a { display: inline-block; padding: .35rem 0; }
.meta-row { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.meta-row li { margin: 0; background: var(--brand-tint); color: var(--brand-deep); border-radius: 999px; padding: .35rem .95rem; font-size: 1rem; }
.article-layout { display: grid; gap: 2rem; padding-top: 2rem; padding-bottom: 1rem; }
@media (min-width: 70em) {
  .article-layout { grid-template-columns: 17.5rem minmax(0, 46rem); justify-content: space-between; gap: 3.5rem; }
  .toc { position: sticky; top: 1.25rem; align-self: start; max-height: calc(100vh - 2.5rem); overflow: auto; }
}
.toc details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem 1.1rem 1rem; }
.toc summary { cursor: pointer; font-family: var(--serif); font-weight: 700; font-size: 1.25rem; color: var(--brand-deep); min-height: 48px; display: flex; align-items: center; }
.toc ol { margin: .25rem 0 0; padding-left: 1.5rem; font-size: 1rem; line-height: 1.45; }
.toc li { margin-top: .15rem; }
.toc a { display: block; padding: .38rem 0; text-decoration: none; color: var(--ink); }
.toc a:hover { color: var(--brand); text-decoration: underline; }
.prose { min-width: 0; max-width: 46rem; }
.prose > h2:first-child { margin-top: .2em; }
.prose h2 { padding-top: 1.4rem; border-top: 1px solid var(--line); }
.prose ul, .prose ol { padding-left: 1.5rem; }
.prose li::marker { color: var(--brand); font-weight: 700; }

/* Callouts & figures */
.callout, .disclaimer { border-radius: var(--radius); padding: 1.1rem 1.25rem .35rem; margin: 1.6rem 0; border: 1px solid; border-left-width: 6px; }
.callout-title { font-weight: 800; margin-bottom: .4rem; display: flex; align-items: center; gap: .45rem; text-transform: uppercase; letter-spacing: .03em; font-size: .95rem; }
.callout-note { background: var(--brand-tint); border-color: #bcd5de; border-left-color: var(--brand); }
.callout-note .callout-title { color: var(--brand-deep); }
.callout-warn { background: var(--warn-tint); border-color: #efcfa7; border-left-color: var(--warn); }
.callout-warn .callout-title { color: var(--warn); }
.callout-example { background: var(--green-tint); border-color: #c6dcc3; border-left-color: var(--green); }
.callout-example .callout-title { color: var(--green); }
.callout-key { background: var(--sun-tint); border-color: #f0d3a4; border-left-color: #c47f14; }
.callout-key .callout-title { color: #7a4a06; }
.disclaimer { background: #f4f1ea; border-color: var(--line); border-left-color: var(--ink-soft); margin-top: 3rem; }
.disclaimer .callout-title { color: var(--ink); }
.figure-box { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem 1rem; background: var(--surface); border: 2px solid var(--brand); border-radius: var(--radius); padding: 1rem 1.25rem; }
.figure-value { font-family: var(--serif); font-size: 2rem; line-height: 1.1; color: var(--brand-deep); }
.figure-caption { color: var(--ink-soft); }

/* Tables */
.table-wrap { max-width: 100%; overflow-x: auto; margin: 1.5rem 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 1.02rem; line-height: 1.45; }
caption { text-align: left; padding: .85rem 1rem .25rem; font-weight: 700; color: var(--brand-deep); }
th, td { padding: .8rem 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid #ebe5d9; }
thead th { background: var(--brand-tint); color: var(--brand-deep); font-weight: 700; }
tbody th { font-weight: 600; }
tbody tr:last-child > * { border-bottom: 0; }
th.num { text-align: right; }
td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 30em) { th, td { padding: .7rem .75rem; } }

/* Simple pages */
.simple { padding: 1.5rem 0 3rem; }
.simple .prose { max-width: none; }
.simple .guide-grid { margin-bottom: 2rem; }

/* Related & footer */
.related { background: #f3efe7; border-top: 1px solid var(--line); margin-top: 2rem; }
.site-footer { background: #10232e; color: #e7eef1; padding: 3rem 0 1.5rem; font-size: 1.02rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--sun); }
.site-footer :focus-visible { outline-color: #fff; }
.footer-grid { display: grid; gap: 2rem; }
@media (min-width: 50em) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; } }
.logo-footer { color: #fff; }
.logo-footer .logo-tld { color: #c4d3da; }
.footer-lead { color: #c9d6dc; max-width: 30rem; margin-top: 1rem; }
.footer-heading { font-weight: 800; color: #fff; margin-bottom: .5rem; }
.site-footer li { margin: 0; }
.site-footer li a { display: inline-block; padding: .4rem 0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.18); margin-top: 2rem; padding-top: 1.25rem; display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between; color: #c9d6dc; font-size: .98rem; }
.footer-bottom p { margin: 0; max-width: 52rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .guide-card, .callout, .disclaimer, .toc details, .table-wrap { border: 1px solid CanvasText; }
  .button { border: 2px solid ButtonText; }
}
@media print {
  .site-header, .toc, .related, .site-footer, .skip-link { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  a.ext::after { content: " (" attr(href) ")"; font-size: .85em; }
}

/* Small screens: keep logo + menu within 320–400 px viewports */
@media (max-width: 26em) {
  .wrap { width: min(100% - 2rem, 72rem); }
  .logo { gap: .5rem; }
  .logo-mark { width: 2.25rem; height: 2.25rem; }
  .logo-text { font-size: 1.12rem; }
  .mobile-menu summary { padding: .5rem .75rem; gap: .5rem; }
}
.footer-bottom a { display: inline-flex; align-items: center; min-height: 44px; }
