/* Caine&Co holding page. One screen: the wordmark, what the company is, and how to get in touch. */

@font-face {
  font-family: "Anton";
  src: url("Anton-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #000;
  --white: #fff;
  --soft: #b9b6b0;
  --paper: #f1ede6;
  --line: #2a2a2a;
  --rec: #ff3b30;
  --pad: clamp(1.25rem, 4vw, 3rem);
  /* Wordmark width: limited by screen height too, so the page fits one screen. */
  --mark: min(84vw, 860px, 72vh);
  --display: "Anton", "Arial Narrow", Impact, sans-serif;
  --text: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--white);
  font-family: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
}

/* A soft spotlight behind the title, like a card on a stage. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(120% 78% at 50% 36%, #1d1d20 0, #0a0a0b 46%, #000 70%);
}

html { scroll-behavior: smooth; }

/* The first screen: everything a visitor needs without scrolling. */
.screen {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
}

p, h1, h2 { margin: 0; }

a { color: inherit; }

a:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 4px;
}

/* Viewfinder corner marks */
.frame i {
  position: fixed;
  z-index: 2;
  width: 22px;
  height: 22px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, .5);
  mix-blend-mode: difference;
}
.frame i:nth-child(1) { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.frame i:nth-child(2) { top: 12px; right: 12px; border-left: 0; border-bottom: 0; }
.frame i:nth-child(3) { bottom: 12px; left: 12px; border-right: 0; border-top: 0; }
.frame i:nth-child(4) { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }

/* Top line */
.bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.4rem, 4.5vh, 3.25rem) var(--pad) 0;
  color: var(--soft);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.status { display: flex; align-items: center; gap: .6rem; color: var(--white); }

.place a { color: var(--white); text-decoration: none; }
.place a:hover { color: var(--rec); }

.rec {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--rec);
  animation: pulse 1.6s ease-in-out infinite;
}

/* Centre stage */
.stage {
  display: grid;
  align-content: center;
  justify-items: center;
  padding: clamp(.75rem, 3vh, 4.5rem) var(--pad);
  text-align: center;
}

/* The wordmark: one flat colour, never stretched. The file carries 4% clear space;
   the margin below adds the other 8% of its width that the logo kit asks for. */
.mark {
  display: block;
  width: var(--mark);
  height: auto;
  fill: var(--white);
  margin-bottom: calc(var(--mark) * .08);
}

/* Everything is visible by default; the animations only describe where each
   piece starts, so the page still reads if they never run. */
.mark .l {
  transform-box: fill-box;
  animation: rise .8s cubic-bezier(.2, .8, .2, 1) backwards;
}
.mark .l:nth-child(1) { animation-delay: .15s; }
.mark .l:nth-child(2) { animation-delay: .24s; }
.mark .l:nth-child(3) { animation-delay: .33s; }
.mark .l:nth-child(4) { animation-delay: .42s; }
.mark .l:nth-child(5) { animation-delay: .51s; }
.mark .l:nth-child(6) { animation-delay: .60s; }
.mark .l:nth-child(7) { animation-delay: .69s; }
.mark .l:nth-child(8) { animation-delay: .78s; }

h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.15rem, min(6.2vw, 5.4vh), 2.9rem);
  line-height: 1.05;
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* The home headline sits in two even lines. */
h1 span { display: block; }

.lead {
  max-width: 54ch;
  margin-top: clamp(.9rem, 2vw, 1.4rem);
  color: var(--soft);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem 1.6rem;
  margin-top: clamp(1.1rem, 3.5vh, 2.4rem);
}

h1, .lead, .actions {
  animation: fade .9s ease backwards;
}
h1 { animation-delay: 1s; }
.lead { animation-delay: 1.15s; }
.actions { animation-delay: 1.3s; }

.btn {
  display: inline-block;
  padding: .85rem 1.7rem .8rem;
  background: var(--white);
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.1rem;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color .2s ease, color .2s ease;
}
.btn:hover { background: var(--rec); color: var(--ink); }

.mail {
  font-size: 1.02rem;
  text-decoration-thickness: 1px;
  text-underline-offset: .3em;
}
.mail:hover { color: var(--rec); }

/* The mediums, running past like a credit roll turned on its side */
.reel {
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding-block: clamp(.35rem, 1.2vh, 1rem);
}

.track {
  display: flex;
  width: max-content;
  animation: slide 152s linear infinite;
}

.track span {
  display: flex;
  align-items: center;
  font-family: var(--display);
  font-size: clamp(2.2rem, min(7vw, 8vh), 5.4rem);
  line-height: 1.1;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, .6);
}
.track .fill { color: var(--white); -webkit-text-stroke: 0; }

.track span::after {
  content: "";
  width: .2em;
  height: .2em;
  margin-inline: .5em;
  border-radius: 50%;
  background: var(--rec);
}

/* A level meter along the bottom */
.wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: clamp(22px, 4.5vh, 52px);
  padding-inline: var(--pad);
  margin-top: clamp(.6rem, 1.6vh, 1.4rem);
}

.wave b {
  flex: 1;
  height: 100%;
  background: var(--white);
  opacity: .26;
  transform-origin: bottom;
  animation: level 1.6s ease-in-out infinite alternate;
}
.wave b:nth-child(3n) { animation-duration: 1.1s; }
.wave b:nth-child(4n+1) { animation-delay: -.5s; }
.wave b:nth-child(5n+2) { animation-duration: 2.1s; animation-delay: -1.1s; }
.wave b:nth-child(7n+3) { animation-delay: -.8s; opacity: .5; }

.cue, .foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--soft);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.cue { padding: clamp(.6rem, 1.6vh, 1rem) var(--pad) clamp(1.4rem, 4.5vh, 3.25rem); }

.cue a { color: var(--white); text-decoration: none; }
.cue a:hover { color: var(--rec); }
.cue a::after {
  content: "\2193";
  display: inline-block;
  margin-left: .6em;
  animation: nudge 1.6s ease-in-out infinite;
}

.foot { padding: 1.6rem var(--pad) 2.2rem; }

/* Current projects */
.work {
  background: var(--paper);
  color: var(--ink);
  padding: clamp(3rem, 9vw, 7rem) var(--pad);
}

.work-inner { max-width: 1100px; margin-inline: auto; }

.kicker {
  color: #5c5a55;
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.work h2 {
  margin-top: .5rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.2rem, 7vw, 5rem);
  line-height: 1;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.intro {
  max-width: 52ch;
  margin-top: 1rem;
  color: #3d3b37;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
}

.group {
  margin: clamp(2rem, 5vw, 3.5rem) 0 0;
  color: #5c5a55;
  font-family: var(--text);
  font-size: .72rem;
  font-weight: 400;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.projects {
  list-style: none;
  margin: .7rem 0 0;
  padding: 0;
  border-top: 2px solid var(--ink);
}

.projects li { border-bottom: 1px solid #c9c4ba; }

.row {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1.1fr) minmax(0, 1.7fr) auto;
  align-items: center;
  gap: .4rem 1.5rem;
  padding: clamp(1rem, 2.4vw, 1.6rem) .5rem;
  color: inherit;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
}

.num { color: #6b6862; font-size: .8rem; letter-spacing: .12em; }

.name {
  font-family: var(--display);
  font-size: clamp(1.7rem, 4.4vw, 3rem);
  line-height: 1;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.desc { color: #3d3b37; }

.tag {
  justify-self: end;
  padding: .4rem .65rem .32rem;
  border: 1px solid currentColor;
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
}

a.row .tag::after { content: "\2197"; margin-left: .5em; }
a.row:hover, a.row:focus-visible { background: var(--ink); color: var(--white); }
a.row:hover .num, a.row:hover .desc,
a.row:focus-visible .num, a.row:focus-visible .desc { color: #cfcbc3; }
a.row:focus-visible { outline-color: var(--rec); outline-offset: -2px; }

.soon .tag { background: var(--ink); border-color: var(--ink); color: var(--white); }
/* A linked row for a venture still in development keeps a visible tag when the row turns dark. */
a.row.soon:hover .tag, a.row.soon:focus-visible .tag { border-color: var(--white); }
.soon .tag::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: .6em;
  border-radius: 50%;
  background: var(--rec);
  animation: pulse 1.6s ease-in-out infinite;
}

.touch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
}

.touch-line {
  font-family: var(--display);
  font-size: clamp(1.6rem, 4.4vw, 3rem);
  line-height: 1;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.btn.dark { background: var(--ink); color: var(--white); }
.btn.dark:hover { background: var(--rec); color: var(--ink); }
.btn.dark:focus-visible { outline-color: var(--ink); }

/* Text pages (the privacy notice) */
.doc {
  max-width: 68ch;
  margin-inline: auto;
  padding: clamp(1.5rem, 5vh, 3.5rem) var(--pad) clamp(2.5rem, 8vh, 5rem);
}
.doc-mark { display: inline-block; margin-bottom: clamp(1.5rem, 5vh, 3rem); }
.doc-mark img { display: block; width: min(64vw, 260px); height: auto; }
.doc h1 { animation: none; }
.doc h2 {
  margin: 2.2rem 0 .6rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.35rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.doc p, .doc li { color: #cfccc6; font-size: 1.02rem; }
.doc p + p { margin-top: .9rem; }
.doc a { text-underline-offset: .25em; }
.doc a:hover { color: var(--rec); }
.doc .doc-date {
  margin-top: .8rem;
  color: var(--soft);
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.foot a { text-decoration: none; }
.foot a:hover { color: var(--white); }
@keyframes rise { from { opacity: 0; transform: translateY(14%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pulse { 50% { opacity: .25; } }
@keyframes slide { to { transform: translateX(-50%); } }
@keyframes level { from { transform: scaleY(.1); } to { transform: scaleY(1); } }
@keyframes nudge { 50% { transform: translateY(.3em); } }

/* Wide screens: the tag column has one width, so every row's description starts at the same place. */
@media (min-width: 761px) {
  .row { grid-template-columns: 3rem minmax(0, 1.1fr) minmax(0, 1.7fr) 11rem; }
}

@media (max-width: 760px) {
  .row { grid-template-columns: 2.2rem minmax(0, 1fr) auto; }
  .num { grid-column: 1; grid-row: 1; }
  .name { grid-column: 2; grid-row: 1; }
  .tag { grid-column: 3; grid-row: 1; }
  .desc { grid-column: 2 / -1; grid-row: 2; }
  .desc:empty { display: none; }
}

/* Narrow phones: the tag drops under the description so a long name is never covered. */
@media (max-width: 480px) {
  .tag { grid-column: 2 / -1; grid-row: 3; justify-self: start; }
}

@media (max-width: 560px) {
  .bar, .foot, .cue { flex-direction: column; align-items: center; text-align: center; gap: .35rem; }
  .frame i { width: 14px; height: 14px; }
  .frame i:nth-child(1), .frame i:nth-child(2) { top: 8px; }
  .frame i:nth-child(3), .frame i:nth-child(4) { bottom: 8px; }
  .frame i:nth-child(1), .frame i:nth-child(3) { left: 8px; }
  .frame i:nth-child(2), .frame i:nth-child(4) { right: 8px; }
  .actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .mark .l, h1, .lead, .actions { animation: none; }
  html { scroll-behavior: auto; }
  .rec, .track, .wave b, .cue a::after, .soon .tag::before { animation: none; }
  .wave b { transform: scaleY(.35); }
  .wave b:nth-child(odd) { transform: scaleY(.7); }
  .wave b:nth-child(5n) { transform: scaleY(1); }
}
