/* ------------------------------------------------------------------
   In Sequence — marketing site
   Palette and type take their cue from a quiet, warm-grey studio feel.
   ------------------------------------------------------------------ */

:root {
  --bg: #d6dbe0;          /* ice-cold grey page */
  --bg-deep: #c5ccd3;     /* slightly deeper grey for image frames */
  --ink: #1f242b;         /* cool near-black text */
  --ink-soft: #596470;    /* secondary text, inactive nav */
  --rule: rgba(31, 36, 43, 0.2);
  --accent: #d93a2a;      /* the red dot in the wordmark */
  --font: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;

  --gutter: clamp(24px, 6vw, 96px);
  --col-left: 260px;       /* label column on desktop */
  --measure: 60ch;
  --image-height: clamp(360px, 62vh, 760px);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Custom cursor: a black dot with a hairline white edge so it reads on photos;
   links and buttons turn the dot red, same size. Hotspot is the centre (16,16 of a 32px image). */
html, body {
  cursor: url("images/cursor/dot.png") 16 16, auto;
  cursor: -webkit-image-set(url("images/cursor/dot.png") 1x, url("images/cursor/dot@2x.png") 2x) 16 16, auto;
  cursor: image-set(url("images/cursor/dot.png") 1x, url("images/cursor/dot@2x.png") 2x) 16 16, auto;
}
a, button, [role="tab"], .track {
  cursor: url("images/cursor/dot-red.png") 16 16, pointer;
  cursor: -webkit-image-set(url("images/cursor/dot-red.png") 1x, url("images/cursor/dot-red@2x.png") 2x) 16 16, pointer;
  cursor: image-set(url("images/cursor/dot-red.png") 1x, url("images/cursor/dot-red@2x.png") 2x) 16 16, pointer;
}
.arrow:disabled { cursor: inherit; }
html, body { overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.55;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Outbound links in body copy are picked out in white */
.link-out { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

h1, h2, h3 { font-weight: 400; margin: 0; }
p { margin: 0 0 1.25em; }
p:last-child { margin-bottom: 0; }

/* ---------- Header ---------- */

.site-header {
  display: grid;
  grid-template-columns: var(--col-left) 1fr;
  align-items: center;
  gap: 24px;
  padding: 48px var(--gutter) 24px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
}

.brand {
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.005em;
}
.brand:hover { text-decoration: none; }

/* Wordmark and logo set as live text in Newsreader at display optical size.
   The red dot is a true circle centred on the x-height. */
.wm {
  display: inline-block;
  font-family: var(--font);
  font-weight: 400;
  font-variation-settings: "opsz" 72;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.005em;
  color: var(--ink);
  white-space: nowrap;
}
.wm-dot {
  display: inline-block;
  width: 0.2em;
  height: 0.2em;
  margin: 0 0.15em;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
  bottom: 0.13em;
}

.site-nav {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-size: 19px;
  color: var(--ink-soft);
}
.site-nav a { transition: color 150ms ease; }
.site-nav a:hover,
.site-nav a.is-active { color: var(--ink); text-decoration: none; }

.nav-toggle {
  display: none;
  appearance: none;
  background: none;
  border: 0;
  font: inherit;
  color: var(--ink);
  padding: 0;
  cursor: pointer;
  justify-self: end;
}

/* ---------- Sections ---------- */

.section {
  display: grid;
  grid-template-columns: var(--col-left) 1fr;
  gap: 24px;
  padding: 72px var(--gutter);
  border-top: 1px solid var(--rule);
  scroll-margin-top: 96px;
}

.section-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-top: 8px;
}

.section-label { transition: color 150ms ease; }
.section.is-active .section-label { color: var(--ink); }

.section-body { max-width: var(--measure); }

.lead { font-size: 24px; line-height: 1.45; }

/* Wordmark in running text: keep in.sequence on one line */
.wordmark { white-space: nowrap; }
.wordmark-dot { color: var(--accent); }

/* ---------- Services ---------- */

.service + .service { margin-top: 56px; }

.service-title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.service-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  color: var(--ink-soft);
}
.service-list li { line-height: 1.3; }

/* ---------- Projects ---------- */

.section--projects { grid-template-columns: var(--col-left) 1fr; }
.section--projects .section-label { grid-column: 1; }
.section--projects .section-body { grid-column: 2; }
.projects-intro { color: var(--ink-soft); margin-bottom: 12px; }

/* Sector list: plain text buttons, the active one in full ink */
.sector-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sector-link {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  line-height: 1.3;
  color: var(--ink-soft);
  transition: color 150ms ease;
}
.sector-link:hover { color: var(--ink); }
.sector-link.is-active { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.sector-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

.carousel {
  grid-column: 1 / -1;
  min-width: 0;             /* let the scrolling track shrink inside the grid */
  margin-top: 40px;
}

.carousel-head {
  display: grid;
  grid-template-columns: var(--col-left) 1fr auto;
  gap: 24px;
  align-items: baseline;
  margin-bottom: 20px;
}

.carousel-caption {
  grid-column: 2;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.carousel-controls { grid-column: 3; display: flex; gap: 8px; }

.arrow {
  appearance: none;
  background: none;
  border: 1px solid var(--rule);
  color: var(--ink);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}
.arrow:hover { background: rgba(31, 36, 43, 0.07); border-color: var(--ink); }
.arrow:disabled { opacity: 0.3; background: none; border-color: var(--rule); }

/* The image sequence: a horizontal scroll-snap track, no JS needed to browse. */
.track {
  display: flex;
  min-width: 0;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 8px;
  padding-left: calc(var(--col-left) + 24px);
  scroll-padding-left: calc(var(--col-left) + 24px);
  scrollbar-width: none;
  outline: none;
}
.track::-webkit-scrollbar { display: none; }
.track:focus-visible { box-shadow: 0 0 0 2px var(--ink); }

/* Each image sits at a shared height and keeps its own proportions,
   so portrait and landscape shots fill their frames with nothing cropped. */
.track figure {
  margin: 0;
  flex: 0 0 auto;
  height: var(--image-height);
  scroll-snap-align: start;
}
.track figure[hidden] { display: none; }
.track figure:last-child { margin-right: var(--gutter); }

.track img {
  display: block;
  height: 100%;
  width: auto;
  max-width: 88vw;
  object-fit: cover;
}

/* Project caption beneath the carousel, aligned with the text column */
.project-caption {
  margin: 20px 0 0;
  padding-left: calc(var(--col-left) + 24px);
  line-height: 1.4;
}
.project-caption:empty, .project-caption.is-empty { display: none; }
.project-name { display: block; }
.project-credit { display: block; font-size: 15px; color: var(--ink-soft); }

/* Gentle fade when the sector changes */
.track.is-switching figure { opacity: 0; }
.track figure { transition: opacity 220ms ease; }

/* ---------- Contact ---------- */

.contact-details {
  margin: 40px 0 32px;
  display: grid;
  gap: 14px;
}
.contact-details div { display: grid; grid-template-columns: 220px 1fr; gap: 16px; }
.contact-details dt { color: var(--ink-soft); }
.contact-details dd { margin: 0; }

.social {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 24px;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 40px var(--gutter) 56px;
  border-top: 1px solid var(--rule);
  font-size: 15px;
  color: var(--ink-soft);
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  :root { --col-left: 1fr; }

  .site-header {
    grid-template-columns: 1fr auto;
    padding-top: 24px;
  }
  .wm { font-size: 24px; }
  .nav-toggle { display: block; }
  .site-nav {
    grid-column: 1 / -1;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
    display: none;
  }
  .site-header.is-open .site-nav { display: flex; }

  .section,
  .section--projects { grid-template-columns: 1fr; gap: 16px; padding: 48px var(--gutter); }
  .section-label { padding-top: 0; }
  .section--projects .section-label,
  .section--projects .section-body { grid-column: 1; }

  .carousel-head { grid-template-columns: 1fr auto; }
  .carousel-caption { grid-column: 1; }
  .carousel-controls { grid-column: 2; }

  :root { --image-height: clamp(260px, 46vh, 520px); }
  .track { padding-left: 0; scroll-padding-left: 0; }
  .project-caption { padding-left: 0; }

  .contact-details div { grid-template-columns: 1fr; gap: 2px; }
}

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