/* =================================================================
   Ferndown Framers — shared stylesheet
   Design language: the workshop itself.
   - Signature: the mitred 45° corner join + the white bevel of a cut mount
   - Palette drawn from gilt moulding, gallery-slate walls, mountboard
   ================================================================= */

:root {
  /* Colour — named for the materials they come from */
  --paper:      #FBF8F2; /* warm mountboard white (page) */
  --paper-2:    #F1EBDE; /* recessed mount panel */
  --ink:        #211F1B; /* warm near-black */
  --ink-soft:   #4F4A41; /* secondary text */
  --line:       #DDD5C5; /* hairline / cut edge */
  --slate:      #1E3D3A; /* deep gallery wall (brand) */
  --slate-2:    #2B5450; /* slate hover */
  --gilt:       #956829; /* antique gilt accent — deep enough for 4.5:1 text contrast on paper */
  --gilt-2:     #C39A52; /* leaf highlight */
  --bevel:      #FFFFFF; /* the white core a mount cut reveals */

  /* Type */
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Scale */
  --step--1: clamp(0.83rem, 0.80rem + 0.15vw, 0.92rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.12rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2:  clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  --step-3:  clamp(2rem, 1.6rem + 2vw, 3.1rem);
  --step-4:  clamp(2.6rem, 1.9rem + 3.4vw, 4.7rem);

  --wrap: 1140px;
  --gutter: clamp(1.1rem, 4vw, 2.6rem);
  --radius: 2px; /* frames are square; keep corners honest */

  /* Motion — decelerating curves only, no bounce/elastic */
  --ease: cubic-bezier(0.25, 1, 0.5, 1);        /* ease-out-quart: menus, accordions */
  --ease-decisive: cubic-bezier(0.16, 1, 0.3, 1); /* ease-out-expo: modal, reveals, image fade */
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.62;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.05; letter-spacing: -0.01em; }
h1 { font-size: var(--step-4); font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 144; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); letter-spacing: -0.005em; }

p { max-width: 68ch; }

/* ---------- shared layout ---------- */
.wrap { width: min(100% - var(--gutter) * 2, var(--wrap)); margin-inline: auto; }
.section { padding-block: clamp(3.4rem, 7vw, 6.6rem); }
.section--tight { padding-block: clamp(2.4rem, 4vw, 3.6rem); }
.stack > * + * { margin-top: 1.1rem; }
.lede { font-size: var(--step-1); color: var(--ink-soft); line-height: 1.5; }

/* eyebrow — set like a measurement tick / spec line from the bench */
.eyebrow {
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gilt);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--gilt);
}

/* ---------- the signature: mounted frame ---------- */
/* A picture frame is a moulding (outer) + a mount with a bevelled window (inner).
   We render that literally: gilt moulding edge, recessed mount, white bevel line. */
.frame {
  position: relative;
  background: var(--paper);
  padding: clamp(0.7rem, 1.6vw, 1.1rem);
  border: 1px solid var(--line);
  box-shadow:
    0 1px 0 rgba(255,255,255,.7) inset,
    0 18px 40px -28px rgba(33,31,27,.55);
}
.frame__mount {
  position: relative;
  background: var(--bevel);
  padding: clamp(1.1rem, 3vw, 2.4rem);
  /* the bevel: a fine inner cut edge */
  box-shadow: 0 0 0 1px var(--line) inset, 0 0 0 6px var(--paper) inset, 0 0 0 7px var(--line) inset;
}
/* mitred corner ticks — the 45° join, drawn only at the four corners */
.mitre { position: relative; }
.mitre::before, .mitre::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border: 1px solid var(--gilt);
  pointer-events: none;
}
.mitre::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.mitre::after  { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--slate);
  --fg: var(--paper);
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--body); font-weight: 600; font-size: var(--step-0);
  line-height: 1; text-decoration: none; white-space: nowrap;
  padding: 0.92em 1.5em;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--bg);
  border-radius: var(--radius);
  transition: background .18s ease, transform .18s ease, color .18s ease;
}
.btn:hover { background: var(--slate-2); border-color: var(--slate-2); transform: translateY(-1px); }
.btn--ghost { --bg: transparent; --fg: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--gilt { --bg: var(--gilt); border-color: var(--gilt); }
.btn--gilt:hover { background: var(--gilt-2); border-color: var(--gilt-2); color: var(--ink); }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding-block: 0.85rem; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); }
.brand__mark { width: 34px; height: 34px; flex: none; }
.brand__name { font-family: var(--display); font-weight: 600; font-size: 1.18rem; line-height: 1; }
.brand__name span { display: block; font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.32em; color: var(--gilt); text-transform: uppercase; margin-top: 3px; white-space: nowrap; }
@media (max-width: 430px) { .brand__name span { display: none; } }
@media (max-width: 400px) {
  .nav { gap: 0.5rem; }
  .nav__cta { gap: 0.4rem; }
  .brand { gap: 0.5rem; }
  .brand__mark { width: 28px; height: 28px; }
  .brand__name { font-size: 1rem; }
  .nav__phone { font-size: 0.78rem; }
}

.nav__links { display: flex; align-items: center; gap: 1.5rem; list-style: none; padding: 0; }
.nav__links a { text-decoration: none; font-weight: 500; font-size: 0.98rem; padding: 0.3rem 0; position: relative; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 2px; background: var(--gilt);
  transition: right .22s ease;
}
.nav__links a:hover::after, .nav__links a[aria-current="page"]::after { right: 0; }
.nav__cta { display: flex; align-items: center; gap: 0.7rem; }
.nav__phone { font-family: var(--mono); font-weight: 600; text-decoration: none; white-space: nowrap; font-size: 0.95rem; }

.nav__toggle { display: none; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; background: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.5rem; cursor: pointer; }
.nav__toggle svg { width: 22px; height: 22px; }

@media (max-width: 980px) {
  .nav__cta .btn { display: none; }
  .nav__toggle { display: inline-flex; }
  .nav__links {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 1rem var(--gutter) 1.6rem;
    opacity: 0; visibility: hidden; transform: translateY(-6px); pointer-events: none;
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
  }
  .nav[data-open="true"] .nav__links {
    opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
  }
  .nav__links a { font-size: 1.15rem; padding: 0.7rem 0; display: inline-block; }
  .site-header { position: relative; }
}

/* ---------- hero ---------- */
.hero { padding-block: clamp(3rem, 6vw, 5.5rem); }
.hero__grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(1.5rem, 4vw, 3.4rem); align-items: center; }
.hero h1 { margin-top: 1rem; }
.hero__sub { margin-top: 1.4rem; max-width: 46ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.9rem; }
.hero__art { aspect-ratio: 4 / 5; }
.hero__art .frame__mount { height: 100%; display: grid; place-items: center; text-align: center; }
.hero__plate { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); }
.hero__plate strong { display: block; font-family: var(--display); font-size: var(--step-2); letter-spacing: -0.01em; color: var(--ink); text-transform: none; margin-top: 0.3rem; }
@media (max-width: 820px) { .hero__grid { grid-template-columns: 1fr; } .hero__art { max-width: 380px; } }

/* ---------- info bar (hours / address strip) ---------- */
.infobar { background: var(--slate); color: var(--paper); }
.infobar__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; padding-block: 1.6rem; }
.infobar h2 { color: var(--paper); font-size: 1rem; font-family: var(--mono); font-weight: 400; letter-spacing: 0.16em; text-transform: uppercase; opacity: .8; }
.infobar p, .infobar a { color: var(--paper); text-decoration: none; }
.infobar a:hover { color: var(--gilt-2); }
@media (max-width: 720px) { .infobar__grid { grid-template-columns: 1fr; gap: 1.1rem; } }

/* ---------- cards / services ---------- */
.grid { display: grid; gap: clamp(1rem, 2.4vw, 1.6rem); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 820px) { .grid--3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .grid--3, .grid--2 { grid-template-columns: 1fr; } }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: clamp(1.3rem, 2.4vw, 1.8rem);
  position: relative;
  transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: var(--gilt); transform: translateY(-2px); }
.card__no { font-family: var(--mono); font-size: 0.8rem; color: var(--gilt); letter-spacing: 0.1em; }
.card h3 { margin: 0.5rem 0 0.4rem; }
.card p { font-size: 0.97rem; color: var(--ink-soft); }

/* ---------- panel (mount-coloured block) ---------- */
.panel { background: var(--paper-2); }

/* ---------- alternating feature rows ---------- */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.4rem, 4vw, 3rem); align-items: center; }
.feature + .feature { margin-top: clamp(2.4rem, 5vw, 4rem); }
.feature--flip .feature__media { order: -1; }
.feature__media { aspect-ratio: 5 / 4; }
@media (max-width: 760px) { .feature, .feature--flip { grid-template-columns: 1fr; } .feature--flip .feature__media { order: 0; } }

/* ---------- swatch art (CSS-drawn placeholders, no external images) ---------- */
.swatch { width: 100%; height: 100%; position: relative; overflow: hidden; }
.swatch--gilt  { background: linear-gradient(135deg, #6f4a18, var(--gilt) 45%, var(--gilt-2) 60%, #7a541f); }
.swatch--slate { background: linear-gradient(135deg, #16302d, var(--slate) 55%, var(--slate-2)); }
.swatch--mount { background: repeating-linear-gradient(45deg, #efe9dc 0 14px, #e7e0cf 14px 28px); }
.swatch--photo { background: var(--paper); }
.swatch--photo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.swatch__label { position: absolute; left: 14px; bottom: 12px; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper); mix-blend-mode: difference; }

/* ---------- FAQ accordion ---------- */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 1.1rem 2.2rem 1.1rem 0; font-family: var(--display); font-size: var(--step-1); position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.2rem; top: 1rem; font-family: var(--body); color: var(--gilt); font-size: 1.6rem; line-height: 1; transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding-bottom: 1.2rem; color: var(--ink-soft); }

/* ---------- forms ---------- */
.field { display: grid; gap: 0.4rem; margin-bottom: 1.1rem; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field input, .field textarea, .field select {
  font: inherit; color: var(--ink);
  padding: 0.75rem 0.9rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--gilt); outline-offset: 1px; border-color: var(--gilt); }
.hp { position: absolute; left: -9999px; } /* honeypot */

/* ---------- blog ---------- */
.post-list { display: grid; gap: clamp(1rem, 2.4vw, 1.6rem); grid-template-columns: repeat(3, 1fr); }
@media (max-width: 820px) { .post-list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .post-list { grid-template-columns: 1fr; } }
.post-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; border: 1px solid var(--line); transition: border-color .2s, transform .2s; }
.post-card:hover { border-color: var(--gilt); transform: translateY(-2px); }
.post-card__media { aspect-ratio: 16/10; }
.post-card__body { padding: 1.2rem 1.3rem 1.5rem; }
.post-card__meta { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gilt); }
.post-card h3 { margin: 0.5rem 0; font-size: var(--step-1); }
.post-card p { font-size: 0.95rem; color: var(--ink-soft); }

.article { max-width: 70ch; margin-inline: auto; }
.article h2 { font-size: var(--step-2); margin-top: 2.4rem; }
.article h3 { margin-top: 1.8rem; }
.article p { margin-top: 1rem; }
.article ul, .article ol { margin-top: 1rem; padding-left: 1.3rem; }
.article li { margin-top: 0.4rem; }
.article__meta { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.08em; color: var(--ink-soft); text-transform: uppercase; }
.callout { border-left: 3px solid var(--gilt); background: var(--paper-2); padding: 1rem 1.2rem; margin-top: 1.6rem; }
.callout p { margin: 0; }

/* ---------- gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(0.8rem, 2vw, 1.4rem); }
.gallery-grid .frame { margin: 0; }
.gallery-grid .swatch { aspect-ratio: 1; }
@media (max-width: 700px) { .gallery-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- tool (frame calculator) ---------- */
.tool { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.4rem, 4vw, 3rem); }
.tool__out { background: var(--slate); color: var(--paper); padding: clamp(1.4rem, 3vw, 2.2rem); }
.tool__out h3 { color: var(--paper); }
.tool__row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid rgba(255,255,255,.16); font-family: var(--mono); font-size: 0.95rem; }
.tool__row span:last-child { color: var(--gilt-2); }
.tool__note { font-size: 0.82rem; opacity: .75; margin-top: 1rem; }
@media (max-width: 700px) { .tool { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: var(--paper); padding-block: clamp(2.6rem, 5vw, 4rem); margin-top: 2rem; }
.site-footer a { color: var(--paper); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.footer-grid h3 { font-family: var(--mono); font-weight: 400; font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gilt-2); margin-bottom: 0.9rem; }
.footer-grid ul { list-style: none; padding: 0; display: grid; gap: 0.5rem; }
.footer-grid a { text-decoration: none; opacity: .85; }
.footer-grid a:hover { opacity: 1; color: var(--gilt-2); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.14); margin-top: 2.4rem; padding-top: 1.4rem; font-size: 0.82rem; opacity: .7; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; gap: 1.6rem; } }

/* ---------- modal (confirmation dialog) ---------- */
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: var(--gutter);
  opacity: 0; visibility: hidden;
  transition: opacity .22s var(--ease-decisive), visibility .22s;
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal__overlay { position: absolute; inset: 0; background: rgba(33,31,27,.6); }
.modal__panel {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: clamp(1.8rem, 4vw, 2.6rem);
  max-width: 420px;
  text-align: center;
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 18px 40px -28px rgba(33,31,27,.55);
  transform: scale(.96) translateY(8px);
  transition: transform .22s var(--ease-decisive);
}
.modal.is-open .modal__panel { transform: scale(1) translateY(0); }
.modal__panel h2 { font-size: var(--step-2); margin-bottom: .8rem; }
.modal__panel p { margin: 0 auto 1.6rem; }
.modal__close { position: absolute; top: .7rem; right: .8rem; background: none; border: none; font-size: 1.4rem; line-height: 1; padding: .3rem; cursor: pointer; color: var(--ink-soft); }
.modal__close:hover { color: var(--ink); }

/* ---------- utility ---------- */
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.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 { position: absolute; left: -9999px; background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; top: 1rem; }
:focus-visible { outline: 2px solid var(--gilt); outline-offset: 2px; }

/* ---------- motion: scroll reveal + lazy-image fade (progressive enhancement, JS-gated) ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s var(--ease-decisive), transform .5s var(--ease-decisive); }
.reveal.is-visible { opacity: 1; transform: none; }
.js-fade { opacity: 0; transition: opacity .4s var(--ease-decisive); }
.js-fade.is-loaded { opacity: 1; }
