/* Layout: one 12-column grid. Every section follows one pattern: title, line, content.

   Type has five levels:
     Headline       hero only, cobalt capitals
     Section title  Expertise, Team, Contact Us: ink, heavy, wide capitals
     Subhead        hero value line, area leads, partner names, the Contact statement: ink
     Body           all paragraphs and lists: ink
     Small          tabs, menus, links, roles, contact keys: IBM Plex Mono capitals

   Colour has one job each: cobalt for the headline and links, ink for titles, subheads and body, muted for inactive tabs and
   roles, magenta for the active tab, hover and the emphasis in the headline. */
:root {
  --ground: #f5f6fd;
  --ink: #111850;
  --fg: #2337e6;
  --muted: #4f5a9e;
  --hair: rgba(17, 24, 80, .16);
  --contour: rgba(35, 55, 230, .15);
  --chart: #c2187a;
  --river: #c2187a;
  --s2: #e6e9fc;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 64px);
  --col-gap: clamp(16px, 2vw, 28px);
  --title-gap: clamp(14px, 1.6vw, 22px); /* between a section title and its line */
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.6;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--chart); color: var(--ground); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; }

.wrap { max-width: 1400px; margin-inline: auto; padding-inline: var(--gutter); }
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
}
.grid > * { min-width: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Section title */
.label-row h2, .stratum h2, .contact-h {
  margin: 0;
  font-family: var(--font);
  font-weight: 800;
  font-size: 1.125rem;
  line-height: 1.1;
  letter-spacing: .02em;
  text-transform: uppercase;
  font-variation-settings: "wdth" 125;
  color: var(--ink);
}
.label-row { grid-column: 1 / -1; padding-bottom: var(--title-gap); }

/* Subhead: the hero value line, area leads, partner names and the Contact statement all share one style */
.hero-sub, .stratum .lead, .person-name, .contact-statement {
  margin: 0;
  font-family: var(--font);
  font-weight: 500;
  font-size: clamp(1.125rem, 1rem + .5vw, 1.5rem);
  line-height: 1.22;
  letter-spacing: -.012em;
  font-variation-settings: "wdth" 92;
  color: var(--ink);
}

/* Small */
.mono, .nav a, .stratum-link, .person-link, .person-more, .contact-lines dt {
  font-family: var(--mono);
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  font-variation-settings: normal;
}

/* Links: cobalt, magenta on hover */
.nav a, .stratum-link, .stratum-inline, .person-link, .person-more, .contact-lines a { color: var(--fg); transition: color .2s; }
.nav a, .stratum-link, .person-link, .contact-lines a { text-decoration: none; }
.nav a:hover, .nav a:focus-visible,
.stratum-link:hover, .stratum-link:focus-visible,
.stratum-inline:hover, .stratum-inline:focus-visible,
.person-link:hover, .person-link:focus-visible,
.person-more:hover, .person-more:focus-visible,
.contact-lines a:hover, .contact-lines a:focus-visible { color: var(--chart); }

/* Header */
.top { position: absolute; inset: 0 0 auto 0; z-index: 3; padding-top: env(safe-area-inset-top, 0px); }
.top .wrap { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-block: 22px; }
/* Logo: CARVE split along one diagonal, the halves slipped apart, a magenta line on the cut; CAPITAL tracked out beneath.
   The letters are drawn here rather than typed in the page, so its text reads "Carve Capital" once, not "CARVECARVE C A P I T A L". */
.mark {
  --logo: 2rem;
  text-decoration: none;
  color: var(--fg);
  display: inline-grid;
  gap: calc(var(--logo) * .2);
  line-height: 1;
}
.slip {
  position: relative;
  display: block;
  font-weight: 800;
  font-size: var(--logo);
  line-height: .78;
  letter-spacing: -.035em;
  font-variation-settings: "wdth" 108;
  white-space: nowrap;
  padding-block: .02em;
}
.slip span { display: block; }
.slip span::before { content: "CARVE"; }
.slip .s1 { clip-path: polygon(-20% -20%, 120% -20%, 120% 10.8%, -20% 89.2%); transform: translate(.08em, -.045em); }
.slip .s2 { position: absolute; inset: .02em 0 auto 0; clip-path: polygon(-20% 89.2%, 120% 10.8%, 120% 120%, -20% 120%); transform: translate(-.08em, .045em); }
.slip svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.slip line { stroke: var(--chart); stroke-width: 1; vector-effect: non-scaling-stroke; }
.mark .cap {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: calc(var(--logo) * .3);
  font-variation-settings: "wdth" 112;
  padding-inline: .1em;
}
.mark .cap span::before { content: attr(data-l); }
.nav { display: flex; gap: clamp(14px, 2.4vw, 32px); flex-wrap: wrap; }
.top .nav { align-items: center; }
.nav-link { padding-block: 6px; }

/* Header menu: Expertise is the parent; its three areas drop down on hover or keyboard focus */
.menu { position: relative; }
.menu .parent { display: inline-flex; align-items: center; gap: 8px; padding-block: 6px; }
.menu .parent::after {
  content: "";
  width: 6px; height: 6px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .25s ease;
}
.menu .areas {
  position: absolute;
  right: 0; top: 100%;
  padding-top: 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .2s ease, transform .25s ease, visibility 0s linear .25s;
}
.menu .areas ul {
  list-style: none;
  margin: 0;
  padding: 10px 0;
  width: max-content;
  background: var(--ground);
  border: 1px solid var(--hair);
  border-top: 2px solid var(--chart);
}
.menu .areas a { display: block; padding: 9px 18px; white-space: nowrap; }
.menu .areas a:hover, .menu .areas a:focus-visible { background: var(--s2); }
.menu:hover .areas, .menu:focus-within .areas {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .2s ease, transform .25s ease, visibility 0s;
}
.menu:hover .parent::after, .menu:focus-within .parent::after { transform: translateY(1px) rotate(225deg); }
@media (prefers-reduced-motion: reduce) { .menu .areas, .menu .parent::after { transition: none; } }

/* Hero: headline, value line and button above the fold. The contours stay to the right, clear of the words,
   fading out before the section below; on phones there is no room for them beside the words, so they go. */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}
.hero canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block;
  -webkit-mask-image: linear-gradient(to right, transparent 46%, #000 68%), linear-gradient(to bottom, #000 60%, transparent 98%);
  mask-image: linear-gradient(to right, transparent 46%, #000 68%), linear-gradient(to bottom, #000 60%, transparent 98%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
.hero .wrap { width: 100%; padding-block: clamp(96px, 10vw, 128px) clamp(32px, 3.5vw, 48px); }
.hero-copy { display: grid; gap: clamp(14px, 1.6vw, 20px); }
.hero h1 {
  margin: 0;
  font-weight: 850;
  font-size: clamp(2rem, .3rem + 2.8vw, 3.375rem);
  line-height: .98;
  letter-spacing: -.015em;
  text-transform: uppercase;
  font-variation-settings: "wdth" 125;
  text-wrap: balance;
  color: var(--fg);
}
.hero h1 em { font-style: normal; color: var(--chart); }
/* The value line: subhead style (above), kept to a readable measure */
.hero-sub { max-width: 34em; text-wrap: pretty; }
.hero-body { margin: 0; max-width: 34em; text-wrap: pretty; }

/* Button: solid cobalt, square corners, fades to magenta on hover */
.btn-cta {
  display: inline-block;
  padding: 12px 28px;
  background: var(--fg);
  color: var(--ground);
  border: 1px solid var(--fg);
  border-radius: 0;
  font-family: var(--font);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.4;
  font-variation-settings: "wdth" 100;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .3s, border-color .3s;
}
.btn-cta:hover, .btn-cta:focus-visible { background: var(--chart); border-color: var(--chart); color: var(--ground); }
.btn-cta:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
.hero-copy .btn-cta { justify-self: start; }
@media (prefers-reduced-motion: reduce) { .btn-cta { transition: none; } }
@media (max-width: 520px) { .btn-cta { white-space: normal; text-align: center; } }

@media (prefers-reduced-motion: no-preference) {
  .hero h1, .hero-sub, .hero-body, .hero .btn-cta { animation: surface 1.2s cubic-bezier(.2,.7,.1,1) both; }
  @keyframes surface { from { opacity: .001; transform: translateY(18px); } }
}

/* Expertise: title, then one row of tabs under a single line. A magenta marker sits on the line above the open tab. */
.expertise { padding-top: clamp(24px, 3vw, 40px); }
.journey-wrap { scroll-margin-top: clamp(16px, 2vw, 32px); }
.journey {
  grid-column: 1 / -1;
  position: relative;
  display: grid;
  grid-template-columns: subgrid;
  border-top: 1px solid var(--ink);
}
.journey .band { grid-column: span 4; display: block; text-decoration: none; }
.journey .band:focus-visible { outline: none; }
.journey .band .lbl { display: block; padding-top: 12px; color: var(--ink); cursor: pointer; transition: color .2s; }
.journey .band[aria-selected="false"] .lbl { color: var(--muted); }
.journey .band:hover .lbl, .journey .band:focus-visible .lbl { color: var(--chart); }
.journey .band:focus-visible .lbl { outline: 2px solid var(--fg); outline-offset: 4px; }
.journey .marker {
  position: absolute; left: 0; top: -3px; height: 6px; width: 0;
  background: var(--chart);
  opacity: 0;
  pointer-events: none;
  transition: transform .55s cubic-bezier(.3,.7,.2,1), width .55s cubic-bezier(.3,.7,.2,1), opacity .3s;
}
.journey.has-marker .marker { opacity: 1; }
@media (max-width: 520px) { .journey .band .lbl { font-size: .6875rem; letter-spacing: .04em; } }

/* The three areas. Without the tabs script they simply stack, each with its own title. */
.stratum { position: relative; scroll-margin-top: clamp(20px, 3vw, 40px); }
.stratum .grid { padding-block: clamp(24px, 2.6vw, 36px) clamp(20px, 2.4vw, 32px); row-gap: 20px; }
.stratum-text { grid-column: 1 / -1; display: grid; gap: 20px; align-self: start; }
.stratum-body { display: grid; gap: clamp(22px, 2.6vw, 32px); align-content: start; }
.stratum .lead { text-wrap: pretty; }
.stratum p { margin: 0; max-width: 58ch; color: var(--ink); text-wrap: pretty; }
/* A bulleted list inside an area's text, led by a short line; used by Valuations. */
.stratum-list ul { margin: .5em 0 0; padding-left: 1.15em; max-width: 58ch; color: var(--ink); display: grid; gap: .3em; }
.stratum-link { justify-self: start; }
.stratum-inline { text-underline-offset: .15em; }

/* Photographs: in their own colours. Each sits on a pale frame and fades in once decoded (script in index.html),
   so a frame is never seen empty in a strong colour. */
.plate { grid-column: 1 / -1; margin: 0; padding-top: 6px; align-self: start; background: var(--s2) content-box; }
.plate .tone { display: block; overflow: hidden; aspect-ratio: 3 / 2; opacity: 0; transition: opacity .4s ease; }
.plate .tone.is-ready { opacity: 1; }
.plate img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 881px) {
  .stratum-text { grid-column: 1 / 7; }
  .stratum-body { padding-right: clamp(0px, 1.5vw, 24px); }
  .plate { grid-column: 8 / 13; }
  .plate .tone { aspect-ratio: 4 / 3; }
  .stratum-text, .plate { grid-row: 1; }
}

/* Areas as tabs: only the open area takes up room, so the page follows it and no space is left under a short area.
   The open area rises into place as it appears. */
.strata.is-tabs > .stratum.is-off { display: none; }
/* Until the tab script runs, keep every area out of layout, so a closed tab's photo isn't fetched until it is opened */
.js .strata:not(.is-tabs) > .stratum { display: none; }
.strata.is-tabs > .stratum { animation: area-in .45s cubic-bezier(.2,.7,.1,1) both; }
.strata.is-tabs .stratum-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@keyframes area-in { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) {
  .strata.is-tabs > .stratum { animation: none; }
  .journey .marker, .plate .tone { transition: none; }
}

/* Team: each partner's photo, name and role, then their bio and LinkedIn link.
   All of it comes from partner1 and partner2 in copy.yml. */
.team { padding-top: clamp(56px, 6vw, 96px); scroll-margin-top: clamp(20px, 3vw, 40px); }
.team .grid { row-gap: clamp(20px, 2.4vw, 32px); }
.team .label-row { border-bottom: 1px solid var(--ink); }
.people { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(32px, 4vw, 48px) var(--col-gap); padding-top: 12px; }
.person { display: grid; grid-template-columns: clamp(96px, 11vw, 160px) minmax(0, 1fr); column-gap: clamp(16px, 2vw, 28px); align-content: start; }
.person-photo { grid-column: 1; grid-row: 1; margin: 0; }
.person-photo img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.person-head { grid-column: 2; grid-row: 1; align-self: end; display: grid; gap: 8px; }
.person-role { margin: 0; color: var(--muted); }
.person-body { grid-column: 1 / -1; margin-top: clamp(16px, 1.8vw, 24px); }
.person-bio p { margin: 0 0 .9em; color: var(--ink); text-wrap: pretty; }
.person-link { display: inline-block; margin-top: 6px; }
/* Phones: the first paragraph of each bio, then Read more beside LinkedIn (script in index.html) */
.person-more { display: none; margin: 6px 24px 0 0; padding: 0; border: 0; background: none; cursor: pointer; }
@media (min-width: 881px) { .people { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 0; } }

/* Contact: the invitation on the left, the ways to reach Carve on the right, each on its own hairline */
.contact { padding-block: clamp(48px, 5vw, 80px) clamp(40px, 4vw, 64px); row-gap: clamp(18px, 2vw, 26px); }
.contact-h { grid-column: 1 / -1; padding-bottom: var(--title-gap); border-bottom: 1px solid var(--ink); }
.contact-statement { grid-column: 1 / -1; text-wrap: balance; }
.contact-lines { margin: 0; }
.contact-list { grid-column: 1 / -1; align-self: start; margin-block: clamp(8px, 1.4vw, 20px) clamp(8px, 1.5vw, 24px); border-top: 1px solid var(--hair); }
.contact-list div { padding: 12px 0 14px; border-bottom: 1px solid var(--hair); }
.contact-lines div { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); align-items: baseline; column-gap: var(--col-gap); }
.contact-lines dt { color: var(--muted); }
.contact-lines dt span[aria-hidden] { display: inline-block; font-size: 1.35em; line-height: 1; transform: translateY(.04em); }
/* Body size, like the bios; the links keep their cobalt */
.contact-lines dd { margin: 0; font-size: 1.125rem; line-height: 1.6; }
@media (min-width: 881px) {
  .contact-statement { grid-column: 1 / 6; }
  .contact-list { grid-column: 7 / 13; grid-row: 2; margin-top: 6px; }
}
@media (max-width: 880px) {
  .contact-lines div { grid-template-columns: 2.25rem minmax(0, 1fr); column-gap: 8px; }
}

/* Small mark: the C with the same diagonal cut, a magenta edge along the cut. Signs off the page in the footer corner. */
.mark-sm { display: inline-block; width: 44px; height: 44px; line-height: 0; }
.mark-sm svg { width: 100%; height: 100%; display: block; }
.mark-sm .c { fill: var(--fg); }
.mark-sm .edge { fill: var(--chart); }

/* Footer: in the same order of importance as the page. Expertise sits over its three areas; Team and Contact Us beside it. */
.foot .base { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; padding-block: 28px 36px; }
.foot .nav { align-items: flex-start; gap: clamp(32px, 5vw, 72px); flex-wrap: nowrap; }
.foot-group { display: grid; gap: 10px; justify-items: start; }
.foot .nav a.foot-top { color: var(--ink); padding-bottom: 4px; }
.foot .nav a.foot-top:hover, .foot .nav a.foot-top:focus-visible { color: var(--chart); }

/* Consultation page ("Let's talk"): one screen, the button its main action. The email and phone follow under the line.
   The page fills the window so the footer sits at the bottom. */
body:has(.hero--page) { min-height: 100svh; display: flex; flex-direction: column; }
body:has(.hero--page) main { flex: 1; }
.reach { padding-block: clamp(8px, 1.5vw, 20px) clamp(40px, 5vw, 64px); }
.reach-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px var(--col-gap); border-top: 1px solid var(--ink); padding-top: clamp(20px, 2.4vw, 32px); }
@media (max-width: 640px) { .reach-row { grid-template-columns: minmax(0, 1fr); } }

/* On small laptops the words take up more of the width, so the contours start further right */
@media (max-width: 1180px) {
  .hero canvas {
    -webkit-mask-image: linear-gradient(to right, transparent 66%, #000 84%), linear-gradient(to bottom, #000 60%, transparent 98%);
    mask-image: linear-gradient(to right, transparent 66%, #000 84%), linear-gradient(to bottom, #000 60%, transparent 98%);
  }
}

@media (max-width: 880px) {
  .hero canvas { display: none; }
  /* Touch screens have no hover, so Expertise is a plain link to the section: no arrow, no dropdown */
  .menu .parent::after, .menu .areas { display: none; }
  /* Footer links sit close together; padding keeps each one easy to tap */
  .foot .nav { line-height: 1.4; }
  .foot .nav a { padding-block: 6px; }
  .foot-group { gap: 0; }
  .person-more { display: inline-block; }
  .person-bio.is-short p:not(:first-child) { display: none; }
}

/* Phones: logo and all three menu links on one row, a little smaller to fit, with taller tap areas */
@media (max-width: 520px) {
  .top .wrap { gap: 8px; }
  .top .nav { gap: 10px; flex-wrap: nowrap; }
  .top .nav a { font-size: .6875rem; letter-spacing: .04em; padding-block: 12px; }
  .top .mark { --logo: 1.5rem; }
}
