/* ==========================================================================
   Tinkery — site stylesheet
   Built on the Tinkery Brand Kit v1 design tokens.
   Single file, no build step, no third-party requests.
   ========================================================================== */

/* ---------- 1. Fonts (self-hosted, subset to Latin) ---------------------- */

@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/montserrat-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/montserrat-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}

/* ---------- 2. Design tokens -------------------------------------------- */

:root {
  /* brand colours */
  --tk-blue-50:#F5F9FE;  --tk-blue-100:#E2EDFE; --tk-blue-200:#C5DBFC;
  --tk-blue-300:#9FC2FA;  --tk-blue-400:#6FA8FA; --tk-blue-500:#3F86F5;
  --tk-blue-600:#3672D0;  --tk-blue-700:#2C5EAC; --tk-blue-800:#234A87;
  --tk-blue-900:#193662;

  --tk-red-500:#DB4233;   --tk-red-600:#BA382B;  --tk-red-700:#992E24;
  --tk-green-500:#069F57; --tk-green-600:#05874A;
  --tk-yellow-400:#F8C742; --tk-yellow-500:#F5B403; --tk-yellow-800:#876302;

  --tk-neutral-50:#FBFBFB;  --tk-neutral-100:#F8F6F6; --tk-neutral-200:#E8E6E6;
  --tk-neutral-300:#C6C5C5; --tk-neutral-400:#A7A5A6; --tk-neutral-500:#888486;
  --tk-neutral-600:#696766; --tk-neutral-700:#4F4C4D; --tk-neutral-800:#393536;
  --tk-neutral-900:#231F20;

  /* semantic */
  --ink:            var(--tk-neutral-900);
  --ink-muted:      var(--tk-neutral-600);
  --surface:        #FFFFFF;
  --surface-alt:    var(--tk-neutral-100);
  --surface-invert: var(--tk-neutral-900);
  --border:         var(--tk-neutral-200);

  /* action colours — WCAG AA (4.5:1+) with white text */
  --action:        var(--tk-blue-600);
  --action-hover:  var(--tk-blue-700);
  --action-quiet:  var(--tk-blue-50);

  /* type */
  --font-heading: 'Montserrat', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-body:    'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --text-sm:   0.8rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.375rem;
  --text-2xl:  1.75rem;
  --text-3xl:  2.25rem;
  --text-4xl:  2.9rem;

  /* space + shape */
  --sp-1: .25rem; --sp-2: .5rem;  --sp-3: .75rem; --sp-4: 1rem;
  --sp-5: 1.5rem; --sp-6: 2rem;   --sp-7: 3rem;   --sp-8: 4rem;
  --sp-9: 6rem;
  --radius: 4px;
  --radius-lg: 8px;
  --measure: 65ch;
  --container: 1140px;
  --shadow: 0 1px 3px rgba(35,31,32,.07), 0 6px 20px rgba(35,31,32,.06);
}

/* ---------- 3. Reset ----------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration:.01ms !important; transition-duration:.01ms !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
h1,h2,h3,h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 var(--sp-4);
  text-wrap: balance;
}
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); font-weight: 600; }
p  { margin: 0 0 var(--sp-4); max-width: var(--measure); }
a  { color: var(--action); text-underline-offset: 2px; }
a:hover { color: var(--action-hover); }
ul, ol { padding-left: 1.15rem; }
li { margin-bottom: var(--sp-2); }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--sp-7) 0; }

:focus-visible {
  outline: 3px solid var(--tk-blue-500);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-heading); font-weight: 600;
}
.skip-link:focus { left: var(--sp-4); top: var(--sp-4); color: #fff; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- 4. Layout ---------------------------------------------------- */

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--sp-5); }
.container--narrow { max-width: 760px; }

section { padding-block: var(--sp-8); }
@media (min-width: 800px) { section { padding-block: var(--sp-9); } }

.section--alt    { background: var(--surface-alt); }
.section--invert { background: var(--surface-invert); color: #fff; }
.section--invert h1, .section--invert h2, .section--invert h3 { color: #fff; }
.section--invert p  { color: var(--tk-neutral-300); }
.section--invert a:not(.btn) { color: var(--tk-blue-400); }

.section-head { margin-bottom: var(--sp-7); }
.section-head p { color: var(--ink-muted); font-size: var(--text-lg); }

.eyebrow {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--action);
  margin: 0 0 var(--sp-2);
}
.section--invert .eyebrow { color: var(--tk-blue-400); }

.grid { display: grid; gap: var(--sp-5); }
/* Order matters: narrower breakpoints first, so the wider one wins when both match. */
@media (min-width: 700px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 950px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}

.split { display: grid; gap: var(--sp-6); align-items: center; }
@media (min-width: 850px) {
  .split { grid-template-columns: 1fr 1fr; gap: var(--sp-8); }
  .split--reverse > :first-child { order: 2; }
}

/* ---------- 5. Buttons --------------------------------------------------- */

.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-base);
  line-height: 1.2;
  padding: .85em 1.6em;
  border-radius: var(--radius);
  border: 2px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--action); color: #fff; }
.btn--primary:hover, .btn--primary:focus { background: var(--action-hover); color: #fff; }

.btn--secondary { background: transparent; color: var(--action); border-color: currentColor; }
.btn--secondary:hover, .btn--secondary:focus { background: var(--action-quiet); color: var(--action-hover); }

.btn--invert { background: #fff; color: var(--tk-neutral-900); }
.btn--invert:hover, .btn--invert:focus { background: var(--tk-neutral-200); color: var(--tk-neutral-900); }

.btn--ghost-invert { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn--ghost-invert:hover, .btn--ghost-invert:focus { background: rgba(255,255,255,.12); color: #fff; border-color: #fff; }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-5); }

/* ---------- 6. Header / navigation -------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); min-height: 72px;
}
.site-logo { display: block; flex: 0 0 auto; }
.site-logo img { width: 190px; }
@media (max-width: 420px) { .site-logo img { width: 150px; } }

.nav-toggle {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  background: none; border: 1px solid var(--border); border-radius: var(--radius);
  padding: .55em .8em; font-family: var(--font-heading); font-weight: 600;
  font-size: var(--text-sm); color: var(--ink); cursor: pointer;
}
.nav-toggle__bars { display: block; width: 18px; height: 2px; background: currentColor; position: relative; }
.nav-toggle__bars::before, .nav-toggle__bars::after {
  content: ''; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor;
}
.nav-toggle__bars::before { top: -6px; } .nav-toggle__bars::after { top: 6px; }

.site-nav ul { display: flex; align-items: center; gap: var(--sp-5); list-style: none; margin: 0; padding: 0; }
.site-nav li { margin: 0; }
.site-nav a {
  font-family: var(--font-heading); font-weight: 600; font-size: .95rem;
  color: var(--ink); text-decoration: none; padding: .35em 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--action); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--tk-blue-500); color: var(--action); }
.site-nav .nav-cta a,
.site-nav .nav-cta a[aria-current="page"] {
  background: var(--action); color: #fff; border-radius: var(--radius);
  padding: .6em 1.1em; border-bottom: 0;
}
.site-nav .nav-cta a:hover { background: var(--action-hover); color: #fff; }
.site-nav .nav-portal a { color: var(--ink-muted); font-weight: 500; }

@media (max-width: 1000px) {
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow); padding: var(--sp-4) 0;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding-inline: var(--sp-5); }
  .site-nav li { border-bottom: 1px solid var(--border); }
  .site-nav li:last-child { border-bottom: 0; }
  .site-nav a { display: block; padding: var(--sp-3) 0; border-bottom: 0; }
  .site-nav .nav-cta { margin-top: var(--sp-3); }
  .site-nav .nav-cta a { text-align: center; }
}
@media (min-width: 1001px) { .nav-toggle { display: none; } }

/* ---------- 7. Hero ------------------------------------------------------ */

.hero { position: relative; background: var(--tk-neutral-900); color: #fff; overflow: hidden; }
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; opacity: .5; }
.hero__inner { position: relative; padding-block: var(--sp-9); }
@media (min-width: 800px) { .hero__inner { padding-block: 7.5rem; } }
.hero h1 { color: #fff; max-width: 15ch; margin-bottom: var(--sp-4); }
.hero__pronunciation {
  font-family: var(--font-heading); font-weight: 600; font-size: var(--text-lg);
  color: #fff; margin-bottom: var(--sp-2);
}
.hero__definition { color: rgba(255,255,255,.88); font-size: var(--text-lg); max-width: 52ch; font-style: italic; }
.hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(35,31,32,.82) 0%, rgba(35,31,32,.45) 60%, rgba(35,31,32,.25) 100%);
}
.hero__inner { z-index: 1; }
.hero__media { z-index: 0; }
.hero::after { z-index: 0; }

/* ---------- 8. Cards ----------------------------------------------------- */

.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; display: flex; flex-direction: column; height: 100%;
}
/* flex:none stops the flex column from stretching the media box and
   defeating the aspect ratio when a portrait photo is used. */
.card__media {
  aspect-ratio: 4 / 3; background: var(--surface-alt);
  flex: 0 0 auto; overflow: hidden;
}
.card__media img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 22%;
}
.card__body { padding: var(--sp-5); display: flex; flex-direction: column; flex: 1; }
.card__body h3 { margin-bottom: var(--sp-2); }
.card__body p { color: var(--ink-muted); flex: 1; }
.card__body .btn { align-self: flex-start; margin-top: var(--sp-3); }

/* accent stripe echoing the logo colours */
.card--accent { border-top: 4px solid var(--tk-blue-500); }
.card--accent:nth-child(2n)   { border-top-color: var(--tk-red-500); }
.card--accent:nth-child(3n)   { border-top-color: var(--tk-green-500); }
.card--accent:nth-child(4n)   { border-top-color: var(--tk-yellow-500); }

/* ---------- 9. Workshop cards ------------------------------------------- */

.workshop {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--sp-5); background: #fff; display: flex; flex-direction: column;
}
.workshop h3 { margin-bottom: var(--sp-3); }
.workshop p { color: var(--ink-muted); flex: 1; }
.workshop__facts { list-style: none; margin: var(--sp-4) 0; padding: 0; border-top: 1px solid var(--border); }
.workshop__facts li {
  display: flex; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); margin: 0; font-size: .95rem;
}
.workshop__facts dt, .workshop__facts .k { color: var(--ink-muted); }
.workshop__facts .v { font-family: var(--font-heading); font-weight: 600; text-align: right; }
.workshop .btn { align-self: flex-start; }

/* ---------- 10. Feature list -------------------------------------------- */

.checklist { list-style: none; padding: 0; margin: var(--sp-4) 0; }
.checklist li { position: relative; padding-left: 1.9rem; margin-bottom: var(--sp-3); }
.checklist li::before {
  content: ''; position: absolute; left: 0; top: .45em;
  width: 12px; height: 12px; border-radius: 2px; background: var(--tk-blue-500);
}
.checklist li:nth-child(2)::before { background: var(--tk-red-500); }
.checklist li:nth-child(3)::before { background: var(--tk-green-500); }
.checklist li:nth-child(4)::before { background: var(--tk-yellow-500); }

/* ---------- 11. Media / figures ----------------------------------------- */

.figure { border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-alt); }
.figure img { width: 100%; }
.figure--tall { aspect-ratio: 3 / 4; }
.figure--tall img { height: 100%; object-fit: cover; }
.figure--wide { aspect-ratio: 16 / 10; }
.figure--wide img { height: 100%; object-fit: cover; }

/* ---------- 12. Callout / CTA band -------------------------------------- */

.cta-band { background: var(--tk-blue-600); color: #fff; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.92); font-size: var(--text-lg); }
.cta-band .btn--invert { background: #fff; color: var(--tk-blue-700); }

.note {
  background: var(--action-quiet); border-left: 3px solid var(--tk-blue-500);
  padding: var(--sp-4) var(--sp-5); border-radius: 0 var(--radius) var(--radius) 0;
  margin: var(--sp-5) 0;
}
.note p:last-child { margin-bottom: 0; }

/* ---------- 13. Forms / SuiteDash embed --------------------------------- */

.embed {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: #fff; overflow: hidden; min-height: 480px; position: relative;
}
.embed iframe { width: 100%; border: 0; display: block; min-height: 480px; }
.embed__placeholder {
  padding: var(--sp-7) var(--sp-5); text-align: center; color: var(--ink-muted);
}
.embed__placeholder code {
  display: inline-block; background: var(--surface-alt); padding: .15em .5em;
  border-radius: 3px; font-size: .85em;
}
.embed__spinner {
  width: 26px; height: 26px; border: 3px solid var(--border);
  border-top-color: var(--tk-blue-500); border-radius: 50%;
  margin: 0 auto var(--sp-4); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Fallback form styling — used if SuiteDash is not yet configured */
.form-grid { display: grid; gap: var(--sp-4); }
@media (min-width: 640px) { .form-grid--2 { grid-template-columns: 1fr 1fr; } }
label { display: block; font-family: var(--font-heading); font-weight: 600; font-size: .9rem; margin-bottom: var(--sp-2); }
input[type=text], input[type=email], input[type=tel], select, textarea {
  width: 100%; font-family: var(--font-body); font-size: var(--text-base);
  padding: .7em .85em; border: 1px solid var(--tk-neutral-300);
  border-radius: var(--radius); background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--tk-blue-500); }
textarea { min-height: 140px; resize: vertical; }
.field-hint { font-size: var(--text-sm); color: var(--ink-muted); margin-top: var(--sp-2); }

/* ---------- 14. Footer --------------------------------------------------- */

.site-footer { background: var(--tk-neutral-900); color: var(--tk-neutral-300); padding-block: var(--sp-8) var(--sp-6); }
.site-footer a { color: var(--tk-neutral-200); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer__grid { display: grid; gap: var(--sp-6); }
@media (min-width: 750px) { .site-footer__grid { grid-template-columns: 2fr 1fr 1fr 1.2fr; } }
.site-footer h4 {
  color: #fff; font-size: var(--text-sm); text-transform: uppercase;
  letter-spacing: .1em; margin-bottom: var(--sp-3);
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: var(--sp-2); }
.site-footer__logo img { width: 200px; margin-bottom: var(--sp-4); }
.site-footer__tagline { font-size: var(--text-sm); letter-spacing: .1em; text-transform: uppercase; color: var(--tk-neutral-400); }
.site-footer__bottom {
  border-top: 1px solid var(--tk-neutral-800); margin-top: var(--sp-7); padding-top: var(--sp-5);
  display: flex; flex-wrap: wrap; gap: var(--sp-4); justify-content: space-between;
  font-size: var(--text-sm); color: var(--tk-neutral-400);
}
.social-row { display: flex; gap: var(--sp-4); align-items: center; }
.social-row a { display: inline-flex; }
.social-row svg { width: 22px; height: 22px; fill: currentColor; }

/* ---------- 15. Print ---------------------------------------------------- */

@media print {
  .site-header, .site-footer, .nav-toggle, .btn, .embed { display: none !important; }
  body { color: #000; }
  a::after { content: " (" attr(href) ")"; font-size: .85em; }
}

/* ---------- 16. Workshop card media ------------------------------------- */

.workshop { padding: 0; overflow: hidden; }
.workshop__media { aspect-ratio: 4 / 3; background: var(--surface-alt); margin: 0; flex: 0 0 auto; overflow: hidden; }
.workshop__media img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
.workshop > h3,
.workshop > p,
.workshop > .workshop__facts,
.workshop > .btn { margin-inline: var(--sp-5); }
.workshop > h3 { margin-top: var(--sp-5); }
.workshop > .btn { margin-bottom: var(--sp-5); }
.workshop__facts { margin-inline: var(--sp-5); }

/* ---------- 17. No-JavaScript fallback ---------------------------------- */
/* If JavaScript is unavailable the embeds cannot mount, so hide the spinner
   and show the direct contact route instead. */
.no-js .embed__spinner { display: none; }
.no-js .embed__placeholder::after {
  content: 'Please email hello@tinkery.studio and we will get straight back to you.';
  display: block; margin-top: var(--sp-3);
}

/* ---------- 18. "Still being set up" notice ----------------------------- */
/* Shown on the contact page when a visitor followed a link that isn't
   connected yet, so the redirect is explained rather than mysterious. */
.pending-note {
  background: var(--action-quiet);
  border: 1px solid var(--tk-blue-200);
  border-left: 4px solid var(--action);
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-5);
  margin-block: var(--sp-5) 0;
}
.pending-note p:last-child { margin-bottom: 0; }
.pending-note strong { font-family: var(--font-heading); }
.pending-note:focus { outline: none; }
.pending-note:focus-visible { outline: 3px solid var(--tk-blue-500); outline-offset: 2px; }

/* ---------- 19. Spreadshop embed ---------------------------------------- */
/* The shop draws itself into #myShop. Spreadshop ships its own styling, so we
   only reserve space and provide the fallback shown if the script is blocked. */

#myShop { min-height: 420px; }

.shop-fallback {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-alt);
  padding: var(--sp-7) var(--sp-5);
  text-align: center;
  max-width: 560px;
  margin-inline: auto;
}
.shop-fallback p { max-width: none; }
.shop-fallback strong { font-family: var(--font-heading); }

/* Spreadshop injects wide tables and grids; keep them from pushing the page
   sideways on small screens. */
#myShop img { display: inline-block; }
#myShop table { max-width: 100%; }

/* ---------- 20. Tall embeds (SuiteDash-managed content pages) ----------- */
/* A content page is taller than a form, and cannot resize its own iframe
   across origins, so we give it generous height and let it scroll inside. */
.embed--tall { min-height: 900px; }
.embed--tall iframe { min-height: 2000px; }

/* ---------- 21. Review call-to-action (links to the SuiteDash reviews) --- */
.review-cta {
  display: grid; gap: var(--sp-5); align-items: center;
  border: 1px solid var(--border); border-left: 5px solid var(--action);
  border-radius: var(--radius-lg); background: var(--surface-alt);
  padding: var(--sp-6);
}
@media (min-width: 800px) {
  .review-cta { grid-template-columns: 1fr auto; gap: var(--sp-7); }
}

/* Coming-soon variant of the review call-to-action: warmer accent than the
   live version so it reads as an invitation rather than a broken link. */
.review-cta--soon { border-left-color: var(--tk-yellow-500); background: #FEFBF2; }
