/* Ozhibko portfolio — built from the Figma "Design Handoff" page.
   Sizes are tokens; breakpoints only change tokens (same approach as women-led). */

/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --paper: #fcfcfc;
  --ink: #000;
  --tile: #e6e6e6;
  --tile-hover: #dadada;
  --field: #808080;
  --field-active: #747474; /* darker on hover/focus, same step as --tile-hover */
  --muted: 0.64;

  /* Type scale */
  --fs-display: 96px;  --lh-display: 96px;
  --fs-h2: 48px;       --lh-h2: 64px;
  --fs-xl: 32px;       --lh-xl: 48px;
  --fs-lg: 24px;       --lh-lg: 32px;
  --fs-md: 20px;       --lh-md: 28px;
  --fs-sm: 16px;       --lh-sm: 24px;

  /* Spacing */
  --pad: 16px;
  --gap: 16px;
  --gap-xl: 128px;          /* big gaps between columns / blocks */
  --section-top: 128px;
  --single-inset: 256px;    /* single centred project on Home */
  --tile-gap: 32px;

  /* Icons */
  --arrow-w: 64px;
  --arrow-h: 64.925px;

  --transition: 200ms ease;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 14;
  font-weight: 400;
  font-size: var(--fs-lg);
  line-height: var(--lh-lg);
  overflow-wrap: break-word;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, ul, figure { margin: 0; padding: 0; font-weight: inherit; font-size: inherit; line-height: inherit; }
ul { list-style: none; }

.muted { opacity: var(--muted); }
.t-16 { font-size: var(--fs-sm); line-height: var(--lh-sm); }
.t-20 { font-size: var(--fs-md); line-height: var(--lh-md); }
.t-32 { font-size: var(--fs-xl); line-height: var(--lh-xl); }
.t-48 { font-size: var(--fs-h2); line-height: var(--lh-h2); }

:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* Links: underline grows in on hover */
.link,
.project__name {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .3s ease;
}
.link:hover, .link:focus-visible,
.project:hover .project__name,
.project:focus-visible .project__name { background-size: 100% 1px; }

/* ==========================================================================
   Layout primitives
   ========================================================================== */
.section { padding: var(--section-top) var(--pad) var(--pad); }
.section--inset { padding-left: var(--single-inset); padding-right: var(--single-inset); }
.row { display: flex; gap: var(--gap); align-items: flex-start; }
.row--xl { gap: var(--gap-xl); }
.row > * { flex: 1 1 0; min-width: 0; }
.row:has(> .tile) { align-items: stretch; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.stack-xl { display: flex; flex-direction: column; gap: var(--gap-xl); }
.half-right { display: flex; gap: var(--gap); }
.half-right > * { flex: 1 1 0; min-width: 0; }
.center { display: flex; justify-content: center; padding: var(--pad); }

/* ==========================================================================
   Header (fixed)
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: flex-start; gap: var(--gap);
  height: 64px;
  padding: var(--pad);
  background: var(--paper);
  white-space: nowrap;
}
.theme-dark .site-header { background: var(--ink); }
.site-header nav a[aria-current="page"] { opacity: var(--muted); }
/* Logo: same grey as the current page on hover, no underline */
.site-header .logo { transition: opacity var(--transition); }
.site-header .logo:hover, .site-header .logo:focus-visible { opacity: var(--muted); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding: var(--pad); }
.hero h1 { font-size: var(--fs-display); line-height: var(--lh-display); letter-spacing: -0.01em; }

/* ==========================================================================
   Project cards
   ========================================================================== */
.project { display: flex; flex-direction: column; gap: var(--gap); }
.project__media { position: relative; overflow: hidden; background: var(--tile); }
.project__media img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .8s cubic-bezier(.2,.7,.2,1);
}
.project:hover .project__media img { transform: scale(1.03); }
.ar-portrait { aspect-ratio: 480 / 640; }
.ar-landscape { aspect-ratio: 640 / 480; }
.project__meta { font-size: var(--fs-md); line-height: var(--lh-md); }

/* Divider heading */
.rule-title { display: flex; flex-direction: column; gap: var(--gap); }
.rule-title::before { content: ""; height: 1px; background: currentColor; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 64px; padding: var(--pad);
  background: var(--ink); color: var(--paper);
  border: 1px solid var(--ink);
  font: inherit; cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.btn:hover, .btn:focus-visible { background: var(--paper); color: var(--ink); }
.btn--ghost { background: transparent; color: var(--paper); border-color: #fff; }
.btn--ghost:hover, .btn--ghost:focus-visible { background: var(--paper); color: var(--ink); }

/* ==========================================================================
   Recognition logos
   ========================================================================== */
.logos { display: flex; }
.logos > * { flex: 1 1 0; display: flex; justify-content: center; align-items: center; padding: 0 64px; }
.logos img { height: 32px; width: auto; }

/* ==========================================================================
   Grey tiles (CTA, values, next project) — keep the 640×480 image ratio
   ========================================================================== */
.tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--tile-gap);
  aspect-ratio: 640 / 480;
  padding: var(--pad);
  background: var(--tile);
  transition: background var(--transition);
}
a.tile:hover, a.tile:focus-visible { background: var(--tile-hover); }
.tile__head { display: flex; gap: var(--gap); align-items: flex-start; font-size: var(--fs-h2); line-height: var(--lh-h2); }
.tile__arrow { width: var(--arrow-w); height: var(--arrow-h); flex: none; transition: transform .3s ease; }
a.tile:hover .tile__arrow { transform: translateX(16px); }
.tags { display: flex; flex-wrap: wrap; gap: var(--gap); }
.tag { background: var(--paper); padding: 4px 8px; font-size: var(--fs-sm); line-height: var(--lh-sm); }
.tag span { opacity: var(--muted); }

/* ==========================================================================
   Work: project index grid
   ========================================================================== */
.index-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); justify-items: start; }

/* ==========================================================================
   About
   ========================================================================== */
.service { display: flex; gap: var(--gap-xl); align-items: flex-start; }
.service > * { flex: 1 1 0; min-width: 0; }
.portrait-row { padding: var(--section-top) var(--pad) var(--pad); gap: var(--gap-xl); }

/* Auto-scrolling carousel */
.carousel { --per-view: 4; overflow: hidden; margin: 0 calc(var(--pad) * -1); }
.carousel__track { display: flex; width: max-content; animation: carousel-scroll 40s linear infinite; }
.carousel__group { display: flex; align-items: flex-start; gap: var(--gap); padding-right: var(--gap); }
.carousel__item { flex: none; width: calc((100vw - 2 * var(--pad) - (var(--per-view) - 1) * var(--gap)) / var(--per-view)); }
.carousel__group > .carousel__item:first-child { margin-left: var(--pad); }
.carousel__group + .carousel__group > .carousel__item:first-child { margin-left: 0; }
@keyframes carousel-scroll { to { transform: translateX(-50%); } }

/* ==========================================================================
   Case study
   ========================================================================== */
.case-images { display: flex; flex-direction: column; }
.case-images img { width: 100%; height: auto; }

/* ==========================================================================
   Contact
   ========================================================================== */
body.theme-dark { background: var(--ink); color: var(--paper); }
.contact-form { display: flex; flex-direction: column; gap: 32px; align-items: flex-start; }
.field { display: flex; flex-direction: column; gap: 16px; width: 100%; }
.field label { font-size: var(--fs-sm); line-height: var(--lh-sm); }
.field input,
.field textarea {
  width: 100%;
  background: var(--field);
  color: var(--paper);
  border: 0; border-radius: 0;
  padding: var(--pad);
  font: inherit;
  outline: none;
  transition: background var(--transition);
}
.field input { height: 64px; }
.field textarea { height: 192px; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: var(--paper); opacity: var(--muted); }
.field input:hover, .field textarea:hover,
.field input:focus, .field textarea:focus,
.field input:not(:placeholder-shown), .field textarea:not(:placeholder-shown) { background: var(--field-active); }
.form-status { font-size: var(--fs-lg); line-height: var(--lh-lg); }
.form-status:empty { display: none; }

/* ==========================================================================
   Footer — keeps the Figma sizes at every breakpoint
   ========================================================================== */
.site-footer {
  --fs-xl: 32px;  --lh-xl: 48px;
  --fs-lg: 24px;  --lh-lg: 32px;
  --fs-sm: 16px;  --lh-sm: 24px;

  display: flex; flex-direction: column; gap: 128px;
  padding: var(--pad);
  background: var(--ink); color: var(--paper);
  font-size: var(--fs-lg); line-height: var(--lh-lg);
}
/* Figma 393:5100 — cities scroll constantly, like the About carousel */
/* Cities keep their natural width, separated by a 48px "•" */
/* margin on the track (not the first item) keeps both groups the same width, so the loop is seamless */
.site-footer .clocks .carousel__track { animation-duration: 32s; margin-left: var(--pad); }
.site-footer .clocks .carousel__group { align-items: center; }
.clock, .clock__dot { flex: none; font-size: var(--fs-xl); line-height: var(--lh-xl); white-space: nowrap; }
.clock__dot { width: 48px; text-align: center; }
.clock__time { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Responsive — desktop 1440 → small desktop 1280 → tablet 1024/768 → mobile 375
   ========================================================================== */
@media (max-width: 1280px) {
  :root {
    --fs-display: 80px;  --lh-display: 80px;
    --gap-xl: 64px;
    --single-inset: max(16px, 17.78vw); /* 256px of 1440 */
  }
}

@media (max-width: 1024px) {
  .site-footer { gap: 96px; } /* footer block spacing: 128 desktop / 96 tablet / 64 mobile */
  :root {
    --fs-display: 64px;  --lh-display: 64px;
    --fs-h2: 32px;       --lh-h2: 48px;
    --fs-xl: 24px;       --lh-xl: 32px;
    --section-top: 96px;
    --gap-xl: 32px;
    --single-inset: 128px;
    --arrow-w: 48px;
    --arrow-h: 48px;
  }

  .logos > * { padding: 0 var(--pad); }
  .carousel { --per-view: 3; }

  /* Contact: portrait column uses the full left half */
  .contact-row .half-right > .spacer { display: none; }

}

@media (max-width: 767px) {
  :root {
    --fs-display: 40px;  --lh-display: 40px;
    --fs-h2: 24px;       --lh-h2: 32px;
    --fs-lg: 20px;       --lh-lg: 28px;
    --fs-xl: 24px;       --lh-xl: 32px;
    --section-top: 64px;
    --gap-xl: 64px;
    --single-inset: var(--pad);
    --arrow-w: 32px;
    --arrow-h: 32px;
  }

  .site-header { font-size: var(--fs-sm); line-height: var(--lh-sm); height: auto; }

  .row, .half-right, .service {
    flex-direction: column;
    align-items: stretch;
  }
  .row > *, .half-right > *, .service > * { flex: none; width: 100%; }
  .half-right > .spacer { display: none; }
  .service { gap: var(--gap); }
  .portrait-row { padding: 0; }

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

  .logos { flex-direction: column; align-items: center; gap: 32px; }
  .logos > * { padding: 0; }

  .carousel { --per-view: 1.5; }

  /* Footer: stack columns */
  /* Figma 393:5445: 64px between blocks, 16px inside them */
  .site-footer { gap: 64px; }
  .site-footer .row, .site-footer .footer-bottom { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .carousel { overflow-x: auto; }
  .carousel__track { animation: none; }
  .project:hover .project__media img { transform: none; }
}

/* ==========================================================================
   Case study: back link
   ========================================================================== */
.back { display: flex; padding: var(--section-top) var(--pad) var(--pad); } /* Figma 390:4320: under the headline, 128px above */
.back__link { display: inline-flex; align-items: center; gap: 8px; }
.back__arrow { width: 32px; height: 32px; flex: none; }
.back__link:hover .link, .back__link:focus-visible .link { background-size: 100% 1px; }
@media (max-width: 767px) { .back__arrow { width: 24px; height: 24px; } }

/* ==========================================================================
   Custom cursor (Figma 390:4478) — Tinge-style follower
   A 20px dot always trails the mouse; over a project image it scales ×3.2
   to the 64px frosted circle (50% white + blur). Driven by js/main.js.
   ========================================================================== */
.glass-cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .glass-cursor {
    display: block;
    position: fixed; left: 0; top: 0; z-index: 999;
    width: 0; height: 0;
    pointer-events: none;
  }
  .glass-cursor__dot {
    width: 20px; height: 20px;
    margin: -10px 0 0 -10px;           /* centre on the pointer */
    border-radius: 50%;
    background: rgba(255, 255, 255, 0);
    transition: transform .25s linear, background .25s linear;
  }
  .glass-cursor.is-active .glass-cursor__dot {
    transform: scale(3.2);              /* 20px → 64px */
    background: rgba(255, 255, 255, .5);
    -webkit-backdrop-filter: blur(2.5px); /* ≈ 8px once scaled */
    backdrop-filter: blur(2.5px);
  }
}
a.project .project__media { cursor: pointer; } /* hand stays visible on top of the circle */

/* ==========================================================================
   Page animations (modelled on thisistinge.com)
   - Hero headline: words come into focus from a 16px blur + fade, 1.4s, 75ms stagger
   - Header: slides down 30px + fades in after the headline starts
   - Content: slides up 30px (cards 50px) + fades in when scrolled into view
   Only active when JS is running and the visitor allows motion.
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  /* Hero */
  .js .hero h1 { opacity: 0; }
  .js .hero h1.is-split { opacity: 1; }
  .js .hero h1 .word {
    display: inline-block;
    opacity: 0;
    filter: blur(16px);
    transition: filter 1.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 1.4s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .js .hero h1.is-animated .word { opacity: 1; filter: blur(0); }

  /* Header */
  .js .site-header:not(.is-animated) { opacity: 0; transform: translateY(-30px); }
  .js .site-header.is-animated { transition: transform 600ms ease-out, opacity 600ms ease-out, background var(--transition); }

  /* Scroll reveals */
  .js :where(.reveal, .reveal-card):not(.is-animated) { opacity: 0; transform: translateY(30px); }
  .js .reveal-card:not(.is-animated) { transform: translateY(50px); }
  .js .reveal.is-animated {
    transition: transform 500ms ease-out, opacity 250ms ease-out,
                background var(--transition), color var(--transition);
  }
  .js .reveal-card.is-animated {
    transition: transform 500ms ease-out, opacity 150ms ease-out,
                background var(--transition), color var(--transition);
  }
}

/* ==========================================================================
   Legal pages (Cookie Policy, Privacy Policy, Terms of Use) — Figma 391:4669
   Body text 24/32 full width, like the "Text" block in the design.
   ========================================================================== */
.legal { display: flex; flex-direction: column; gap: var(--lh-lg); }
.legal__h { font-size: var(--fs-xl); line-height: var(--lh-xl); margin-top: 64px; }
.legal__h:first-child { margin-top: 0; }
.legal__list { display: flex; flex-direction: column; gap: var(--gap); padding-left: 1.2em; list-style: "–  "; }
.legal strong { font-weight: 500; }
@media (max-width: 767px) { .legal__h { margin-top: 32px; } }

/* Contact form: hidden spam trap + disabled button while sending */
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.btn:disabled { opacity: var(--muted); cursor: default; }

/* Overscroll: the area revealed past the bottom of the page (rubber-band
   scrolling) matches the black footer; near the top it stays the page colour.
   js/main.js toggles .page-bottom on <html>. */
html { background: var(--paper); }
html.page-bottom, html.theme-dark { background: var(--ink); }
