/* Montserrat 9.000, Latin subset, every weight in one variable file.
   SIL Open Font License 1.1, in fonts/montserrat-OFL.txt. */
@font-face {
  font-family: "Montserrat";
  src: url("/fonts/montserrat-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Arial resized to Montserrat's measure, so nothing moves when it arrives. */
@font-face {
  font-family: "Montserrat fallback";
  src: local("Arial");
  size-adjust: 111.89%;
  ascent-override: 86.51%;
  descent-override: 22.43%;
  line-gap-override: 0%;
}

/* Colours sampled from the studio's portfolio. */
:root {
  --white: #fff;
  --greige: #c4bbaf;
  --oxblood: #5a2b28;
  --ink: #412d16;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  background: var(--white);
  color: var(--ink);
  font-family: "Montserrat", "Montserrat fallback", Arial, sans-serif;
  font-weight: 500;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
}

::selection {
  background: var(--oxblood);
  color: var(--white);
}

/* One grid holds the whole composition. Narrow screens stack the name across
   the top edge of the block; wide ones split it across the block's left edge,
   as the portfolio cover splits PORTFOLIO. */
.page {
  --name: clamp(2.75rem, 14.5vw, 5rem);
  --pad: calc(var(--name) * 0.3);
  --open: inset(0 0 100% 0);
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  grid-template-columns:
    [edge-start] var(--gutter)
    [block-start] var(--pad)
    [text-start] minmax(0, 1fr)
    [text-end] var(--pad)
    [block-end] var(--gutter)
    [edge-end];
  grid-template-rows:
    [top] var(--gutter)
    minmax(2rem, 1fr)
    [mark-start] auto
    [mark-end] calc(var(--name) * 0.5)
    [name-start name-a-start] auto
    [name-a-end] calc(var(--name) * 0.14)
    [block-top] calc(var(--name) * 0.2)
    [name-b-start] auto
    [name-b-end name-end] calc(var(--name) * 0.5)
    [rule-start] 1px
    [rule-end] 2rem
    [message-start] auto
    [message-end] minmax(3rem, 1fr)
    [address-start] auto
    [address-end] var(--pad)
    [block-bottom] var(--gutter)
    [bottom];
}

/* The fan stands over the name, as it stands over the wordmark in the logo. */
.mark {
  --mark: calc(var(--name) * 1.05);
  grid-row: mark;
  grid-column: text;
  display: block;
  width: auto;
  height: var(--mark);
}

.block {
  grid-row: block-top / block-bottom;
  grid-column: block-start / block-end;
  background: var(--greige);
}

.name {
  grid-row: name;
  grid-column: edge;
  display: grid;
  grid-template-columns: subgrid;
  grid-template-rows: subgrid;
  margin: 0;
  font-size: var(--name);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.name-a {
  grid-row: name-a;
  grid-column: text;
  color: var(--greige);
}

.name-b {
  grid-row: name-b;
  grid-column: text;
  color: var(--oxblood);
}

.rule {
  grid-row: rule;
  grid-column: block-start / block-end;
  width: 42%;
  background: var(--white);
}

.message {
  grid-row: message;
  grid-column: text;
}

.label {
  margin: 0 0 1.1rem;
  color: var(--oxblood);
  font-size: clamp(0.75rem, 0.69rem + 0.12vw, 0.875rem);
  font-weight: 700;
  letter-spacing: 0.24em;
  line-height: 1.5;
  text-transform: uppercase;
}

.text {
  max-width: 30ch;
  margin: 0;
  font-size: clamp(1rem, 0.88rem + 0.3vw, 1.3125rem);
  line-height: 1.65;
  text-wrap: pretty;
}

.text a {
  color: var(--oxblood);
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

.text a:hover {
  text-decoration-thickness: 2px;
}

.text a:focus-visible {
  outline: 2px solid var(--oxblood);
  outline-offset: 0.2em;
  border-radius: 1px;
}

.address {
  grid-row: address;
  grid-column: text;
  font-size: clamp(0.8125rem, 0.76rem + 0.1vw, 0.9375rem);
  font-style: normal;
  letter-spacing: 0.02em;
  line-height: 1.75;
}

@media (min-width: 56em) {
  .page {
    --name: clamp(3.5rem, 7vw, 9.5rem);
    --open: inset(0 100% 0 0);
    grid-template-columns:
      [edge-start] var(--gutter)
      [left-start] minmax(0, 0.84fr)
      [left-end block-start] var(--pad)
      [text-start] minmax(0, 1fr)
      [text-end] var(--pad)
      [block-end] var(--gutter)
      [edge-end];
    grid-template-rows:
      [top] var(--gutter)
      minmax(1rem, 0.85fr)
      [mark-start] auto
      [mark-end] calc(var(--name) * 0.42)
      [block-top] calc(var(--name) * 0.24)
      [name-start name-a-start name-b-start] auto
      [name-end name-a-end name-b-end] calc(var(--name) * 0.55)
      [rule-start] 1px
      [rule-end] calc(var(--name) * 0.38)
      [message-start] auto
      [message-end] minmax(3rem, 1fr)
      [address-start] auto
      [address-end] var(--pad)
      [block-bottom] var(--gutter)
      [bottom];
  }

  /* Both words measure the same, so the edge of the block is the centre of
     the name. Half the mark's width (441 / 524 of its height) hangs past it. */
  .mark {
    --mark: calc(var(--name) * 0.95);
    grid-column: left;
    justify-self: end;
    margin-right: calc(var(--mark) * -0.4208);
  }

  .name-a {
    grid-column: left;
    justify-self: end;
    /* With the tracking after the last letter, this leaves a word space
       between CEKANI and DESIGN, split by the edge of the block. */
    margin-right: 0.11em;
  }

  .rule {
    width: 38%;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .block {
    animation: open 1.6s var(--ease) 0.1s both;
  }

  .mark {
    animation: rise 2s var(--ease) 0.2s both;
  }

  .name-a,
  .name-b {
    animation: arrive 1.4s var(--ease) both;
  }

  .name-a {
    animation-delay: 0.25s;
  }

  .name-b {
    animation-delay: 0.45s;
  }

  .rule {
    transform-origin: left;
    animation: draw 1.2s var(--ease) 0.9s both;
  }

  .message {
    animation: arrive 1.2s var(--ease) 1.05s both;
  }

  .address {
    animation: arrive 1.2s var(--ease) 1.2s both;
  }
}

@keyframes open {
  from {
    clip-path: var(--open);
  }
}

@keyframes rise {
  from {
    clip-path: inset(100% 0 0 0);
  }
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(0.35rem);
  }
}

@keyframes draw {
  from {
    transform: scaleX(0);
  }
}
