/* Carolina Blanchard — rebuilt from the Squarespace site (Fluid Engine layout) */

/* ---------- Theme ---------- */
:root {
  --white: #fff;
  --black: rgb(57, 61, 68);
  --accent: rgb(159, 135, 131);
  --dark-accent: rgb(88, 93, 81);
  --light-accent: rgb(229, 227, 220);

  /* Heading font is Adobe Fonts "swear-display"; Playfair Display is the free fallback */
  --font-display: "swear-display", "Playfair Display", serif;
  --font-body: "Helvetica Neue", Arial, sans-serif;
  --font-meta: "Inter", sans-serif;

  /* Squarespace fluid type: size = (value - 1) * k + 1rem */
  --k: calc(1.2 * min(1vmax, 9px));
  --gutter: 6vw;
  --max-width: 1400px;
  --gap: 11px;
  --header-h: 84px;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
}
@media (min-width: 768px) {
  :root { --k: calc(1.2 * min(1vmax, 14px)); --header-h: calc(3.57vw + 76px); }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--font-body);
  font-size: calc(0.2 * var(--k) + 1rem);
  line-height: 1.2em;
  letter-spacing: -0.03em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }

h1, h2 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.03em;
  margin: 2rem 0;
}
h1 { font-size: calc(3 * var(--k) + 1rem); line-height: 1.056; }
h2 { font-size: calc(1.8 * var(--k) + 1rem); line-height: 1.1136; }
h1 strong, h2 strong { font-weight: 700; }
p { margin: 1rem 0; white-space: pre-wrap; }
.text > :first-child { margin-top: 0; }
.text > :last-child { margin-bottom: 0; }
.t-small { font-size: 1rem; }
.t-large { font-size: calc(0.5 * var(--k) + 1rem); }
.ta-c { text-align: center; }
.label {
  font-family: var(--font-meta);
  font-weight: 600;
  font-size: calc(-0.2 * var(--k) + 1rem);
  letter-spacing: 0.01em;
  margin: 0;
}

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

/* ---------- Section themes ---------- */
.theme-white, .theme-white-bold { background: var(--white); color: var(--black); }
.theme-white-bold h1, .theme-white-bold h2 { color: var(--accent); }
.theme-bright { background: var(--accent); color: var(--white); }
.theme-black { background: var(--black); color: var(--white); }

/* ---------- Header ---------- */
.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 41px var(--gutter) 8px;
}
.site-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: calc(0.2 * var(--k) + 1rem);
  line-height: 1.2em;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.site-nav { display: none; }
.burger {
  position: relative;
  width: 35px;
  height: 35px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  z-index: 2;
}
.burger span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--black);
  transition: transform 0.3s ease, top 0.3s ease;
}
.burger span:first-child { top: 13px; }
.burger span:last-child { top: 21px; }
.menu-open .burger span:first-child { top: 17px; transform: rotate(45deg); }
.menu-open .burger span:last-child { top: 17px; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 23px;
  padding-top: 84px;
  background: var(--white);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}
.menu-open .mobile-menu { opacity: 1; visibility: visible; }
.menu-open { overflow: hidden; }
.mobile-menu a {
  font-size: calc(1.693 * var(--k) + 1rem);
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: normal;
}

@media (min-width: 768px) {
  .site-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    padding: 2.57vw var(--gutter) calc(1vw + 2px);
  }
  .site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    column-gap: 1.5vw;
    row-gap: 2px;
  }
  .site-nav a {
    font-size: calc(0.2 * var(--k) + 1rem);
    line-height: 1.8em;
    letter-spacing: normal;
    text-transform: uppercase;
    text-decoration: none;
    padding-bottom: 0.1em;
    background: linear-gradient(currentColor, currentColor) no-repeat 0 calc(100% - 0.1em) / 0 1px;
    transition: background-size 0.3s ease;
  }
  .site-nav a:hover,
  .site-nav a[aria-current="page"] { background-size: 100% 1px; }
  .burger, .mobile-menu { display: none; }
}

/* ---------- Sections & Fluid Engine grid ---------- */
.sec { position: relative; }
.sec--medium {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 66vh;
  padding: 6.6vmax 0;
}
/* Squarespace counts the header inside the first section's height */
main > .sec--medium:first-child { min-height: calc(66vh - var(--header-h)); }
.sec--small {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 33vh;
  padding: 3.3vmax 0;
}

.fe {
  --gg: calc(var(--gutter) - var(--gap));
  --cell: calc((var(--max-width) - var(--gap) * 7) / 8);
  display: grid;
  grid-template-rows: repeat(var(--rows-m), minmax(24px, auto));
  grid-template-columns: minmax(var(--gg), 1fr) repeat(8, minmax(0, var(--cell))) minmax(var(--gg), 1fr);
  gap: var(--gap);
  overflow-x: clip;
}
.blk {
  grid-area: var(--m);
  z-index: var(--z, auto);
  display: flex;
  flex-direction: column;
  justify-content: var(--mv, flex-start);
  min-width: 0;
}
@media (min-width: 768px) {
  .fe {
    --cell: calc((var(--max-width) - var(--gap) * 23) / 24);
    --cw: min(var(--max-width), calc(100vw - var(--gutter) * 2));
    grid-template-rows: repeat(var(--rows-d), minmax(calc(var(--cw) * 0.0215), auto));
    grid-template-columns: minmax(var(--gg), 1fr) repeat(24, minmax(0, var(--cell))) minmax(var(--gg), 1fr);
  }
  .blk {
    grid-area: var(--d);
    justify-content: var(--dv, var(--mv, flex-start));
  }
}

.blk > .img-blk, .blk > .shape, .blk > .rule { flex: 1 1 auto; height: auto; }

/* Text scaled to fill its block (sized by main.js) */
.fit { display: inline-block; align-self: flex-start; margin: 0; line-height: 1; white-space: nowrap; }
.fit.ta-c { align-self: center; }

/* ---------- Image blocks ---------- */
.img-blk { position: relative; height: 100%; }
.img-blk img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focal, 50% 50%);
}
.img-blk--contain img { object-fit: contain; }

/* Images cropped to a shape keep a 2:3 frame, centred in the block */
.img-blk--shape { display: flex; justify-content: center; align-items: center; }
.img-blk--shape .shape-frame {
  position: relative;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 2 / 3;
}
.img-blk--arch .shape-frame { clip-path: url(#clip-arch); }
.img-blk--scallop .shape-frame { clip-path: url(#clip-scallop); }

.shape { height: 100%; }
.shape--light { background: var(--light-accent); }
.shape--dark { background: var(--dark-accent); }

/* Lightbox trigger (gallery page) */
.lightbox-trigger {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

/* ---------- Horizontal rule ---------- */
.rule { height: 100%; display: flex; flex-direction: column; justify-content: center; }
.rule hr { width: 100%; margin: 0.5em 0; border: 0; height: 1px; background: currentColor; }
.rule--end { justify-content: flex-end; }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 15%, #000 85%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, #000 15%, #000 85%, transparent 100%);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee var(--marquee-duration, 25s) linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  margin: 0;
  padding-right: 0.4em;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: calc(2.4 * var(--k) + 1rem);
  line-height: 1.4;
  white-space: nowrap;
  color: inherit;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

/* ---------- CAD gallery strips ---------- */
.strips { padding: 6vw var(--gutter); }
.strip-row { display: flex; flex-direction: column; gap: 20px; }
.strip-row + .strip-row { margin-top: 20px; }
.strip-row figure { margin: 0; }
.strip-row img { width: 100%; height: auto; }
@media (min-width: 768px) {
  .strip-row { flex-direction: row; }
  .strip-row figure { flex: var(--ar) 1 0; min-width: 0; }
  .strip-row img { aspect-ratio: var(--ar); object-fit: cover; }
}

/* ---------- Embed ---------- */
.embed { position: relative; width: 100%; padding-bottom: 129.4118%; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Footer ---------- */
.social { display: flex; justify-content: flex-end; height: 100%; }
.social a { display: block; width: 20px; height: 20px; }
.social svg { width: 100%; height: 100%; fill: currentColor; }
.social a:hover { opacity: 0.8; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vw;
  background: var(--white);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.lightbox-close::before, .lightbox-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 8px;
  width: 24px;
  height: 1px;
  background: var(--black);
}
.lightbox-close::before { transform: rotate(45deg); }
.lightbox-close::after { transform: rotate(-45deg); }

/* ---------- Scroll animations (html.anim is set in <head>; main.js adds .in) ---------- */
.anim :is(.text > *, .fit, .marquee, .site-title, .site-nav a, .burger) {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.anim :is(.img-blk, .strip-row figure) {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 0.8s var(--ease);
}
.anim :is(.rule, .social, .shape),
.anim footer .text > * {
  opacity: 0;
  transform: none;
  transition: opacity 0.8s var(--ease);
}
.anim .in.in {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 0 0);
}

/* ---------- 404 ---------- */
.notfound a { text-decoration: underline; }
