/* Styles for kostyafrolov.com.
   Values are copied from pressplaycollective.com so both sites look like one system.
   Change content freely; change these values only on purpose. */

:root {
  --bg: #000;
  --surface: #0d0d0d;
  --text: #fff;
  --text-strong: #e0e0e0;
  --text-soft: #bdbdbd;
  --text-muted: #8a8a8a;
  --text-dim: #6f6f6f;
  --text-faint: #666;
  --line: #333;
  --line-soft: #222;
  --line-strong: #444;
  --error: #ff6b6b;
  --font-sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --ease-out: cubic-bezier(0.2, 0.7, 0.1, 1);
}

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

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

html {
  scroll-behavior: smooth;
}

main {
  /* Side gutter grows from 16px on phones to 48px on desktop. */
  width: min(1200px, 100% - 2 * clamp(16px, 4vw, 48px));
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 64px;
  padding: 64px 0;
}

/* Wordmark */

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.brand p {
  margin: 0;
}

.brand-name {
  font-weight: 500;
  font-stretch: 112%;
  font-size: clamp(26px, 7.6vw, 132px);
  line-height: 1;
  letter-spacing: -0.035em;
  white-space: nowrap;
  text-rendering: geometricPrecision;
}

.brand-sub span {
  white-space: nowrap;
}

.brand-sub {
  font-weight: 600;
  font-size: clamp(11px, 1.4vw, 18px);
  letter-spacing: 0.6em;
  margin-right: -0.6em;
  text-transform: uppercase;
  color: var(--text-strong);
  opacity: 0.8;
}

/* Hero */

.hero {
  display: grid;
  justify-items: center;
  gap: 48px;
  text-align: center;
  padding: 24px 0 16px;
}

.hero-text {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-photo {
  position: relative;
  width: min(360px, 100%);
  aspect-ratio: 4 / 5;
  margin: 0;
  overflow: hidden;
}

/* Soft layer over the portrait: a little darker, barely any blur.
   Tune: rgba alpha = darkness, blur = softness. Contrast lives on the img (inside the edge fade). */
.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: blur(0.25px);
  backdrop-filter: blur(0.25px);
  pointer-events: none;
}

.hero-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  /* Flatter, less harsh contrast. Lower = flatter. */
  filter: contrast(0.86);
  /* Fade the crop edges (all four sides) into the black page. */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 15%, #000 85%, transparent), linear-gradient(to bottom, transparent, #000 10%, #000 65%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 15%, #000 85%, transparent), linear-gradient(to bottom, transparent, #000 10%, #000 65%, transparent);
  mask-composite: intersect;
}

.hero h1 {
  margin: 0;
  font-size: clamp(48px, 7.5vw, 112px);
  font-weight: 500;
  font-stretch: 112%;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.hero h1 .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
}

.hero h1 .line > span {
  display: inline-block;
  animation: rise 0.9s var(--ease-out) both;
}

.hero h1 .line:nth-child(2) > span {
  animation-delay: 0.08s;
}

.hero h1 .line:nth-child(3) > span {
  animation-delay: 0.16s;
}

.hero h1 .line:nth-child(4) > span {
  animation-delay: 0.24s;
}

.hero h1 em,
.cta h2 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-stretch: normal;
  letter-spacing: -0.01em;
}

.hero h1 em {
  font-size: 1.18em;
}

.hero h1 .muted {
  color: var(--text-dim);
}

@keyframes rise {
  from {
    transform: translateY(105%);
  }
  to {
    transform: translateY(0);
  }
}

.hero-lead {
  width: min(560px, 100%);
  margin: 32px 0 0;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.6;
}

.hero-lead + .btn {
  margin-top: 32px;
}

.hero-contact {
  margin: 20px 0 0;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
}

.hero-contact a {
  color: var(--text-soft);
  text-underline-offset: 3px;
}

.hero-contact a:hover,
.hero-contact a:focus-visible {
  color: var(--text);
}

/* Buttons */

.btn {
  display: inline-block;
  margin-top: 40px;
  padding: 12px 32px;
  background: transparent;
  border: 1px solid var(--text);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn:hover,
.btn:focus-visible {
  background: var(--text);
  color: var(--bg);
}

/* Section labels */

.section-label {
  margin: 0 0 32px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Filter chips */

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 0 32px;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.chip {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.chip:hover,
.chip:focus-visible,
.chip[aria-pressed="true"] {
  border-color: var(--text);
  color: var(--text);
}

/* Work grid & cards */

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 48px 32px;
}

.work-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

/* Cards without footage yet stay in the file but never show. */
.case[data-draft] {
  display: none !important;
}

.case[hidden],
.work-empty[hidden] {
  display: none;
}

.case-video,
.case-frame,
.case-still {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: var(--surface);
}

.case-video {
  position: relative;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}

.case-video img,
.case-still img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  filter: grayscale(1); /* all covers in black, white and grey, like the rest of the site */
  transition: opacity 0.3s, transform 0.6s var(--ease-out);
}

.case-video::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent var(--text);
  transform: translate(-40%, -50%);
  opacity: 0.9;
}

.case-video:hover img,
.case-video:focus-visible img {
  opacity: 1;
  transform: scale(1.02);
}

.case-video:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 4px;
}

/* Cards without a video: a still, or (.is-missing) an empty frame with a label. */
.case-still {
  position: relative;
  overflow: hidden;
}

.case-still.is-missing::after {
  content: "Still — TODO";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-faint);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case h3 {
  margin: 20px 0 6px;
  font-size: 20px;
  font-weight: 500;
  font-stretch: 112%;
  letter-spacing: -0.02em;
}

.case h3 span {
  margin-left: 8px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 400;
  font-stretch: 100%;
  letter-spacing: 0;
}

.case p {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.5;
}

.case p a {
  color: inherit;
  text-underline-offset: 3px;
}

.case p a:hover,
.case p a:focus-visible {
  color: var(--text);
}

.case-link {
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.2s;
}

.case-link:hover,
.case-link:focus-visible {
  border-bottom-color: var(--text);
}

/* Visible placeholder for anything not confirmed yet. */
.todo {
  color: var(--text-faint);
}

/* Numbers */

.numbers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 32px;
}

.numbers .section-label {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.number strong {
  display: block;
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 500;
  font-stretch: 112%;
  line-height: 1;
  letter-spacing: -0.035em;
}

.number span {
  display: block;
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* About */

.about {
  width: min(680px, 100%);
  color: var(--text-soft);
  font-size: 18px;
  line-height: 1.6;
}

.about p {
  margin: 0 0 16px;
}

.roles {
  margin-top: 32px;
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: 0.12em;
  line-height: 1.6;
  text-transform: uppercase;
}

/* How I work */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.steps h3 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 500;
  font-stretch: 112%;
  letter-spacing: -0.02em;
}

.steps h3 span {
  display: block;
  margin-bottom: 8px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 400;
  font-stretch: 100%;
  letter-spacing: 0.12em;
}

.steps p {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.5;
}

/* Experience: dates on the left, role and result on the right */

.jobs {
  margin: 0;
  padding: 0;
  list-style: none;
}

.jobs li {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 32px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.job-dates {
  margin: 4px 0 0;
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.jobs h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 500;
  font-stretch: 112%;
  letter-spacing: -0.02em;
}

.jobs h3 span {
  display: block;
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 400;
  font-stretch: 100%;
  letter-spacing: 0;
}

.jobs p {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.5;
}

.jobs p a {
  color: inherit;
  text-underline-offset: 3px;
}

/* Skills: label + list, hairline rows */

.skill-list {
  margin: 0;
}

.skill-list div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 32px;
  padding: 16px 0;
  border-top: 1px solid var(--line-soft);
}

.skill-list dt {
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: 0.12em;
  line-height: 1.6;
  text-transform: uppercase;
}

.skill-list dd {
  margin: 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.6;
}

/* Clients */

.clients {
  width: min(880px, 100%);
}

.clients p {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.8;
}

/* Services: hairline-topped columns, built from the card and chip patterns. */

.service-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 48px 32px;
}

.service {
  display: flex;
  flex-direction: column;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.service h3 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 500;
  font-stretch: 112%;
  letter-spacing: -0.02em;
}

.service h3 span {
  display: block;
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 400;
  font-stretch: 100%;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.service p {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.5;
}

.service .service-proof {
  color: var(--text-soft);
  font-size: 14px;
}

.service-link {
  margin-top: auto;
  align-self: flex-start;
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
  transition: border-color 0.2s;
}

.service-link:hover,
.service-link:focus-visible {
  border-bottom-color: var(--text);
}

/* Contact */

.cta {
  width: min(480px, 100%);
  margin: 0 auto -32px;
}

.cta h2 {
  margin: 0 0 12px;
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 500;
  font-stretch: 112%;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.cta h2 em {
  font-size: 1.12em;
  white-space: nowrap;
}

.cta p + p {
  margin-top: 12px;
}

.cta p a {
  color: var(--text);
  text-underline-offset: 3px;
}

.cta p {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.5;
}

.contact {
  width: min(480px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact input,
.contact textarea {
  width: 100%;
  padding: 8px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  resize: vertical;
  transition: border-color 0.2s;
}

.contact input::placeholder,
.contact textarea::placeholder {
  color: var(--text-faint);
}

.contact input:focus,
.contact textarea:focus {
  outline: none;
  border-bottom-color: var(--text);
}

.contact .btn {
  align-self: flex-start;
  margin-top: 0;
  padding: 10px 28px;
}

.form-status {
  margin: -8px 0 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.5;
}

.form-status:empty {
  display: none;
}

.form-status.is-error {
  color: var(--error);
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Footer */

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding-top: 32px;
  border-top: 1px solid var(--line-soft);
  color: var(--text-faint);
  font-size: 13px;
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer a:hover,
.footer a:focus-visible {
  color: var(--text);
}

.footer nav {
  display: flex;
  gap: 20px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 480px) {
  /* On phones the sub line splits into two centered rows instead of wrapping mid-phrase. */
  .brand-sub span {
    display: block;
  }

  .brand-sub .sep {
    display: none;
  }
}

@media (max-width: 768px) {
  .work-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

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

  .service-list,
  .steps {
    grid-template-columns: 1fr;
  }

  .jobs li,
  .skill-list div {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

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

  .hero h1 .line > span {
    animation: none;
  }
}

/* Desktop: two columns, text left, portrait right, with air between them. */
@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(40px, 6vw, 96px);
    text-align: left;
  }

  .hero-text {
    align-items: flex-start;
  }

  .hero h1 {
    /* Smaller than the centered hero so "that turn views" fits the column. */
    font-size: clamp(48px, 5.4vw, 80px);
  }

  .hero-lead {
    width: 100%;
    max-width: 520px;
  }

  .hero-photo {
    width: 100%;
    max-width: 460px;
    justify-self: end;
  }

  .hero-photo img {
    /* All four edges dissolve into the black page. */
    -webkit-mask-image: linear-gradient(to right, transparent, #000 18%, #000 88%, transparent), linear-gradient(to bottom, transparent, #000 10%, #000 72%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 18%, #000 88%, transparent), linear-gradient(to bottom, transparent, #000 10%, #000 72%, transparent);
  }
}

/* Case study pages (work/*.html) */

.case-page {
  justify-content: flex-start;
  gap: 56px;
}

.case-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.case-home {
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  font-stretch: 112%;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-transform: uppercase;
}

.case-back {
  color: var(--text-soft);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}

.case-back:hover,
.case-back:focus-visible,
.case-home:hover,
.case-home:focus-visible {
  color: var(--text);
}

.case-hero .section-label {
  margin-bottom: 20px;
}

.case-hero h1 {
  margin: 0;
  font-size: clamp(44px, 7vw, 104px);
  font-weight: 500;
  font-stretch: 112%;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.case-hero h1 em {
  font-family: var(--font-serif);
  font-size: 1.12em;
  font-style: italic;
  font-weight: 400;
  font-stretch: normal;
  letter-spacing: -0.01em;
}

.case-intro {
  width: min(680px, 100%);
  margin: 24px 0 0;
  color: var(--text-soft);
  font-size: 18px;
  line-height: 1.6;
}

.case-video-lg {
  width: 100%;
}

.case-facts {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.case-facts dt {
  margin-bottom: 8px;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.case-facts dd {
  margin: 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.5;
}

.case-story {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.case-block {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.case-block .section-label {
  margin-bottom: 16px;
}

.case-block p {
  margin: 0;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.65;
}

.case-numbers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.gallery figure {
  margin: 0;
  overflow: hidden;
  background: var(--surface);
}

.gallery .wide {
  grid-column: 1 / -1;
}

.gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
}

.case-credit {
  margin: 12px 0 0;
  color: var(--text-faint);
  font-size: 12px;
}

.case-next .btn {
  margin-top: 0;
}

@media (max-width: 768px) {
  .case-facts {
    grid-template-columns: repeat(2, 1fr);
  }

  .case-story,
  .gallery {
    grid-template-columns: 1fr;
  }

  .case-numbers {
    grid-template-columns: repeat(2, 1fr);
  }
}

.case-more .work-grid {
  margin-top: 0;
}

.case-links,
.case-sources {
  margin: 24px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}

.case-sources {
  margin: 0;
  color: var(--text-faint);
  font-size: 12px;
}

.case-links a,
.case-sources a {
  color: inherit;
  text-underline-offset: 3px;
}

.case-links a:hover,
.case-sources a:hover {
  color: var(--text);
}

.case-next-link {
  color: var(--text);
  font-size: clamp(24px, 3.2vw, 40px);
  font-weight: 500;
  font-stretch: 112%;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-decoration: none;
}

.case-next-link:hover,
.case-next-link:focus-visible {
  color: var(--text-soft);
}
