/* Crawley Makerspace — "Made in Crawley"
   British engineering heritage: naval blue, brass, drafting-paper cream.
   Green / brass / red heritage rule nods to the home nations without flags. */

:root {
  --navy: #14213d;
  --navy-deep: #0d1628;
  --navy-soft: #24365c;
  --brass: #c9a24a;
  --brass-deep: #a8822f;
  --brass-pale: #efe0b9;
  --cream: #f4ecdc;
  --paper: #fbf7ef;
  --ink: #1d2433;
  --ink-soft: #545b69;
  --rule: #ded3bd;
  --green: #1f5a41;
  --red: #b3261e;
  --display: 'Zilla Slab', Rockwell, 'Roboto Slab', Georgia, serif;
  --body: 'Libre Franklin', 'Franklin Gothic Book', 'Helvetica Neue', sans-serif;
  --mono: 'IBM Plex Mono', 'SFMono-Regular', Menlo, monospace;
  --radius: 4px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--cream);
  /* faint drafting-paper grid */
  background-image:
    linear-gradient(rgba(20, 33, 61, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 33, 61, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
}

a {
  color: var(--navy-soft);
  text-decoration-color: var(--brass);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--green);
}

h1,
h2,
h3 {
  font-family: var(--display);
  color: var(--navy);
  line-height: 1.15;
  margin: 0 0 0.5em;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

h3 {
  font-size: 1.3rem;
}

strong {
  font-weight: 700;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass-deep);
  margin: 0 0 0.6em;
}

/* --- header ----------------------------------------------------------------- */

.site-header {
  background: var(--navy);
  color: var(--cream);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--cream);
}

.brand img {
  display: block;
  transition: transform 0.4s ease;
}

.brand:hover img {
  transform: rotate(60deg);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-town {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--brass);
}

.brand-name {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--cream);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 22px;
  font-size: 0.95rem;
  font-weight: 600;
}

.site-nav a {
  color: var(--cream);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--cream);
  border-bottom-color: var(--brass);
}

.site-nav .nav-cta {
  background: var(--brass);
  color: var(--navy);
  padding: 6px 16px;
  border-radius: var(--radius);
  border: 0;
}

.site-nav .nav-cta:hover {
  background: var(--brass-pale);
  color: var(--navy);
}

.heritage-rule {
  display: flex;
  height: 5px;
}

.heritage-rule span {
  flex: 1;
}

.heritage-rule span:nth-child(1) {
  background: var(--green);
}

.heritage-rule span:nth-child(2) {
  background: var(--brass);
}

.heritage-rule span:nth-child(3) {
  background: var(--red);
}

/* --- hero ------------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  background-color: var(--navy-deep);
  /* blueprint grid */
  background-image:
    linear-gradient(rgba(201, 162, 74, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 162, 74, 0.09) 1px, transparent 1px),
    linear-gradient(rgba(201, 162, 74, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 162, 74, 0.05) 1px, transparent 1px),
    radial-gradient(ellipse at 80% 20%, var(--navy-soft), var(--navy-deep) 70%);
  background-size: 140px 140px, 140px 140px, 28px 28px, 28px 28px, 100% 100%;
  color: var(--cream);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(56px, 10vw, 120px) 20px clamp(56px, 9vw, 110px);
}

.hero .eyebrow {
  color: var(--brass);
}

.hero h1 {
  color: var(--cream);
  font-size: clamp(3rem, 9vw, 6.2rem);
  letter-spacing: -0.01em;
  margin: 0 0 0.3em;
}

.hero h1 .underline {
  background-image: linear-gradient(var(--brass), var(--brass));
  background-repeat: no-repeat;
  background-size: 100% 0.12em;
  background-position: 0 92%;
}

.hero-lede {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  max-width: 34em;
  color: rgba(244, 236, 220, 0.88);
  margin: 0 0 1.6em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-note {
  margin: 1.2em 0 0;
  font-size: 0.95rem;
  color: rgba(244, 236, 220, 0.7);
}

.hero-note strong {
  color: var(--brass-pale);
}

.hero-mark {
  position: absolute;
  right: -90px;
  top: 50%;
  width: clamp(280px, 38vw, 480px);
  transform: translateY(-50%) rotate(12deg);
  opacity: 0.14;
  pointer-events: none;
}

.reveal {
  animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.reveal:nth-child(2) {
  animation-delay: 0.08s;
}

.reveal:nth-child(3) {
  animation-delay: 0.16s;
}

.reveal:nth-child(4) {
  animation-delay: 0.24s;
}

.reveal:nth-child(5) {
  animation-delay: 0.32s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: none;
  }
  html {
    scroll-behavior: auto;
  }
  .brand img,
  .tier {
    transition: none;
  }
}

/* --- page body -------------------------------------------------------------- */

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 20px 20px;
}

body.wide main {
  max-width: 1200px;
}

main > section {
  position: relative;
  scroll-margin-top: 110px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--navy);
  border-radius: var(--radius);
  padding: clamp(22px, 4vw, 36px);
  margin-bottom: 28px;
  box-shadow: 0 1px 0 rgba(20, 33, 61, 0.04), 0 10px 30px -18px rgba(20, 33, 61, 0.35);
}

main > section > :last-child {
  margin-bottom: 0;
}

.card-navy {
  background: var(--navy) !important;
  border-color: var(--navy) !important;
  border-top-color: var(--brass) !important;
  color: var(--cream);
}

.card-navy h2 {
  color: var(--cream);
}

.card-navy .eyebrow {
  color: var(--brass);
}

.feature-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.feature-grid li {
  padding: 16px 0 0;
  border-top: 2px solid var(--brass);
  color: var(--ink-soft);
}

.feature-grid strong {
  display: block;
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--navy);
  margin-bottom: 4px;
}

.check-list {
  list-style: none;
  padding: 0;
  columns: 2 240px;
  column-gap: 32px;
}

.check-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 8px;
  break-inside: avoid;
}

.check-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 12px;
  height: 12px;
  background: var(--brass);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}

.project-list {
  padding-left: 1.2em;
}

/* --- buttons ---------------------------------------------------------------- */

button,
.button {
  display: inline-block;
  font-family: var(--body);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
  background-color: var(--navy);
  color: var(--cream);
  padding: 12px 22px;
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

button:hover,
.button:hover {
  background-color: var(--navy-soft);
  border-color: var(--navy-soft);
  color: var(--cream);
}

button:active,
.button:active {
  transform: translateY(1px);
}

.button-brass,
button.button-brass {
  background-color: var(--brass);
  border-color: var(--brass);
  color: var(--navy);
}

.button-brass:hover,
button.button-brass:hover {
  background-color: var(--brass-pale);
  border-color: var(--brass-pale);
  color: var(--navy);
}

.button-ghost {
  background: transparent;
  border-color: rgba(244, 236, 220, 0.5);
  color: var(--cream);
}

.button-ghost:hover {
  background: rgba(244, 236, 220, 0.1);
  border-color: var(--cream);
}

button.secondary {
  background-color: transparent;
  color: var(--navy);
  border-color: var(--navy);
}

button.secondary:hover {
  background-color: var(--navy);
  color: var(--cream);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.link-button {
  background: none;
  border: 0;
  color: var(--navy-soft);
  padding: 0;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--brass);
  text-underline-offset: 3px;
}

.link-button:hover {
  background: none;
  color: var(--green);
}

.link-button.danger {
  color: var(--red);
  text-decoration-color: var(--red);
}

.cta {
  display: inline-block;
}

/* --- membership tiers ------------------------------------------------------- */

.tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin: 24px 0 18px;
}

.tier {
  position: relative;
  background: white;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tier:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px -18px rgba(20, 33, 61, 0.5);
}

.tier h3 {
  margin: 0;
}

.tier ul {
  padding-left: 1.1em;
  flex: 1;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.tier .price {
  font-family: var(--display);
  font-size: 2.3rem;
  font-weight: 700;
  color: var(--navy);
  margin: 6px 0 0;
  line-height: 1.1;
}

.tier .price span {
  font-family: var(--body);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--ink-soft);
}

.tier .alt-price {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.tier .button {
  align-self: flex-start;
}

.tier-featured {
  border: 2px solid var(--navy);
}

.tier-featured::before {
  content: 'Full access';
  position: absolute;
  top: -12px;
  right: 16px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--navy);
  color: var(--brass);
  padding: 3px 10px;
  border-radius: 2px;
}

.tier.founding {
  background: linear-gradient(135deg, #fffaf0, var(--brass-pale));
  border: 1px solid var(--brass);
  border-left: 6px solid var(--brass);
}

.tier.founding:hover {
  transform: none;
}

/* --- forms ------------------------------------------------------------------ */

form {
  display: grid;
  gap: 10px;
}

label {
  font-weight: 600;
  font-size: 0.95rem;
}

input,
textarea,
select {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 10px 12px;
  border: 1px solid #c9bfa8;
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 1px;
}

fieldset {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px 16px;
  background: white;
}

fieldset[hidden] {
  display: none;
}

legend {
  font-family: var(--display);
  font-weight: 700;
  color: var(--navy);
  padding: 0 6px;
}

.choice {
  display: block;
  padding: 8px 0;
  font-weight: 400;
  cursor: pointer;
}

.choice + .choice {
  border-top: 1px dashed var(--rule);
}

.choice input {
  width: auto;
  margin-right: 8px;
  accent-color: var(--navy);
}

.hint {
  display: block;
  margin-left: 24px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.inline-form {
  grid-template-columns: 1fr auto;
}

@media (max-width: 520px) {
  .inline-form {
    grid-template-columns: 1fr;
  }
}

.error {
  background-color: #fbe9e7;
  border-left: 4px solid var(--red);
  color: #7f1d17;
  padding: 10px 14px;
  border-radius: var(--radius);
}

.notice {
  background-color: #e9f2ec;
  border: 1px solid #b8d4c2;
  border-left: 4px solid var(--green);
  padding: 10px 16px;
  border-radius: var(--radius);
}

.fine-print {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.hp {
  position: absolute;
  left: -10000px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.google-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 15px;
  border: 1px solid #c9bfa8;
  border-radius: var(--radius);
  background: white;
  color: #3c4043;
  font-weight: 600;
  text-decoration: none;
}

.google-button:hover {
  background-color: #f8f9fa;
  color: #3c4043;
}

.or {
  text-align: center;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 12px 0;
}

/* --- projects --------------------------------------------------------------- */

.project-card img,
.project img {
  max-width: 100%;
  border-radius: var(--radius);
}

.project-card h3 {
  margin-bottom: 0;
}

.meta {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 0;
}

/* --- account & admin -------------------------------------------------------- */

.admin-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 20px !important;
  border-top-width: 1px !important;
}

.admin-bar form {
  display: inline;
}

.admin-links {
  display: flex;
  gap: 18px;
  align-items: center;
}

.admin-links form,
form.inline {
  display: inline;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stats div {
  background: white;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--brass);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.stats strong {
  display: block;
  font-family: var(--display);
  font-size: 1.9rem;
  color: var(--navy);
}

.csv,
.count {
  font-family: var(--body);
  font-size: 0.55em;
  font-weight: 400;
  color: var(--ink-soft);
}

.csv {
  margin-left: 10px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.86rem;
  background: white;
}

th,
td {
  text-align: left;
  padding: 7px 9px;
  border-bottom: 1px solid #ece4d3;
  vertical-align: top;
}

th {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--paper);
}

tr.muted td {
  color: #9a9a9a;
}

td.actions {
  white-space: nowrap;
}

td.actions form + form {
  margin-left: 10px;
}

table select {
  width: auto;
  padding: 3px 6px;
}

#tier-form {
  margin-bottom: 15px;
}

/* --- footer ----------------------------------------------------------------- */

.site-footer {
  margin-top: 40px;
  background: var(--navy);
  color: rgba(244, 236, 220, 0.8);
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 20px 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-motto {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--cream);
  margin: 0;
  line-height: 1.1;
}

.footer-place {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 4px 0 0;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 0.92rem;
}

.footer-nav a {
  color: var(--cream);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--brass);
}

.footer-copy {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 24px;
  font-size: 0.8rem;
  color: rgba(244, 236, 220, 0.5);
}

@media (max-width: 700px) {
  .site-header {
    position: static;
  }
  main > section {
    scroll-margin-top: 16px;
  }
  .site-nav {
    gap: 4px 16px;
    font-size: 0.9rem;
  }
}

/* --- project write-ups ------------------------------------------------------ */

.project h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.75rem);
  margin-top: 1.6em;
  scroll-margin-top: 110px;
}

.project > h2:first-of-type {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-top: 0;
}

.project h3 {
  margin-top: 1.4em;
  scroll-margin-top: 110px;
}

.project hr {
  border: 0;
  height: 1px;
  background: var(--rule);
  margin: 2.2em 0 0;
}

.project table {
  margin: 1em 0 1.4em;
  border: 1px solid var(--rule);
  font-size: 0.92rem;
}

.project td {
  line-height: 1.45;
}

.project blockquote {
  margin: 1.4em 0;
  padding: 14px 18px;
  background: #fdf3e1;
  border-left: 5px solid var(--brass);
  border-radius: var(--radius);
}

.project blockquote p {
  margin: 0;
}

.project code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: #efe7d6;
  padding: 1px 5px;
  border-radius: 3px;
}

.project li {
  margin-bottom: 0.35em;
}

.project .table-scroll {
  overflow-x: auto;
}

@media (max-width: 700px) {
  .project h2,
  .project h3 {
    scroll-margin-top: 16px;
  }
  .project table {
    display: block;
    overflow-x: auto;
  }
}

.parts-box {
  margin: 1.4em 0 0.6em;
  padding: 18px 22px;
  background: white;
  border: 1px solid var(--rule);
  border-left: 5px solid var(--navy);
  border-radius: var(--radius);
}

.parts-box h3 {
  margin: 0 0 0.4em;
}

.parts-box ul {
  columns: 2 260px;
  column-gap: 28px;
  padding-left: 1.1em;
  margin: 0 0 0.8em;
}

.parts-box li {
  break-inside: avoid;
}

.hint-inline {
  color: var(--ink-soft);
  font-size: 0.9em;
}

.parts-box .fine-print {
  margin: 0;
}

/* project photos: portrait phone shots, so cap the height */
.project img {
  display: block;
  max-width: 100%;
  max-height: 560px;
  width: auto;
  height: auto;
  margin: 1.2em auto 0.4em;
  border-radius: var(--radius);
  box-shadow: 0 10px 28px -16px rgba(20, 33, 61, 0.55);
}

.project p:has(> img) {
  text-align: center;
}

.project p:has(> img) em {
  display: block;
  font-style: normal;
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-top: 6px;
}

.project-thumb img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 14px;
}
