/* ==========================================================================
   Squircle Labs — company landing page
   Apple's homepage grammar: a light canvas, full-width product tiles
   separated by 12px gutters, centred headlines, and pill or chevron links.
   ========================================================================== */

:root {
  --canvas: #ffffff;
  --tile: #f5f5f7;
  --tile-dark: #000000;
  --ink: #1d1d1f;
  --ink-secondary: #6e6e73;
  --ink-on-dark: #f5f5f7;
  --ink-on-dark-secondary: #a1a1a6;
  --hairline: #d2d2d7;

  /* Manuscript's own colours, used only inside its product tile. */
  --manuscript: #d11840; /* white 5.36:1 */
  --manuscript-hover: #b5113a;
  --manuscript-text: #ff718b; /* 7.99:1 on black */

  --font: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Geist",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-text: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Geist",
    "Helvetica Neue", Helvetica, Arial, sans-serif;

  --gutter: 12px;
  --nav-height: 44px;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + var(--gutter));
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 17px;
  letter-spacing: -0.022em;
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

img,
svg {
  display: block;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid #0071e3;
  outline-offset: 3px;
  border-radius: 4px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: absolute;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 16px;
  border-radius: 980px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  text-decoration: none;
  translate: 0 -200%;
}

.skip-link:focus-visible {
  translate: 0 0;
}

/* --------------------------------------------------------------------------
   Global navigation
   -------------------------------------------------------------------------- */

.globalnav {
  position: sticky;
  z-index: 50;
  top: 0;
  background: rgba(245, 245, 247, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

/* Same column as the Squircle bar on the Manuscript page: 95% of the
   viewport, logo at the left edge, links at the right, 24px apart. */
.globalnav__inner {
  display: flex;
  width: min(95%, 105rem);
  height: var(--nav-height);
  align-items: center;
  justify-content: space-between;
  margin-inline: auto;
  gap: 1.5rem;
}

.globalnav__brand {
  display: grid;
  width: 2.75rem;
  height: var(--nav-height);
  flex: none;
  place-items: center start;
  color: var(--ink);
}

.globalnav__mark {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.globalnav__links {
  display: flex;
  gap: 1.5rem;
}

.globalnav__links a {
  display: block;
  padding-block: 12px;
  color: var(--ink);
  font-size: 0.8125rem;
  letter-spacing: -0.005em;
  line-height: 20px;
  opacity: 0.8;
  text-decoration: none;
  transition: opacity 0.2s var(--ease);
}

.globalnav__links a:hover {
  opacity: 1;
}

.globalnav__toggle {
  display: none;
}

/* --------------------------------------------------------------------------
   Shared tile type
   -------------------------------------------------------------------------- */

main {
  display: grid;
  gap: var(--gutter);
  padding-block-end: var(--gutter);
}

.tile {
  position: relative;
  overflow: hidden;
  background: var(--tile);
  text-align: center;
}

.tile h2,
.tile h1 {
  font-family: var(--font);
  font-size: clamp(40px, 5.2vw, 56px);
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.07;
}

.tile__subhead {
  margin-block-start: 6px;
  font-family: var(--font);
  font-size: clamp(21px, 2.4vw, 28px);
  font-weight: 400;
  letter-spacing: 0.007em;
  line-height: 1.14;
}

.eyebrow {
  margin-block-end: 12px;
  color: var(--ink-secondary);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.022em;
}

.tile__links,
.tile__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 32px;
  margin-block-start: 22px;
}

.tile__actions {
  gap: 14px;
}

.chevron-link {
  color: #0066cc;
  font-size: 17px;
  text-decoration: none;
}

.chevron-link::after {
  display: inline-block;
  margin-inline-start: 0.3em;
  content: "›";
  transition: translate 0.2s var(--ease);
}

.chevron-link:hover {
  text-decoration: underline;
}

.chevron-link:hover::after {
  translate: 2px 0;
}

.pill {
  display: inline-flex;
  min-width: 28px;
  align-items: center;
  justify-content: center;
  padding: 11px 21px;
  border: 1px solid transparent;
  border-radius: 980px;
  font-size: 17px;
  line-height: 1.18;
  text-decoration: none;
  transition:
    background-color 0.2s var(--ease),
    color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

/* --------------------------------------------------------------------------
   Hero: the squircle, breathing between circle and square
   -------------------------------------------------------------------------- */

.tile--hero {
  display: grid;
  min-height: min(692px, calc(100svh - var(--nav-height) - var(--gutter) * 2));
  align-content: center;
  justify-items: center;
  padding: 72px 24px 80px;
}

.hero-mark {
  width: clamp(120px, 17vw, 196px);
  height: auto;
  margin-block-end: 40px;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.16));
}

.tile--hero h1 {
  max-width: 12em;
  font-size: clamp(44px, 6.4vw, 80px);
  text-wrap: balance;
  letter-spacing: -0.015em;
  line-height: 1.05;
}

/* --------------------------------------------------------------------------
   Product tile: Manuscript
   -------------------------------------------------------------------------- */

.tile--product {
  display: grid;
  min-height: 692px;
  justify-items: center;
  align-content: start;
  padding-block-start: 56px;
  background: var(--tile-dark);
  color: var(--ink-on-dark);
}

.product__copy {
  display: grid;
  justify-items: center;
  padding-inline: 24px;
}

.product__icon {
  width: 72px;
  height: 72px;
  margin-block-end: 18px;
}

.product__note {
  margin-block-start: 10px;
  color: var(--ink-on-dark-secondary);
  font-size: 17px;
}

.tile--product .pill--filled {
  background: var(--manuscript);
  color: #fff;
}

.tile--product .pill--filled:hover {
  background: var(--manuscript-hover);
}

.tile--product .pill--outline {
  border-color: var(--manuscript-text);
  color: var(--manuscript-text);
}

.tile--product .pill--outline:hover {
  background: var(--manuscript-text);
  color: #000;
}

.product__shot {
  width: min(92%, 980px);
  height: auto;
  margin-block-start: 48px;
  /* The window sinks below the tile edge, the way Apple crops a device. */
  margin-block-end: -9%;
  border-radius: 12px 12px 0 0;
}

/* The crop lands in the white page of the document, and the next section is
   white too. A two-tone rule closes the tile: dark against the page, light
   against the black window chrome. */
.tile--product::after {
  content: "";
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: #1d1d1f;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Philosophy
   -------------------------------------------------------------------------- */

.philosophy {
  display: grid;
  gap: var(--gutter);
}

.philosophy__intro {
  max-width: 820px;
  margin-inline: auto;
  padding: 88px 24px 76px;
  text-align: center;
}

.philosophy__intro h2,
.letter h2 {
  text-wrap: balance;
}

.philosophy__intro h2 {
  font-family: var(--font);
  font-size: clamp(32px, 4.2vw, 48px);
  font-weight: 600;
  letter-spacing: -0.003em;
  line-height: 1.08;
}

.philosophy__intro h2 + p {
  max-width: 640px;
  margin: 20px auto 0;
  color: var(--ink-secondary);
  font-size: clamp(19px, 1.8vw, 21px);
  line-height: 1.38;
}

.tile-grid {
  display: grid;
  gap: var(--gutter);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-inline: var(--gutter);
}

.tile--half {
  display: grid;
  min-height: 580px;
  align-content: start;
  justify-items: center;
  padding: 52px 32px 0;
}

.tile--half h3 {
  font-family: var(--font);
  font-size: clamp(32px, 3.4vw, 40px);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.1;
}

.tile--half .tile__subhead {
  max-width: 22em;
  margin-block-start: 10px;
  color: var(--ink-secondary);
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.24;
}

.figure {
  width: min(78%, 300px);
  height: auto;
  margin-block: auto 48px;
  padding-block-start: 32px;
}

.figure--precision .figure__guides line {
  stroke: #c7c7cc;
  stroke-dasharray: 2 3;
  stroke-width: 0.75;
}

.figure--precision .figure__shape {
  fill: none;
  stroke: var(--ink);
  stroke-width: 0.9;
}

.figure--precision .figure__inset {
  fill: var(--ink);
}

.figure--precision .figure__point {
  fill: #fff;
}

.tile--flow {
  background: var(--tile-dark);
  color: var(--ink-on-dark);
}

.tile--flow .tile__subhead {
  color: var(--ink-on-dark-secondary);
}

.figure--flow {
  width: min(92%, 380px);
  fill: var(--ink-on-dark);
}

.figure--flow .figure__lead {
  fill: var(--ink-on-dark);
}

/* --------------------------------------------------------------------------
   Founder's letter
   -------------------------------------------------------------------------- */

.tile--letter {
  padding: 96px 24px 104px;
  text-align: left;
}

.letter {
  max-width: 680px;
  margin-inline: auto;
}

.letter .eyebrow {
  text-align: center;
}

.letter h2 {
  max-width: 18ch;
  margin-inline: auto;
  font-size: clamp(32px, 4.2vw, 48px);
  text-align: center;
}

.letter__body {
  display: grid;
  gap: 1.15em;
  margin-block-start: 56px;
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.6;
}

.letter__close {
  font-family: var(--font);
  font-size: clamp(21px, 2.2vw, 24px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.33;
}

.letter__signature {
  margin-block-start: 48px;
  padding-block-start: 24px;
  border-top: 1px solid var(--hairline);
}

.letter__name {
  font-family: var(--font);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.letter__role {
  margin-block-start: 4px;
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Global footer
   -------------------------------------------------------------------------- */

.globalfooter {
  background: var(--tile);
  color: var(--ink-secondary);
  font-size: 12px;
  letter-spacing: -0.01em;
  line-height: 1.33;
}

.globalfooter__inner {
  max-width: 1024px;
  margin-inline: auto;
  padding: 40px 22px 24px;
}

.globalfooter__directory {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 200px));
  padding-block-end: 24px;
}

.globalfooter__col h2 {
  margin-block-end: 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.globalfooter__col li + li {
  margin-block-start: 8px;
}

.globalfooter a {
  color: #424245;
  text-decoration: none;
}

.globalfooter a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.globalfooter__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 28px;
  padding-block-start: 16px;
  border-top: 1px solid var(--hairline);
}

.globalfooter__legal ul {
  display: flex;
  flex-wrap: wrap;
}

.globalfooter__legal li + li {
  margin-inline-start: 10px;
  padding-inline-start: 10px;
  border-inline-start: 1px solid var(--hairline);
}

.globalfooter__locale {
  margin-inline-start: auto;
}

/* --------------------------------------------------------------------------
   Reveal on scroll
   -------------------------------------------------------------------------- */

.js [data-reveal] {
  opacity: 0;
  translate: 0 28px;
  transition:
    opacity 0.9s var(--ease),
    translate 0.9s var(--ease);
}

.js [data-reveal].is-visible {
  opacity: 1;
  translate: 0 0;
}

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

@media (max-width: 1068px) {
  .tile--product {
    min-height: 620px;
  }

  .tile--half {
    min-height: 520px;
  }
}

@media (max-width: 734px) {
  :root {
    --nav-height: 48px;
  }

  .globalnav__inner {
    padding-inline: 16px;
  }

  .globalnav__toggle {
    position: relative;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    margin-inline-end: -12px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    cursor: pointer;
  }

  .globalnav__toggle span,
  .globalnav__toggle span::before {
    display: block;
    width: 17px;
    height: 1.5px;
    border-radius: 1px;
    background: currentColor;
    transition:
      rotate 0.25s var(--ease),
      translate 0.25s var(--ease);
  }

  .globalnav__toggle span {
    translate: 0 -3.5px;
  }

  .globalnav__toggle span::before {
    content: "";
    translate: 0 7px;
  }

  .globalnav__toggle[aria-expanded="true"] span {
    rotate: 45deg;
    translate: 0 0;
  }

  .globalnav__toggle[aria-expanded="true"] span::before {
    rotate: -90deg;
    translate: 0 0;
  }

  .globalnav__links {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    height: calc(100dvh - var(--nav-height));
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 12px 40px 40px;
    overflow-y: auto;
    background: var(--tile);
  }

  .globalnav__links.is-open {
    display: flex;
  }

  .globalnav__links a {
    padding-block: 8px;
    font-family: var(--font);
    font-size: 28px;
    font-weight: 600;
    line-height: 1.14;
    opacity: 1;
  }

  .tile--hero {
    padding-block: 56px 64px;
  }

  .tile--product {
    min-height: 0;
    padding-block-start: 48px;
  }

  .product__shot {
    width: 96%;
    margin-block-start: 36px;
  }

  .tile-grid {
    grid-template-columns: 1fr;
  }

  .tile--half {
    min-height: 480px;
    padding-inline: 24px;
  }

  .philosophy__intro {
    padding-block: 64px 52px;
  }

  .tile--letter {
    padding-block: 64px 72px;
  }

  .letter__body {
    margin-block-start: 40px;
  }

  .globalfooter__directory {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .globalfooter__locale {
    margin-inline-start: 0;
    flex-basis: 100%;
  }
}

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

  .js [data-reveal] {
    opacity: 1;
    translate: 0 0;
    transition: none;
  }

  .chevron-link::after,
  .globalnav__toggle span,
  .globalnav__toggle span::before {
    transition: none;
  }
}
