/*
 * Fernhill Goods demo shop: calm Scandinavian design.
 * Off-white, oat and sage with a soft clay accent; Albert Sans with Instrument Serif italics; square product photos.
 */

@font-face { font-family: "Albert Sans"; src: url("../fonts/albert-sans-latin-variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --paper: #f7f5f0;
  --oat: #ece7dd;
  --oat-2: #e2dbcd;
  --white: #fffefb;
  --ink: #2a2a27;
  --muted: #6d6b64;
  --sage: #7b8a72;
  --sage-2: #5f6e57;
  --clay: #b26f4c;
  --line: #ddd7cb;
  --sans: "Albert Sans", "Segoe UI", Arial, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --wrap: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.02rem/1.65 var(--sans); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: clamp(2.6rem, 5.6vw, 4.8rem); font-weight: 400; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.9rem, 3.2vw, 2.7rem); font-weight: 400; letter-spacing: -0.03em; }
h3 { font-size: 1.05rem; }
h1 em, h2 em, .brand-name em, .footer-name em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; color: var(--sage-2); }
p { margin: 0 0 1em; }
.wrap { width: min(var(--wrap), 100% - 48px); margin-inline: auto; }
.eyebrow { font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--sage-2); margin: 0 0 14px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
main { overflow-x: clip; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--white); padding: 10px 14px; z-index: 2000; }
.skip-link:focus { left: 12px; top: 12px; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }

.announce { margin: 0; background: var(--sage-2); color: var(--white); text-align: center; font-size: .86rem; padding: 8px 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 15px 28px; border-radius: 2px; font: 500 .95rem/1 var(--sans); letter-spacing: .02em; text-decoration: none; border: 1px solid var(--ink); cursor: pointer; transition: background .2s ease, color .2s ease, border-color .2s ease; }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: var(--sage-2); border-color: var(--sage-2); }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--white); }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.text-link { font-size: .92rem; text-underline-offset: 5px; text-decoration-color: var(--clay); }
.text-link:hover { color: var(--clay); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(247, 245, 240, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px; min-height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-name { font-size: 1.35rem; font-weight: 500; letter-spacing: -0.02em; }
.brand-name em { font-size: 1.5rem; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; gap: 30px; }
.main-nav a { text-decoration: none; font-size: .95rem; color: var(--muted); padding: 6px 0; border-bottom: 1px solid transparent; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.cart-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: .95rem; }
.cart-link svg { width: 22px; height: 22px; }
.cart-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--oat-2); font-size: .78rem; display: grid; place-items: center; transition: background .2s ease, color .2s ease; }
.cart-link.has-items .cart-count { background: var(--clay); color: var(--white); }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--ink); }
.nav-toggle .bars { display: flex; flex-direction: column; gap: 6px; }
.nav-toggle .bars span { width: 22px; height: 1.5px; background: currentColor; }

/* Hero */
.hero { padding: 48px 0 32px; }
.hero-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 56px; align-items: center; }
.hero h1 { margin-bottom: 22px; }
.hero .lead { margin-bottom: 32px; }
.hero-media { margin: 0; }
.hero-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-copy > *:nth-child(2) { animation-delay: .08s; }
  .hero-copy > *:nth-child(3) { animation-delay: .16s; }
  .hero-copy > *:nth-child(4) { animation-delay: .24s; }
  .hero-media img { animation: fade 1.4s ease both; }
  @keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
}

.section { padding: 80px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin-bottom: 32px; }

/* Category tiles */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cat-tile { position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 5; text-decoration: none; background: var(--oat); }
.cat-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s ease; }
.cat-tile:hover img { transform: scale(1.04); }
.cat-tile span { position: absolute; left: 16px; right: 16px; bottom: 16px; background: var(--white); padding: 16px 18px; font-size: .9rem; color: var(--muted); }
.cat-tile strong { display: block; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.7rem; color: var(--ink); line-height: 1.1; }

/* Product grid */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 36px 22px; }
.product-card { position: relative; }
.product-card[hidden] { display: none; }
.pc-media { display: block; overflow: hidden; background: var(--oat); aspect-ratio: 1; }
.pc-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s ease; }
.product-card:hover .pc-media img { transform: scale(1.04); }
.pc-body { padding: 14px 70px 0 0; }
.pc-cat { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
.pc-body h3 { font-size: 1.02rem; font-weight: 500; }
.pc-body h3 a { text-decoration: none; }
.pc-body h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.pc-price { margin: 4px 0 0; color: var(--muted); }
.pc-add { position: absolute; right: 0; bottom: 4px; border: 1px solid var(--ink); background: transparent; font: 500 .85rem var(--sans); padding: 8px 14px; cursor: pointer; transition: background .2s ease, color .2s ease; }
.pc-add:hover, .pc-add.is-added { background: var(--ink); color: var(--white); }

/* Story band */
.story { background: var(--oat); padding: 96px 0; }
.story-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 64px; align-items: center; }
.story figure { margin: 0; }
.story img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.story h2 { margin-bottom: 18px; }
.story p { color: var(--muted); }
.promise { list-style: none; margin: 28px 0 0; padding: 0; border-top: 1px solid var(--oat-2); }
.promise li { padding: 14px 0; border-bottom: 1px solid var(--oat-2); display: grid; grid-template-columns: 170px 1fr; gap: 16px; }
.promise span { color: var(--muted); font-size: .95rem; }

.perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; text-align: center; }
.perks h3 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.6rem; letter-spacing: 0; margin-bottom: 6px; }
.perks p { color: var(--muted); margin: 0; }

/* Page head */
.page-head { padding: 64px 0 8px; }
.page-head h1 { margin-bottom: 14px; }

/* Shop bar */
.shop-section { padding-top: 32px; }
.shop-bar { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--white); border-radius: 999px; padding: 9px 18px; font: 400 .92rem var(--sans); color: var(--ink); cursor: pointer; transition: background .2s ease, border-color .2s ease, color .2s ease; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.sort { display: flex; align-items: center; gap: 10px; font-size: .92rem; color: var(--muted); }
.sort select, .qty select { font: 400 .95rem var(--sans); color: var(--ink); background: var(--white); border: 1px solid var(--line); padding: 9px 12px; border-radius: 2px; }
.result-count { font-size: .88rem; color: var(--muted); margin-bottom: 28px; }

/* Product page */
.product { padding: 32px 0 40px; }
.crumbs { font-size: .86rem; color: var(--muted); margin-bottom: 24px; }
.crumbs a { color: var(--ink); }
.product-grid-2 { display: grid; grid-template-columns: 7fr 5fr; gap: 64px; align-items: start; }
.product-media { margin: 0; background: var(--oat); }
.product-media img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.product-info { position: sticky; top: 100px; }
.product-info h1 { font-size: clamp(2.2rem, 3.6vw, 3.2rem); margin-bottom: 8px; }
.product-line { color: var(--muted); margin-bottom: 18px; }
.product-price { font-size: 1.5rem; margin-bottom: 18px; }
.product-desc { color: var(--muted); }
.buy-row { display: flex; align-items: flex-end; gap: 14px; margin: 26px 0 12px; }
.qty { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; color: var(--muted); }
.qty select { padding: 13px 12px; }
.add-btn { flex: 1; }
.add-btn.is-added { background: var(--sage-2); border-color: var(--sage-2); }
.stock { font-size: .88rem; color: var(--sage-2); margin-bottom: 26px; }
details { border-top: 1px solid var(--line); }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; list-style: none; padding: 16px 28px 16px 0; font-weight: 500; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 2px; top: 12px; font-size: 1.3rem; font-weight: 300; transition: transform .2s ease; }
details[open] summary::after { transform: rotate(45deg); }
details p { color: var(--muted); }
.spec { list-style: none; margin: 0 0 16px; padding: 0; }
.spec li { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 4px 0; color: var(--muted); }
.spec span { color: var(--ink); }
.related { padding-top: 40px; }

/* Cart */
.cart-section, .checkout-section { padding-top: 32px; }
.cart-empty { text-align: center; padding: 64px 24px; background: var(--white); border: 1px solid var(--line); }
.cart-empty p { font-size: 1.15rem; color: var(--muted); }
.cart-layout, .checkout-layout { display: grid; grid-template-columns: 1fr 380px; gap: 48px; align-items: start; }
.cart-layout[hidden], .checkout-layout[hidden], .cart-empty[hidden] { display: none; }
.cart-lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.cart-line { display: grid; grid-template-columns: 110px 1fr auto; gap: 22px; padding: 22px 0; border-bottom: 1px solid var(--line); align-items: start; }
.cl-media { display: block; background: var(--oat); }
.cl-media img { width: 110px; height: 110px; object-fit: cover; }
.cl-name { font-weight: 500; text-decoration: none; font-size: 1.05rem; }
.cl-name:hover { text-decoration: underline; text-underline-offset: 4px; }
.cl-each { color: var(--muted); font-size: .9rem; margin: 4px 0 12px; }
.cl-qty { display: inline-flex; align-items: center; border: 1px solid var(--line); background: var(--white); }
.qty-btn { width: 38px; height: 38px; border: 0; background: none; font: 400 1.15rem var(--sans); cursor: pointer; color: var(--ink); }
.qty-btn:hover { background: var(--oat); }
.qty-num { min-width: 34px; text-align: center; }
.cl-right { text-align: right; }
.cl-total { font-weight: 500; margin-bottom: 10px; }
.cl-remove { background: none; border: 0; padding: 0; font: 400 .88rem var(--sans); color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cl-remove:hover { color: var(--clay); }
.cart-note { font-size: .86rem; color: var(--muted); margin-top: 16px; }
.summary { background: var(--white); border: 1px solid var(--line); padding: 30px; position: sticky; top: 100px; }
.summary h2 { font-size: 1.7rem; margin-bottom: 18px; }
.summary dl { margin: 0 0 18px; }
.summary dl > div { display: flex; justify-content: space-between; padding: 8px 0; color: var(--muted); }
.summary dl > div.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; color: var(--ink); font-size: 1.15rem; font-weight: 500; }
.summary dd { margin: 0; }
.free-note { font-size: .88rem; color: var(--sage-2); }
.summary .text-link { display: block; text-align: center; margin-top: 16px; }
.mini-lines { list-style: none; margin: 0 0 14px; padding: 0 0 12px; border-bottom: 1px solid var(--line); }
.mini-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: .95rem; }

/* Checkout */
.demo-banner { background: #f4e7dc; border: 1px solid #e3c8b4; color: #6b3d24; padding: 16px 20px; margin-bottom: 32px; }
.demo-banner strong { display: block; margin-bottom: 2px; }
fieldset { border: 0; margin: 0 0 28px; padding: 0; }
legend { font-family: var(--serif); font-style: italic; font-size: 1.6rem; padding: 0; margin-bottom: 14px; }
legend span { font-family: var(--sans); font-style: normal; font-size: .9rem; color: var(--muted); }
.payment p { background: var(--oat); padding: 16px 18px; color: var(--muted); }
.payment strong { color: var(--ink); }
.checkout-layout form.is-ordered fieldset, .checkout-layout form.is-ordered > .btn { display: none; }
.checkout-layout.is-ordered { grid-template-columns: 1fr; }
.checkout-layout.is-ordered .summary { display: none; }
.checkout-layout.is-ordered .wsn-demo-message { font-size: 1.05rem; padding: 22px 24px; }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .86rem; color: var(--muted); }
.field input, .field select, .field textarea { font: 400 1rem var(--sans); color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 2px; padding: 13px 14px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.was-checked :invalid { border-color: #b3261e; }
.form-note { font-size: .86rem; color: var(--muted); margin: 14px 0 0; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 56px; align-items: start; }
.contact-form .form-grid { margin-bottom: 24px; }
.contact-side dl { margin: 0 0 24px; border-top: 1px solid var(--line); }
.contact-side dl > div { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 90px 1fr; gap: 12px; }
.contact-side dt { color: var(--muted); font-size: .9rem; }
.contact-side dd { margin: 0; overflow-wrap: anywhere; }
/* Contact photo: arched like a Nordic window, an offset sage arch behind it and a round badge */
.arch-photo { position: relative; margin: 8px 0 0; padding: 0 0 26px 26px; }
.arch-photo::before { content: ""; position: absolute; left: 0; bottom: 0; width: 82%; height: 88%; background: #c9d1bf; border-radius: 999px 999px 0 0; }
.arch-photo::after { content: ""; position: absolute; left: 13px; top: 30%; width: 1px; height: 46%; background: var(--sage-2); opacity: .35; }
.arch-photo img { position: relative; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; border-radius: 999px 999px 3px 3px; box-shadow: 0 24px 48px rgba(42, 42, 39, .12); }
.arch-badge { position: absolute; right: -14px; top: 38%; width: 112px; height: 112px; border-radius: 50%; background: var(--clay); color: var(--white); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; box-shadow: 0 12px 28px rgba(178, 111, 76, .35); transform: rotate(-8deg); }
.arch-badge span { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; }
.arch-badge em { font-family: var(--serif); font-style: italic; font-size: 1.65rem; }
@media (prefers-reduced-motion: no-preference) {
  .arch-badge { animation: sway 7s ease-in-out infinite; }
  @keyframes sway { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(-2deg) translateY(-4px); } }
}
.faq { background: var(--oat); }
.faq-wrap { max-width: 820px; }
.faq h2 { margin-bottom: 24px; }
.faq details { border-color: var(--oat-2); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 500; background: var(--ink); color: var(--white); padding: 14px 20px; font-size: .95rem; box-shadow: 0 16px 40px rgba(0, 0, 0, .2); transition: opacity .25s ease, transform .25s ease; max-width: calc(100% - 32px); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast a { color: #f0c8ad; margin-left: 6px; }

/* Footer */
.site-footer { background: var(--ink); color: #c9c5bb; padding: 72px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 36px; padding-bottom: 40px; }
.footer-name { font-size: 1.8rem; color: var(--white); margin-bottom: 10px; }
.footer-name em { color: #c8d1bf; font-size: 2rem; }
.site-footer h3 { font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: #9a968c; margin-bottom: 14px; font-weight: 500; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; overflow-wrap: anywhere; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; border-top: 1px solid #44443f; padding-top: 22px; font-size: .84rem; color: #9a968c; }

/* Fade-in on scroll */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
  .js .reveal.is-visible { opacity: 1; transform: none; }
}

/* Tablet */
@media (max-width: 1040px) {
  .header-inner { grid-template-columns: auto 1fr auto; gap: 14px; }
  .nav-toggle { display: inline-block; }
  .brand { justify-self: start; }
  .main-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); display: none; padding: 8px 24px 20px; }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav a { display: block; padding: 13px 0; border-bottom: 1px solid var(--line); }
  .hero-grid, .story-grid, .product-grid-2, .contact-grid, .cart-layout, .checkout-layout { grid-template-columns: 1fr; gap: 40px; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .product-info, .summary { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* Phone */
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .wrap { width: min(var(--wrap), 100% - 32px); }
  .cart-link span:not(.cart-count) { display: none; }
  .hero { padding-top: 28px; }
  .section, .story { padding: 56px 0; }
  .cat-grid { grid-template-columns: 1fr; }
  .cat-tile { aspect-ratio: 16 / 10; }
  .product-grid { grid-template-columns: 1fr 1fr; gap: 28px 14px; }
  .pc-body { padding-right: 0; }
  .pc-add { position: static; margin-top: 10px; width: 100%; }
  .promise li { grid-template-columns: 1fr; gap: 2px; }
  .perks { grid-template-columns: 1fr; gap: 22px; }
  .shop-bar { flex-direction: column; align-items: flex-start; }
  .cart-line { grid-template-columns: 80px 1fr; }
  .cl-media img { width: 80px; height: 80px; }
  .cl-right { grid-column: 2; text-align: left; display: flex; justify-content: space-between; align-items: center; }
  .cl-total { margin: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .summary { padding: 22px; }
  .footer-grid { grid-template-columns: 1fr; }
  .btn-row .btn { flex: 1; }
  .arch-photo { padding: 0 0 18px 18px; margin-right: 14px; }
  .arch-badge { width: 92px; height: 92px; right: -12px; }
  .arch-badge em { font-size: 1.35rem; }
}
