/* ==========================================================================
   INTERSTYLE — Site system
   Shared shell for the brand pages: nav, section headers, footer, modal.
   Brand-specific accents are set per page via --accent on <body>.
   ========================================================================== */

/* Menu links glide to their section rather than jumping. The reduced-motion
   block in base.css overrides this back to `auto`. */
html { scroll-behavior: smooth; }

/* The nav is fixed, so anchors need to stop clear of it. */
section[id] { scroll-margin-top: calc(var(--nav-h) + 1.25rem); }

body { background: var(--is-white); color: var(--ink); }

/* --------------------------------------------------------------------------
   1. Layout primitives
   -------------------------------------------------------------------------- */

.section {
  padding: var(--section-y) var(--gutter);
  position: relative;
}
.section--cream { background: var(--cream); }
.section--dark  { background: var(--surface-dark); }

.section__head { max-width: 46rem; }

/* Eyebrow: small caps label with the brand rule beside it. */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0 0 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::after {
  content: "";
  width: 3rem;
  height: 1px;
  background: currentColor;
  flex: none;
}

.section__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: 0.005em;
  color: var(--ink);
}
.section__title em { font-style: italic; color: var(--accent); }

.section__intro {
  max-width: 35rem;
  margin: 0.9rem 0 0;
  font-size: 0.92rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--muted);
}

.section--dark .section__title { color: var(--is-white); }
.section--dark .section__intro { color: var(--on-dark-2); }

/* --------------------------------------------------------------------------
   2. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.95rem 2rem;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--is-white);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-inout),
              transform  var(--dur-fast) var(--ease-brand);
}
.btn:hover { background: var(--accent-deep); }
.btn:active { transform: translateY(1px); }
.btn__arrow { transition: transform var(--dur-base) var(--ease-brand); }
.btn:hover .btn__arrow { transform: translateX(0.3em); }

@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .nav__link { min-height: 44px; display: flex; align-items: center; }
}

.btn--ghost {
  background: transparent;
  border-color: var(--stone-dark);
  color: var(--ink);
}
.btn--ghost:hover { background: var(--accent); border-color: var(--accent); color: var(--is-white); }

/* --------------------------------------------------------------------------
   3. Navigation
   -------------------------------------------------------------------------- */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  background: transparent;
  transition: background var(--dur-base) var(--ease-inout),
              border-color var(--dur-base) var(--ease-inout),
              box-shadow var(--dur-base) var(--ease-inout);
  border-bottom: 1px solid transparent;
}

/* Before the solid state kicks in the nav may sit over hero photography, so a
   soft white veil keeps the dark links legible without hiding the image. */
.nav::before {
  content: "";
  position: absolute;
  inset: 0 0 -2.5rem;
  background: linear-gradient(to bottom,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(255, 255, 255, 0.62) 55%,
    rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-inout);
}
.nav.is-scrolled::before { opacity: 0; }
.nav__brand,
.nav__toggle,
.nav__links,
.nav__aside { position: relative; z-index: 1; }

@media (max-width: 940px) {
  .nav::before { display: none; }   /* the bar is already solid here */
}

.nav.is-scrolled {
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  border-bottom-color: var(--stone);
}

.nav__logo { height: clamp(2.0625rem, 3.025vw, 2.75rem); width: auto; }
.nav__brand { display: flex; align-items: center; margin-right: auto; }

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav__link {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  transition: color var(--dur-fast) var(--ease-inout);
}
.nav__link:hover { color: var(--accent); }

.nav__link--cta {
  padding: 0.5rem 1.15rem;
  background: var(--accent);
  color: var(--is-white);
}
.nav__link--cta:hover { background: var(--accent-deep); color: var(--is-white); }

.nav__aside { display: flex; align-items: center; gap: 1rem; }

.nav__switch {
  padding: 0.45rem 1rem;
  border: 1px solid var(--stone-dark);
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-inout),
              border-color var(--dur-fast) var(--ease-inout);
}
.nav__switch:hover { color: var(--accent); border-color: var(--accent); }


/* Hamburger — hidden until the links no longer fit. */
.nav__toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: -0.75rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.nav__toggle span {
  display: block;
  width: 1.4rem;
  height: 1px;
  margin: 0 auto;
  background: var(--ink);
  transition: transform var(--dur-fast) var(--ease-brand),
              opacity   var(--dur-fast) linear;
}
.nav__toggle span + span { margin-top: 6px; }
.nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.is-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 940px) {
  .nav { background: rgba(255, 255, 255, 0.94); border-bottom-color: var(--stone); }
  .nav__toggle { display: block; }

  .nav__panel {
    position: fixed;
    inset: var(--nav-h) 0 auto;
    display: grid;
    background: var(--is-white);
    border-bottom: 1px solid var(--stone);
    overflow: hidden;
    max-height: 0;
    transition: max-height var(--dur-base) var(--ease-brand);
  }
  .nav.is-open .nav__panel { max-height: 32rem; }

  .nav__links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--gutter) 1rem;
  }
  .nav__links li + li { border-top: 1px solid var(--stone); }
  .nav__link { display: block; padding: 1rem 0; font-size: 0.86rem; }
  .nav__link--cta { margin-top: 1rem; text-align: center; padding: 0.9rem; }

  .nav__aside {
    padding: 0 var(--gutter) 1.5rem;
    gap: 0.75rem;
    flex-direction: column;
    align-items: stretch;
  }
  .nav__switch { text-align: center; padding: 0.8rem; }
}

@media (min-width: 941px) {
  /* `display: contents` promotes the links and the aside to direct children
     of the bar, so a three-track grid can centre the menu against the full
     width rather than against whatever space the logo leaves. */
  .nav__panel { display: contents; }

  .nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }
  .nav__brand { margin-right: 0; justify-self: start; }
  .nav__links { justify-self: center; }
  .nav__aside { justify-self: end; }
}

/* --------------------------------------------------------------------------
   4. Footer
   -------------------------------------------------------------------------- */

.footer {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
  grid-template-columns: 1fr;
  padding: clamp(3rem, 6vw, 3.5rem) var(--gutter);
  background: var(--surface-dark);
}
@media (min-width: 40rem) { .footer { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 62rem) { .footer { grid-template-columns: 2fr 1fr 1fr 1fr; } }

.footer__brand { max-width: 22rem; }
@media (min-width: 40rem) and (max-width: 61.99rem) { .footer__brand { grid-column: 1 / -1; } }

.footer__logo { height: 2.25rem; width: auto; margin-bottom: 1rem; }
.footer__tag {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 300;
  line-height: 1.75;
  color: var(--on-dark-3);
}

.footer__col h2 {
  margin: 0 0 1rem;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.footer__col ul { margin: 0; padding: 0; list-style: none; }
.footer__col li + li { margin-top: 0.6rem; }
.footer__col a {
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--on-dark-3);
  transition: color var(--dur-fast) var(--ease-inout);
}
.footer__col a:hover { color: var(--on-dark-1); }

.footer__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem var(--gutter);
  /* The bar sits outside <footer>, over the white body, so the shade needs
     the dark surface beneath it or it reads as mid-grey. */
  background: linear-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.25)), var(--surface-dark);
}
/* Quiet but readable: ~7:1 against the footer bar (it was 0.28 white, ~2.4:1). */
.footer__copy { font-size: 0.78rem; letter-spacing: 0.02em; color: rgba(255, 255, 255, 0.62); }

/* --------------------------------------------------------------------------
   5. Scroll reveal
   -------------------------------------------------------------------------- */

[data-inview] {
  opacity: 0;
  transform: translateY(1.25rem);
  transition: opacity var(--dur-slow) var(--ease-brand),
              transform var(--dur-slow) var(--ease-brand);
}
[data-inview].is-inview { opacity: 1; transform: none; }

/* When an element is also a parallax layer, the scroll handler owns its
   transform — leaving the 900ms transform transition on would smear every
   frame. Only the fade is transitioned. */
[data-inview][data-parallax] {
  transform: none;
  transition-property: opacity;
}

@media (prefers-reduced-motion: reduce) {
  [data-inview] { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   6. Back to top
   Square, like the carousel arrows. Sits inside the safe area so it clears
   the iPhone home indicator and the notch in landscape. site.js adds
   `is-visible` once the hero is scrolled past, and sets --to-top-lift so the
   button rides up above the footer bar instead of covering the copyright.
   -------------------------------------------------------------------------- */

.to-top {
  --to-top-size: 2.75rem;                          /* 44px tap target      */
  --to-top-edge: clamp(1rem, 2.5vw, 2rem);

  position: fixed;
  right:  calc(var(--to-top-edge) + env(safe-area-inset-right, 0px));
  bottom: calc(var(--to-top-edge) + env(safe-area-inset-bottom, 0px) + var(--to-top-lift, 0px));
  z-index: 150;                                    /* under nav and modal  */
  display: grid;
  place-items: center;
  width: var(--to-top-size);
  height: var(--to-top-size);
  padding: 0;
  border: 1px solid var(--stone-dark);
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  box-shadow: 0 0.5rem 1.5rem rgba(16, 24, 32, 0.12);
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;

  opacity: 0;
  visibility: hidden;
  transform: translateY(0.75rem);
  /* visibility interpolates as `visible` for the whole transition, so the
     button fades out before it leaves the tab order — no delay needed. */
  transition: opacity      var(--dur-base) var(--ease-inout),
              transform    var(--dur-base) var(--ease-brand),
              visibility   var(--dur-base) linear,
              background   var(--dur-fast) var(--ease-inout),
              border-color var(--dur-fast) var(--ease-inout),
              color        var(--dur-fast) var(--ease-inout);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }

/* Out of the way while the mobile menu or a gallery is open. */
.nav.is-open ~ .to-top,
body.is-locked .to-top { opacity: 0; visibility: hidden; transform: translateY(0.75rem); }

.to-top svg {
  width: 0.75rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  transition: transform var(--dur-base) var(--ease-brand);
}

/* Hover only where there is a real pointer, so a tap does not leave the
   button stuck in its accent state on phones and tablets. */
@media (hover: hover) {
  .to-top:hover { background: var(--accent); border-color: var(--accent); color: var(--is-white); }
  .to-top:hover svg { transform: translateY(-0.2rem); }
}
.to-top:active { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--is-white); }

/* Tablets and up: a touch larger, in proportion with the wider layout. */
@media (min-width: 48rem) {
  .to-top { --to-top-size: 3rem; }
}

/* Phones in landscape: little height to spare, so tuck it closer to the
   corner. The safe-area insets above still keep it clear of the notch. */
@media (orientation: landscape) and (max-height: 32rem) {
  .to-top { --to-top-size: 2.75rem; --to-top-edge: 0.75rem; }
}

@media print {
  .to-top { display: none; }
}


/* ==========================================================================
   Interstyle Home — its own accent and a true-black dark surface
   ========================================================================== */

.theme-home-page {
  /* Gold rather than the Interstyle orange. This sits outside the four
     guideline colours — a deliberate choice to separate the two brands. */
  --accent:      #B8935A;
  --accent-deep: #A07D45;
  --accent-wash: rgba(184, 147, 90, 0.08);

  /* Black, not the cool near-navy #101820 the Ceramics page uses.
     #0A0A0A rather than #000 so large fills do not halate under white text. */
  --surface-dark:       #0A0A0A;
  --surface-dark-raise: #171717;
}

/* ==========================================================================
   Interstyle Home variants
   ========================================================================== */

/* The Home hero is dark, so the nav sits light over it until it goes solid. */
.nav--dark:not(.is-scrolled)::before {
  background: linear-gradient(to bottom,
    rgba(16, 24, 32, 0.75) 0%,
    rgba(16, 24, 32, 0.35) 55%,
    rgba(16, 24, 32, 0) 100%);
}
.nav--dark:not(.is-scrolled) .nav__link  { color: var(--on-dark-1); }
.nav--dark:not(.is-scrolled) .nav__link:hover { color: var(--is-white); }
.nav--dark:not(.is-scrolled) .nav__switch { color: var(--on-dark-2); border-color: var(--on-dark-line); }
.nav--dark:not(.is-scrolled) .nav__switch:hover { color: var(--is-white); border-color: var(--is-white); }
.nav--dark:not(.is-scrolled) .nav__toggle span { background: var(--is-white); }

/* The Home wordmark artwork is black; flip it while the bar is transparent. */
.nav--dark:not(.is-scrolled) .nav__logo--home { filter: brightness(0) invert(1); }

/* Home's mark is far squarer than the Interstyle wordmark (2.3:1 vs 6.7:1),
   so it needs more height to carry the same visual weight. Grown in stages to
   23 Sep 2026, when it went up another 10% and the bar was widened with it:
   at the previous size the mark cleared the bar by under 7px and read cramped,
   against roughly 19px on the Interstyle wordmark. The bar is now sized so the
   mark keeps 11–16px of air above and below at every width. Both values are
   scoped to the Home body class, so the Interstyle bar is untouched. */
.theme-home-page    { --nav-h: clamp(5.5rem, 9.3vw, 7.95rem); }
.nav__logo--home    { height: clamp(4.1rem, 6.641vw, 5.93rem); }
.footer__logo--home {
  height: 4rem;
  filter: brightness(0) invert(1);   /* black artwork on a black footer */
}

@media (max-width: 940px) {
  /* The bar is solid at this width, so the artwork stays black. */
  .nav--dark:not(.is-scrolled) .nav__logo--home { filter: none; }
  .nav--dark:not(.is-scrolled) .nav__link,
  .nav--dark:not(.is-scrolled) .nav__switch { color: var(--ink); }
  .nav--dark:not(.is-scrolled) .nav__switch { border-color: var(--stone-dark); }
  .nav--dark:not(.is-scrolled) .nav__toggle span { background: var(--ink); }
}
