/* tonyhine.co.uk — warm teal / slate personal brand */
:root,
[data-theme="light"] {
  --bg: #f6f8f9;
  --bg-elevated: #ffffff;
  --text: #1a2b33;
  --text-muted: #5a6d76;
  --border: #d5e0e5;
  --primary: #0d7a7a;
  --primary-hover: #0a6363;
  --accent: #c45c26;
  --hero-grad: linear-gradient(135deg, #0d7a7a 0%, #1a4a5c 55%, #0f2a36 100%);
  --shadow: 0 8px 24px rgba(26, 43, 51, 0.08);
  --focus: #0d7a7a;
  --radius: 12px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --max: 1100px;
  --header-h: 4rem;
}

[data-theme="dark"] {
  --bg: #0f171b;
  --bg-elevated: #172227;
  --text: #e8eef1;
  --text-muted: #9aafb8;
  --border: #2a3a42;
  --primary: #3ecfcf;
  --primary-hover: #6adede;
  --accent: #e08a55;
  --hero-grad: linear-gradient(135deg, #0a3d3d 0%, #122830 55%, #0a1418 100%);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --focus: #3ecfcf;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--primary-hover); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--primary);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 1000;
  border-radius: 6px;
}
.skip-link:focus { left: 0.5rem; }

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.logo {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo span { color: var(--primary); }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
}

.nav-wrap {
  display: none;
  position: absolute;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 1rem;
}

.nav-wrap.is-open { display: block; }

.site-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-weight: 500;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.theme-toggle:hover { border-color: var(--primary); }

@media (min-width: 800px) {
  .nav-toggle { display: none; }
  .nav-wrap {
    display: block !important;
    position: static;
    border: 0;
    padding: 0;
    background: transparent;
  }
  .site-nav {
    flex-direction: row;
    align-items: center;
    gap: 0.15rem;
  }
  .header-inner { gap: 2rem; }
  .site-nav { margin-left: auto; }
}

/* Hero */
.hero {
  background: var(--hero-grad);
  color: #f3fafa;
  padding: 3.5rem 0 3.75rem;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -40% 40%;
  height: 80%;
  background: radial-gradient(circle, rgba(62, 207, 207, 0.25), transparent 60%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  max-width: 16ch;
}
.hero .lead {
  margin: 0 0 1.5rem;
  font-size: 1.1rem;
  max-width: 42ch;
  opacity: 0.92;
  line-height: 1.7;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.chip {
  display: inline-flex;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.85rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.2rem;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: #fff;
  color: #0a4a4a;
}
.btn-primary:hover { background: #e8f7f7; color: #0a4a4a; }
.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.btn-solid {
  background: var(--primary);
  color: #fff;
}
.btn-solid:hover { background: var(--primary-hover); color: #fff; }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

/* Sections */
main { flex: 1; }
.section { padding: 3rem 0; }
.section-alt { background: var(--bg-elevated); border-block: 1px solid var(--border); }
.section h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  letter-spacing: -0.02em;
}
.section .section-intro {
  margin: 0 0 1.75rem;
  color: var(--text-muted);
  max-width: 55ch;
}

.grid-3 {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 700px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}
.card h3 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.card p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }
.card .card-link {
  display: inline-block;
  margin-top: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}
.card .icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  color: var(--primary);
  display: grid;
  place-items: center;
  margin-bottom: 0.85rem;
  font-weight: 700;
  font-size: 0.85rem;
}

.prose { max-width: 68ch; }
.prose h2, .prose h3 { margin-top: 1.75rem; }
.prose p, .prose li { color: var(--text); }
.prose .muted { color: var(--text-muted); }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }

.timeline {
  border-left: 2px solid var(--border);
  margin: 1.5rem 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 1.25rem;
}
.timeline-item strong { display: block; color: var(--primary); font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; }
.timeline-item h3 { margin: 0.2rem 0 0.35rem; font-size: 1.05rem; }
.timeline-item p { margin: 0; color: var(--text-muted); }

/* Form */
.form {
  display: grid;
  gap: 1rem;
  max-width: 32rem;
}
.form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
}
.form input,
.form textarea {
  font: inherit;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}
.form input:focus,
.form textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--primary);
}
.form textarea { min-height: 8rem; resize: vertical; }
.form-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 40ch;
}
.form-success {
  display: none;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
  color: var(--text);
}
.form-success.is-visible { display: block; }

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 2rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.footer-inner a { color: var(--text-muted); }
.footer-inner a:hover { color: var(--primary); }
@media (min-width: 700px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.page-hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
}
.page-hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.02em;
}
.page-hero p {
  margin: 0;
  color: var(--text-muted);
  max-width: 50ch;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.project-grid {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 700px) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}
.project-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.85rem;
}
.tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  font-weight: 600;
}
