/* katherine emilie design: static rebuild of the Squarespace site.
   Layout is a re-implementation of Squarespace "Fluid Engine": each section is a CSS grid
   (24 columns from 768px up, 8 columns below) with 11px gaps; rows are  container-width * 0.0215  tall
   and grow with their content; every block is placed with the same grid-area numbers as the original.
   Type follows the original's fluid scale: size = (step - 1) * k + base, where
     desktop (>1024px): k = 1.2vw, base = 24px        tablet (768-1024px): k = 1.2vw, base = 16px
     phone (<768px):    k = 0.012 * min(100vh, 900px), base = 16px                                        */
:root {
  --pp: 3vw;                                   /* page gutter */
  --maxw: 3000px;
  --gap: 11px;
  --container: min(var(--maxw), calc(100vw - var(--pp) * 2));
  --rowh: calc(var(--container) * 0.0215);
  --base: 24px;
  --k: 1.2vw;
  --title-step: 6.2;
  --bg: #fff;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --fs-title: calc((var(--title-step) - 1) * var(--k) + var(--base));
  --fs-h2: calc(3.5 * var(--k) + var(--base));       /* step 4.5 */
  --fs-p: calc(0.5 * var(--k) + var(--base));        /* step 1.5 ("large") */
  --fs-cap: calc(0.2 * var(--k) + var(--base));      /* step 1.2 */
  --fs-small: calc(0.9 * var(--base));
  --pad-t: 3vw;                                /* section padding */
  --pad-b: max(6.6vw, 59px);
}
@media (max-width: 1024px) { :root { --base: 16px; } }
@media (max-width: 800px)  { :root { --title-step: 3; } }
@media (max-width: 767px)  {
  :root {
    --pp: 6vw;
    --k: calc(0.012 * min(100vh, 900px));
    --fs-small: calc(-0.1 * var(--k) + var(--base));
    --pad-t: 2.8vw;
    --pad-b: 14.4vw;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: #000; font-family: var(--font); font-weight: 400; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; }
.skip { position: absolute; left: -9999px; top: 0; background: #000; color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

/* ---------- header ---------- */
.site-header { position: relative; z-index: 2; background: #fff; box-shadow: 0 0 24px rgba(0, 0, 0, .3); padding: 1.2vw var(--pp) 1vw; }
.site-title {
  display: block; text-decoration: none; font-size: var(--fs-title); line-height: 1.2; letter-spacing: -0.03em;
}
@media (max-width: 800px) {
  .site-header { box-shadow: 0 0 16px rgba(0, 0, 0, .3); padding: calc(6vw - 6px) var(--pp) calc(6vw + 5px); }
  .site-title { line-height: 0.9; }
}

/* ---------- Fluid Engine grid ---------- */
.sec { padding: var(--pad-t) 0 var(--pad-b); }
.fe {
  --gg: calc(var(--pp) - var(--gap));
  --cell: calc((var(--maxw) - var(--gap) * 23) / 24);
  display: grid; position: relative; row-gap: var(--gap); column-gap: var(--gap);
  grid-template-columns: minmax(var(--gg), 1fr) repeat(24, minmax(0, var(--cell))) minmax(var(--gg), 1fr);
  grid-template-rows: repeat(var(--rows), minmax(var(--rowh), auto));
}
@media (max-width: 767px) {
  .fe {
    --cell: calc((var(--maxw) - var(--gap) * 7) / 8);
    grid-template-columns: minmax(var(--gg), 1fr) repeat(8, minmax(0, var(--cell))) minmax(var(--gg), 1fr);
    grid-template-rows: repeat(var(--rows-m), minmax(24px, auto));
  }
}
.blk { grid-area: var(--d); display: flex; flex-direction: column; justify-content: flex-start; min-width: 0; }
@media (max-width: 767px) { .blk { grid-area: var(--m); } }
.blk.img { position: relative; }   /* images fill their grid cell; their natural size must not stretch the rows */
.blk.img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

h2 { font-weight: 400; font-size: var(--fs-h2); line-height: 0.774; letter-spacing: -0.03em; }
p { font-size: var(--fs-p); line-height: 1.3; }
.prose p + p { margin-top: var(--base); }
strong { font-weight: 700; }

.s-hero { padding-top: 3vw; }
.s-services { padding-bottom: calc(var(--pad-b) + var(--fs-p) * 0.5); }
.s-projects-h { padding: 0; }

/* bulleted Services list: the original has an empty paragraph, then a 24px margin, above the list */
.s-services .blk:last-child { padding-top: calc(2.3 * var(--base)); }
.bullets { padding-left: 40px; list-style: disc outside; font-size: var(--base); }
.bullets li + li { margin-top: calc(var(--fs-p) * 0.5); }

/* Clients: two white rounded boxes on a light band */
.s-clients { background: #fafafa; padding: var(--pad-b) 0; min-height: 66vh; display: flex; flex-direction: column; justify-content: center; }
.s-clients .fe { width: 100%; }
.box { background: #fff; border-radius: 22px; text-align: center; justify-content: center; padding: 0 1.4vw; }
.box ul { padding: 0; }
.box:last-child { padding: 13.31px calc(0.924vw); }
.box:last-child li + li { margin-top: var(--base); }
@media (max-width: 767px) {
  .s-clients { padding: 14.4vw 0; }
  .box { padding: 0 10px; }
  .box:last-child { padding: 13px 10px; }
}

/* Contact band */
.s-contact { background: #dcdcdc; padding: 3vw 0 13.2vw; }
@media (max-width: 767px) { .s-contact { padding: 2.8vw 0 27.4vw; } .s-services { padding-bottom: calc(var(--pad-b) + var(--fs-p) * 0.5 - 10px); } }
.s-ig { background: #fafafa; padding: 0; }
.blk.img.fit img { top: 50%; bottom: auto; height: auto; transform: translateY(-50%); }   /* About: natural aspect, centred */
.s-ig .blk { position: relative; }
.ig { position: absolute; inset: 0; display: flex; justify-content: center; }
.ig img { height: 100%; width: auto; }

.contact-form { width: 100%; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; }
legend { grid-column: 1 / -1; font-size: var(--base); line-height: calc(1.2em + 6px); padding: 0; float: left; width: 100%; }
label { display: block; font-size: var(--base); line-height: 1.125; padding: 4px 0 3px; }
label span { font-size: var(--fs-small); opacity: .75; }
input[type=text], input[type=email], textarea {
  display: block; width: 100%; font: 300 var(--base)/1.3 var(--font); color: #000;
  background: transparent; border: 1px solid #000; border-radius: .4em; padding: 5px 10px;
}
textarea { height: 100px; resize: vertical; }
input:focus-visible, textarea:focus-visible { outline: 2px solid #000; outline-offset: 2px; }
.field { margin: 0; }
.field.wide { margin-top: 20px; }
.check { display: flex; align-items: center; gap: 10px; margin-top: 8px; min-height: 20px; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: #000; flex: none; }
.check label { padding: 0; line-height: 1.3; font-size: var(--fs-small); }
.check + .field.wide { margin-top: 24px; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
button[type=submit] {
  display: block; margin-top: 20px; font: 300 var(--base)/1 var(--font); width: 5.83em; height: 2.08em;
  background: #000; color: #dcdcdc; border: .5px solid #000; border-radius: .4em; cursor: pointer; padding: 0;
}
button[type=submit]:hover { background: #222; }
button[type=submit]:focus-visible { outline: 2px solid #000; outline-offset: 3px; }
button[type=submit][disabled] { opacity: .6; cursor: wait; }
.form-status { margin-top: 12px; font-size: var(--fs-small); }
.form-status.error { color: #a00000; }

/* ---------- Projects carousel ---------- */
.s-carousel { padding: 3.35vw 0 6vw; }
.carousel { position: relative; margin-left: var(--pp); }
.track {
  display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; -ms-overflow-style: none; padding-right: var(--pp);
}
.track::-webkit-scrollbar { display: none; }
.track:focus-visible { outline: 2px solid #000; outline-offset: 4px; }
.card { flex: 0 0 calc((100vw - var(--pp) * 2 - 60px) / 2); scroll-snap-align: start; }
.card img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.card h3 { font-weight: 400; font-size: var(--fs-cap); line-height: 0.774; letter-spacing: -0.03em; margin-top: 2.65vw; width: 75%; }
.card p { font-size: var(--fs-small); margin-top: 2.65vw; width: 75%; }
.arrow {
  position: absolute; top: 15vw; transform: translateY(-50%); width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .85); color: #000; font: 22px/44px var(--font); cursor: pointer; padding: 0;
}
.arrow:hover, .arrow:focus-visible { background: #fff; outline: 2px solid #000; }
.arrow.prev { left: 0; }
.arrow.next { right: var(--pp); }
@media (max-width: 767px) {
  .s-carousel { padding: 7.2vw 0 30.5vw; }
  .carousel { margin-left: calc(var(--pp) - var(--gap)); }
  .card { flex-basis: calc(100vw - var(--pp)); }
  .card h3 { margin-top: 5.9vw; }
  .card p { margin-top: 5.6vw; }
  .arrow { top: 31vw; width: 36px; height: 36px; font-size: 18px; line-height: 36px; }
}

/* ---------- footer credits ---------- */
.site-footer { text-align: center; padding: 2.08vw var(--pp) 0; background: #fff; }
.site-footer p { font-size: var(--base); line-height: 1.3; max-width: 39.15vw; margin: 0 auto; }
.site-footer p + p { margin-top: var(--base); }
@media (max-width: 767px) { .site-footer { padding-top: 12.3vw; } .site-footer p { max-width: none; } }

@media (prefers-reduced-motion: reduce) { .track { scroll-behavior: auto; } }
