/* Tinwhistle Trading site
   Warm paper and painted-wood colours, like a toy shop shelf. */

/* Self-hosted variable fonts (latin subset, SIL Open Font License) */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/fraunces-latin-var.woff2") format("woff2");
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/fonts/figtree-latin-var.woff2") format("woff2");
}

:root {
  --paper: #FBF5EA;
  --paper-2: #F3E9D6;
  --panel: #FFFDF8;
  --ink: #2B2420;
  --ink-2: #5E524A;
  --ink-3: #8A7D72;
  --line: #E6D9C3;

  --red: #D24B35;
  --red-deep: #A8371F;
  --yellow: #F0B23E;
  --yellow-deep: #D9962A;
  --teal: #2E8A80;
  --teal-deep: #1F6A62;
  --blue: #3F6DB3;
  --wood: #C98C52;

  --display: "Fraunces", Georgia, serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --t-sm: 0.9rem;
  --t-base: 1.0625rem;
  --t-md: 1.1875rem;
  --t-lg: 1.5rem;
  --t-xl: clamp(2rem, 1.4rem + 2vw, 3rem);
  --t-hero: clamp(3rem, 1.6rem + 5vw, 5.6rem);

  --wrap: 1180px;
  --gutter: clamp(20px, 4vw, 40px);
  --radius: 14px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; }
a { color: inherit; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 620;
  font-optical-sizing: auto;
  /* Soft, slightly wonky letterforms: friendly without being childish */
  font-variation-settings: "SOFT" 100, "WONK" 1;
  text-wrap: balance;
}

.nowrap { white-space: nowrap; }

/* Keep anchored sections clear of the sticky header */
[id] { scroll-margin-top: 70px; }

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
  z-index: 10;
  text-decoration: none;
}
.skip:focus { top: 12px; }

.eyebrow {
  color: var(--red-deep);
  font-size: var(--t-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---- Buttons and links ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 0 var(--red-deep);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--red-deep); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--red-deep); }
.btn-small {
  min-height: 40px;
  padding: 0 18px;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--t-sm);
}
.btn-small:hover { background: #000; }
.btn-light { background: var(--paper); color: var(--teal-deep); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18); }
.btn-light:hover { background: #fff; }

.text-link {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--yellow);
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}
.text-link:hover { text-decoration-color: var(--red); }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn-primary:hover, .btn-primary:active { transform: none; }
}

/* ---- Header ---- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.3) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 70px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  text-decoration: none;
  font-family: var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.brand img { width: 34px; height: 34px; }
.brand em { font-style: normal; font-weight: 420; color: var(--ink-2); }
.site-nav { display: flex; gap: 28px; margin-left: auto; }
.site-nav a { color: var(--ink-2); font-size: var(--t-sm); font-weight: 600; text-decoration: none; }
.site-nav a:hover { color: var(--red-deep); }

.nav-toggle { display: none; }
.narrow-only { display: none; }

@media (max-width: 860px) {
  .header-inner { gap: 10px; }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    margin-left: auto;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--ink);
    font: inherit;
    font-size: var(--t-sm);
    font-weight: 600;
    cursor: pointer;
  }
  .nav-toggle[aria-expanded="true"] { background: var(--paper-2); }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 8px var(--gutter) 16px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px 0; font-size: var(--t-base); color: var(--ink); }
  .site-nav a + a { border-top: 1px solid var(--line); }
}
@media (max-width: 480px) {
  .brand em { display: none; }
  .header-cta { padding: 0 14px; }
  .wide-only { display: none; }
  .narrow-only { display: inline; }
}
/* Pages without the menu (404): push the button right */
.header-inner > .brand + .header-cta { margin-left: auto; }

/* ---- Hero ---- */

.hero { padding: clamp(40px, 6vw, 80px) 0 clamp(56px, 8vw, 96px); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero h1 {
  margin-top: 14px;
  font-size: var(--t-hero);
  font-weight: 640;
  line-height: 0.98;
  letter-spacing: -0.025em;
}
.lede { margin-top: 24px; max-width: 30em; color: var(--ink-2); font-size: var(--t-md); line-height: 1.6; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 32px;
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .shelf { max-width: 560px; }
}

/* ---- Shelf illustration ---- */

.shelf svg { width: 100%; height: auto; overflow: visible; }
.wall { fill: var(--paper-2); }
.plank { fill: var(--wood); }
.plank-edge { fill: #A86F3C; }
.c-red { fill: var(--red); }
.c-blue { fill: var(--blue); }
.c-yellow { fill: var(--yellow); }
.c-yellow-deep { fill: var(--yellow-deep); }
.c-teal { fill: var(--teal); }
.c-teal-deep { fill: var(--teal-deep); }
.c-wood { fill: var(--wood); }
.c-ink { fill: var(--ink); }
.c-paper { fill: var(--panel); }
.c-paper-2 { fill: var(--paper); }
.string { fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linecap: round; }
.stick { stroke: var(--wood); stroke-width: 6; stroke-linecap: round; }
.zigzag { fill: none; stroke: var(--yellow); stroke-width: 5; stroke-linejoin: round; stroke-linecap: round; }
.drum-rim { fill: none; stroke: var(--red); stroke-width: 5; }
.block-letter {
  fill: #fff;
  font-family: var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: 34px;
  font-weight: 700;
  text-anchor: middle;
}
.block-letter-dark { fill: var(--ink); }
.puff { fill: #fff; opacity: 0.9; }

/* Gentle movement: the top wobbles on its tip, the yo-yo bobs, the train puffs.
   Everything is still for people who ask for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .top { transform-box: view-box; transform-origin: 230px 212px; animation: wobble 2.4s ease-in-out infinite; }
  .yoyo { animation: bob 3.2s ease-in-out infinite; }
  .yoyo .string { transform-box: fill-box; transform-origin: top; animation: stretch 3.2s ease-in-out infinite; }
  .yoyo circle { animation: none; }
  .puff { transform-box: fill-box; transform-origin: center; animation: puff 3s ease-out infinite; }
  .puff-2 { animation-delay: 0.5s; }
  .puff-3 { animation-delay: 1s; }
}
@keyframes wobble {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}
/* The string is pinned at the top of the shelf, so it shortens while the yo-yo rises */
@keyframes stretch {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(18px) scaleY(0.86); }
}
@keyframes puff {
  0% { opacity: 0; transform: scale(0.5); }
  30% { opacity: 0.9; }
  100% { opacity: 0; transform: scale(1.2) translateY(-8px); }
}

/* ---- Who we supply ---- */

.buyers { background: var(--ink); color: var(--paper); }
.buyers-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  padding-top: 34px;
  padding-bottom: 34px;
}
.buyers-title { font-size: var(--t-lg); line-height: 1.2; }
.buyers-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.buyers-list li { display: grid; gap: 4px; padding-left: 16px; border-left: 3px solid var(--yellow); }
.buyers-list li:nth-child(2) { border-color: var(--red); }
.buyers-list li:nth-child(3) { border-color: var(--teal); }
.buyers-list strong { font-weight: 700; }
.buyers-list span { color: #D9CDBB; font-size: var(--t-sm); line-height: 1.5; }
@media (max-width: 900px) {
  .buyers-inner { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .buyers-list { grid-template-columns: 1fr; gap: 18px; }
}

/* ---- Sections ---- */

.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-alt { background: var(--paper-2); }
.section h2 { font-size: var(--t-xl); line-height: 1.1; letter-spacing: -0.02em; }
.section-head { display: grid; gap: 14px; max-width: 40em; }
.section-head p:not(.eyebrow) { color: var(--ink-2); font-size: var(--t-md); }

/* Range cards are shaped like swing tags, with a punched hole */
.tags {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2.5vw, 32px);
  margin-top: 48px;
}
.tag {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 48px 28px 28px;
  border-radius: var(--radius);
  background: var(--panel);
  border-top: 10px solid var(--tag-colour);
  box-shadow: 0 1px 0 var(--line), 0 10px 24px -18px rgba(43, 36, 32, 0.45);
}
.tag::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 28px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 3px var(--tag-colour);
}
.tag-red { --tag-colour: var(--red); }
.tag-yellow { --tag-colour: var(--yellow); }
.tag-teal { --tag-colour: var(--teal); }
.tag h3 { font-size: var(--t-lg); line-height: 1.2; }
.tag p { color: var(--ink-2); }
.tag .tag-examples {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  color: var(--ink-3);
  font-size: var(--t-sm);
}
@media (max-width: 900px) {
  .tags { grid-template-columns: 1fr; max-width: 560px; }
}

/* How we choose: three questions, numbered like building blocks */
.questions {
  counter-reset: q;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 56px);
  margin-top: 48px;
}
.questions li { counter-increment: q; }
.questions li::before {
  content: counter(q);
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
  border-radius: 10px;
  background: var(--q-colour, var(--red));
  color: #fff;
  font-family: var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: 1.6rem;
  font-weight: 700;
  transform: rotate(-4deg);
}
.questions li:nth-child(2) { --q-colour: var(--blue); }
.questions li:nth-child(2)::before { transform: rotate(3deg); }
.questions li:nth-child(3) { --q-colour: var(--teal); }
.questions h3 { font-size: var(--t-lg); line-height: 1.2; }
.questions p { margin-top: 10px; color: var(--ink-2); }
@media (max-width: 820px) {
  .questions { grid-template-columns: 1fr; max-width: 560px; }
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(28px, 6vw, 96px);
  align-items: start;
}
.split h2 { margin-top: 14px; }
.split-note { margin-top: 16px; max-width: 24em; color: var(--ink-2); font-size: var(--t-md); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.promises li {
  position: relative;
  padding: 20px 0 20px 40px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-size: var(--t-md);
  line-height: 1.55;
}
.promises li:first-child { padding-top: 0; }
.promises strong { color: var(--ink); font-weight: 700; }
/* A small round "checked" sticker */
.promises li::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(20px + 0.2em);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--yellow) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M6.5 11.5l3 3 6-7' fill='none' stroke='%232B2420' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 22px no-repeat;
}
.promises li:first-child::before { top: 0.2em; }

/* Mission line */
.mission { padding: clamp(56px, 8vw, 96px) 0; border-top: 1px solid var(--line); }
.mission-quote {
  max-width: 22em;
  margin: 0 auto;
  font-family: var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.5rem);
  font-weight: 480;
  line-height: 1.25;
  text-align: center;
  text-wrap: balance;
}

/* Contact */
.contact { padding: clamp(64px, 9vw, 104px) 0; background: var(--teal-deep); color: var(--paper); }
.contact-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: start;
}
.contact h2 { font-size: var(--t-xl); line-height: 1.1; letter-spacing: -0.02em; }
.contact-tagline {
  margin-top: 14px;
  color: var(--yellow);
  font-family: var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: var(--t-lg);
}
.contact-body p { color: #D3E6E3; font-size: var(--t-md); }
.contact-body .btn { margin-top: 26px; }
.contact :focus-visible { outline-color: var(--yellow); }
@media (max-width: 860px) { .contact-inner { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { padding: 28px 0 36px; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  color: var(--ink-3);
  font-size: var(--t-sm);
}
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-inner a { text-decoration: none; }
.footer-inner a:hover { color: var(--ink); }

/* ---- 404 ---- */

.notfound { padding: 120px var(--gutter); }
.notfound h1 { margin-top: 10px; font-size: var(--t-xl); line-height: 1.1; }
.notfound p:not(.eyebrow) { margin-top: 12px; color: var(--ink-2); }
.notfound .btn { margin-top: 28px; }
