/* ==========================================================================
   Margin & Co. — design system

   One file, no build step. Ordered: tokens, reset, layout, type, components,
   sections, motion. Every value below comes from a scale; nothing is a
   one-off. That is what stops a hand-written site drifting into looking
   home-made after the third page.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Colour: one strong colour and a set of warm neutrals.
     Green rather than the blue every web studio defaults to — it reads
     established and calm, and it is not what a small business owner has seen
     on the last four agency sites they bounced off. Every pairing used in the
     UI is checked against WCAG AA; the ratios are noted so they can be
     defended rather than assumed. */
  --paper:     #FBFAF7;  /* warm off-white. Pure #fff glares on a phone at night */
  --paper-2:   #F4F2EC;  /* one step down, for banding sections without a rule */
  --ink:       #14201B;  /* near-black with a green cast, so it belongs to the palette */
  --muted:     #5C6660;  /* secondary text — 5.71:1 on paper */
  --green:     #1A5D45;  /* the one strong colour — 7.46:1 on paper */
  --green-dk:  #123F30;  /* hover and pressed */
  --green-lt:  #5FBF9B;  /* ONLY on dark backgrounds — 7.52:1 on ink, fails on paper */
  --rule:      #E5E2DA;  /* hairlines */

  /* Spacing: a 4px base. Every margin and padding on the site is one of
     these. A consistent scale is most of what separates "designed" from
     "assembled". */
  --s-1: 0.25rem;  --s-2: 0.5rem;   --s-3: 0.75rem;  --s-4: 1rem;
  --s-5: 1.5rem;   --s-6: 2rem;     --s-7: 3rem;     --s-8: 4rem;
  --s-9: 6rem;     --s-10: 8rem;

  /* Type: fluid, so it is sized for the viewport rather than snapping at
     breakpoints. Roughly a major third on mobile opening to a perfect fourth
     on desktop — the jump between levels widens as there is room for it. */
  --step--1: clamp(0.8125rem, 0.79rem + 0.12vw, 0.875rem);
  --step-0:  clamp(1.0625rem, 1.03rem + 0.18vw, 1.1875rem);
  --step-1:  clamp(1.25rem, 1.19rem + 0.3vw, 1.5rem);
  --step-2:  clamp(1.5rem, 1.38rem + 0.6vw, 2rem);
  --step-3:  clamp(1.875rem, 1.63rem + 1.2vw, 2.75rem);
  --step-4:  clamp(2.25rem, 1.8rem + 2.2vw, 3.75rem);
  --step-5:  clamp(2.75rem, 1.9rem + 4.2vw, 5.5rem);

  --measure: 34rem;        /* ~65 characters. Longer lines lose the reader */
  --wrap: 76rem;           /* content max width */
  --wrap-narrow: 52rem;

  --radius: 2px;           /* almost square. Heavy rounding reads consumer-app,
                              not studio */
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* --------------------------------------------------------------------------
   2. 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; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--step-0);
  line-height: 1.65;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
input, textarea, select, button { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
  /* Fraunces is variable: SOFT rounds the terminals, WONK allows the quirkier
     alternates. A little of both keeps it warm rather than austere — this is a
     studio for cafés and salons, not a law firm. */
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 40;
}
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { margin: 0 0 var(--s-4); max-width: var(--measure); }

a { color: var(--green); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--green-dk); }

/* One focus style everywhere. Visible, high contrast, never removed —
   a keyboard user must always be able to see where they are. */
:where(a, button, input, textarea, select, summary):focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: var(--radius);
}

/* --------------------------------------------------------------------------
   3. Layout
   -------------------------------------------------------------------------- */

.wrap {
  width: min(100% - var(--s-6), var(--wrap));
  margin-inline: auto;
}
@media (min-width: 40em) { .wrap { width: min(100% - var(--s-8), var(--wrap)); } }

.wrap--narrow { max-width: var(--wrap-narrow); }

/* Full-width bands with contained content. The band carries the colour, the
   wrap carries the grid — that is what makes a section read as a deliberate
   horizon line rather than a floating card. */
.band { padding-block: clamp(var(--s-8), 6vw, var(--s-10)); }
.band--tight { padding-block: clamp(var(--s-7), 4vw, var(--s-8)); }
.band--alt { background: var(--paper-2); }
.band--ink { background: var(--ink); color: var(--paper); }
.band--ink h2, .band--ink h3 { color: var(--paper); }
.band--ink a { color: var(--green-lt); }
.band--ink .eyebrow { color: var(--green-lt); }
.band--ink .lede { color: #D6D9D6; }
.band + .band--alt, .band--alt + .band { border-top: 1px solid var(--rule); }

.stack > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: var(--s-6); }

.grid { display: grid; gap: var(--s-6); }
@media (min-width: 48em) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); gap: var(--s-7); }
  .grid--2 { grid-template-columns: repeat(2, 1fr); gap: var(--s-7); }
}

/* --------------------------------------------------------------------------
   4. Type helpers
   -------------------------------------------------------------------------- */

/* Small caps label above a heading. Does the job a subheading would, without
   competing with the heading for size. */
.eyebrow {
  font-family: "Inter", system-ui, sans-serif;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  margin: 0 0 var(--s-4);
}

.lede {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--muted);
  max-width: 30rem;
}

.section-head { margin-bottom: var(--s-7); }
.section-head h2 { max-width: 18ch; }   /* headlines break better when measured */

.small { font-size: var(--step--1); color: var(--muted); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Skip link — first thing a keyboard user meets. */
.skip {
  position: absolute; left: var(--s-4); top: -4rem; z-index: 100;
  background: var(--ink); color: var(--paper);
  padding: var(--s-3) var(--s-4); text-decoration: none;
  transition: top 0.15s var(--ease);
}
.skip:focus { top: var(--s-4); color: var(--paper); }

/* --------------------------------------------------------------------------
   5. Header and footer
   -------------------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
/* Sticky only once the wordmark and the four links share one row.
   On a phone the nav wraps to a second line and the header is ~126px — sticking
   that to the top would hold about 15% of a small screen hostage for the whole
   visit, to save a scroll to a footer that repeats every link anyway. */
@media (min-width: 34em) {
  .site-header { position: sticky; top: 0; z-index: 50; }
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-2) var(--s-4);
  padding-block: var(--s-2);
  flex-wrap: wrap;
}
@media (min-width: 34em) { .site-header__inner { padding-block: var(--s-3); } }

.wordmark {
  font-family: "Fraunces", Georgia, serif;
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 20;
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.wordmark span { color: var(--green); }

/* No hamburger. Four destinations fit on one line even at 360px, and hiding
   navigation behind a tap costs more than it saves — it also removes the last
   reason this site would need JavaScript to be usable. */
.site-nav { display: flex; gap: clamp(var(--s-4), 3vw, var(--s-6)); }
.site-nav a {
  /* 44px minimum. Measured at 29.6px before this: legal under WCAG 2.5.8's
     24px floor, but this site is opened one-handed on a phone by someone
     halfway through a shift, and a target you have to aim at is a target
     people mis-hit. The flex centring buys the height without padding the
     header out. */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--green);
}

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: var(--s-8) var(--s-7);
  font-size: var(--step--1);
  color: var(--muted);
}
.site-footer__grid {
  display: grid; gap: var(--s-6);
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  margin-bottom: var(--s-7);
}
.site-footer h3 {
  font-family: "Inter", sans-serif;
  font-size: var(--step--1); font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink); margin-bottom: var(--s-3);
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li + li { margin-top: var(--s-1); }
.site-footer li a {
  /* Was 15.5px tall, which fails WCAG 2.5.8 (24px minimum for a pointer
     target). These are list links, not links inside a sentence, so the
     inline exception does not cover them. */
  display: inline-block;
  padding-block: var(--s-2);
  min-height: 24px;
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--green); text-decoration: underline; }
.site-footer__base {
  border-top: 1px solid var(--rule); padding-top: var(--s-5);
  display: flex; flex-wrap: wrap; gap: var(--s-4); justify-content: space-between;
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  min-height: 44px;                    /* thumb-sized: Apple's own floor */
  font-size: var(--step-0); font-weight: 500;
  text-decoration: none; cursor: pointer;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: transparent; color: var(--ink);
  transition: background 0.18s var(--ease), color 0.18s var(--ease),
              border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: translateY(1px); }

.btn--solid { background: var(--green); border-color: var(--green); color: #fff; }
.btn--solid:hover { background: var(--green-dk); border-color: var(--green-dk); color: #fff; }

.band--ink .btn { border-color: var(--paper); color: var(--paper); }
.band--ink .btn:hover { background: var(--paper); color: var(--ink); }
.band--ink .btn--solid { background: var(--green-lt); border-color: var(--green-lt); color: var(--ink); }
.band--ink .btn--solid:hover { background: #7FD9B6; border-color: #7FD9B6; color: var(--ink); }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; }

/* --------------------------------------------------------------------------
   7. Components
   -------------------------------------------------------------------------- */

/* Icon: a thin line square holding a simple glyph. Line icons rather than
   filled ones, because filled shapes at this size compete with the type for
   attention and the type is doing the selling. */
.icon {
  width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center;
  border: 1px solid var(--green);
  border-radius: var(--radius);
  color: var(--green);
  margin-bottom: var(--s-4);
}
.icon svg { width: 1.375rem; height: 1.375rem; stroke-width: 1.5; }

.feature h3 { margin-bottom: var(--s-3); }
.feature p { color: var(--muted); margin-bottom: 0; }

/* Numbered steps. The number is set large and light so it reads as an
   ordinal marker rather than a heading. */
.step__num {
  font-family: "Fraunces", Georgia, serif;
  font-variation-settings: "SOFT" 30, "WONK" 0, "opsz" 60;
  font-size: var(--step-3);
  line-height: 1;
  color: var(--green);
  opacity: 0.35;
  margin-bottom: var(--s-3);
}

/* Work placeholders: correct aspect ratio now, real screenshots later, with
   no layout shift when they are dropped in. */
.shot {
  aspect-ratio: 16 / 10;
  background:
    repeating-linear-gradient(45deg, transparent 0 12px, rgba(26,93,69,0.045) 12px 24px),
    var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  display: grid; place-items: center;
  color: var(--muted); font-size: var(--step--1);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.shot--wide { aspect-ratio: 16 / 9; }

.case { border-top: 1px solid var(--rule); padding-top: var(--s-7); }
.case + .case { margin-top: var(--s-8); }
@media (min-width: 52em) {
  .case__inner { display: grid; grid-template-columns: 1.15fr 1fr; gap: var(--s-8); align-items: start; }
}
.case dl { margin: var(--s-5) 0 0; }
.case dt {
  font-size: var(--step--1); font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--green); margin-top: var(--s-5);
}
.case dd { margin: var(--s-2) 0 0; color: var(--muted); max-width: var(--measure); }

/* Pricing. The recommended tier is raised rather than recoloured — colour
   would shout, and a small business owner who feels shouted at leaves. */
.price-card {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--s-6);
  background: var(--paper);
  display: flex; flex-direction: column;
}
.price-card--lead {
  border-color: var(--ink);
  box-shadow: 0 1px 0 var(--ink);
}
.price-card__tag {
  align-self: flex-start;
  font-size: var(--step--1); font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--green);
  margin-bottom: var(--s-3);
}
.price {
  font-family: "Fraunces", Georgia, serif;
  font-variation-settings: "SOFT" 30, "WONK" 0, "opsz" 60;
  font-size: var(--step-4); line-height: 1;
  margin: var(--s-2) 0 var(--s-2);
}
.price small { font-family: "Inter", sans-serif; font-size: var(--step--1); color: var(--muted); font-weight: 400; }
.price-card ul { list-style: none; margin: var(--s-5) 0 var(--s-6); padding: 0; }
.price-card li {
  padding-left: var(--s-5); position: relative; margin-bottom: var(--s-3);
  color: var(--muted); font-size: var(--step-0);
}
.price-card li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 0.6rem; height: 0.6rem;
  border-left: 1.5px solid var(--green); border-bottom: 1.5px solid var(--green);
  transform: rotate(-45deg);
}
.price-card .btn { margin-top: auto; justify-content: center; }

/* Form */
.field { margin-bottom: var(--s-5); }
.field label { display: block; font-size: var(--step--1); font-weight: 600; margin-bottom: var(--s-2); }
.field .hint { font-weight: 400; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%;
  padding: var(--s-3) var(--s-4);
  min-height: 44px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--muted); }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(26,93,69,0.12);
  outline: none;                        /* replaced by the ring above */
}
.field textarea { min-height: 8rem; resize: vertical; }

.note {
  border-left: 2px solid var(--green);
  padding: var(--s-2) 0 var(--s-2) var(--s-5);
  color: var(--muted);
  font-size: var(--step-0);
}

.faq { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  padding: var(--s-5) 0; cursor: pointer; font-weight: 600;
  list-style: none; display: flex; justify-content: space-between; gap: var(--s-4);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--green); font-size: var(--step-2); line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details > *:not(summary) { padding-bottom: var(--s-5); color: var(--muted); }

/* --------------------------------------------------------------------------
   8. Hero
   -------------------------------------------------------------------------- */

.hero { padding-block: clamp(var(--s-8), 9vw, var(--s-10)); }
.hero h1 { max-width: 15ch; }
.hero .lede { margin-top: var(--s-5); max-width: 34rem; font-size: var(--step-1); }
.hero .btn-row { margin-top: var(--s-7); }

/* A single hairline rule under the hero. With no photography to anchor the
   page, structure has to come from ruled horizons and space. */
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* --------------------------------------------------------------------------
   9. Motion
   --------------------------------------------------------------------------
   Fades are applied only when the `js` class is present, which the inline
   script in <head> sets before first paint. With JavaScript off, nothing is
   ever hidden — the content simply renders. Hiding in CSS and revealing in JS
   is the common version of this and it blanks the page for anyone whose
   script fails to load.
   -------------------------------------------------------------------------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* --------------------------------------------------------------------------
   10. Print
   -------------------------------------------------------------------------- */

@media print {
  .site-header, .site-footer, .btn-row, .skip { display: none; }
  body { background: #fff; color: #000; }
  .band { padding-block: var(--s-5); }
}

/* --------------------------------------------------------------------------
   11. Work previews
   --------------------------------------------------------------------------
   Real screenshots of the demo sites, generated from the live pages rather
   than mocked up. width and height are set so the browser reserves the box
   before the image arrives -- otherwise every card below it jumps when it
   loads, which is the single most obvious sign of an amateur page.
   -------------------------------------------------------------------------- */

.preview {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-2);
}
.preview img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;   /* the top of a page is the part worth seeing */
  display: block;
  transition: transform 0.5s var(--ease);
}
.work-card:hover .preview img { transform: scale(1.02); }
@media (prefers-reduced-motion: reduce) {
  .preview img, .work-card:hover .preview img { transition: none; transform: none; }
}
.preview::after {
  content: "";
  position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px rgba(20,32,27,0.08);
  pointer-events: none;
}

.work-card { display: block; text-decoration: none; color: inherit; }
.work-card:hover .preview { border-color: var(--ink); }
.work-card:hover h3 { color: var(--green); }
.work-card:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
.work-card h3 { margin: var(--s-4) 0 var(--s-1); font-size: var(--step-1); }
.work-card .meta-line {
  font-size: var(--step--1); color: var(--green); font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
}

/* Demonstration, not a client. Said on the card, not only in the small print. */
.demo-tag {
  display: inline-block; margin-top: var(--s-2);
  font-size: var(--step--1); color: var(--muted);
  border: 1px solid var(--rule); border-radius: 2px;
  padding: 0.15rem 0.5rem;
}
