/* ============================================
   Abrita — Portfolio 2019–2024
   Cabinet Grotesk (display) + Inter (body)
   ============================================ */

:root {
  --brand: #E44588;
  --ink: #2A2B2F;
  --cream: #F4F1EC;
  --tile: #EFEBE2;
  --dark: #232428;
  --pink-soft: #F7D9E4;
  --white: #FFFFFF;

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --gap: 16px;
  --pad: 16px;

  --font-display: "Cabinet Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

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

/* ============================================
   HOME — bento grid
   ============================================ */

.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(320px, 1fr);
  gap: var(--gap);
  padding: var(--pad);
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1920px;
  margin: 0 auto;
}

.tile {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--tile);
  opacity: 0;
  transform: translateY(24px);
  animation: tile-in 0.7s var(--ease-out) forwards;
}

.tile:nth-child(1) { animation-delay: 0.05s; }
.tile:nth-child(2) { animation-delay: 0.12s; }
.tile:nth-child(3) { animation-delay: 0.19s; }
.tile:nth-child(4) { animation-delay: 0.26s; }
.tile:nth-child(5) { animation-delay: 0.33s; }
.tile:nth-child(6) { animation-delay: 0.40s; }

@keyframes tile-in {
  to { opacity: 1; transform: translateY(0); }
}

a.tile {
  cursor: pointer;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

a.tile:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 44px rgba(42, 43, 47, 0.14);
}

.tile-label {
  position: absolute;
  left: 28px;
  bottom: 22px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 2.2vw, 34px);
  letter-spacing: 0.01em;
  color: var(--ink);
  z-index: 3;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}

.tile-label .label-arrow {
  font-size: 0.72em;
  display: inline-block;
  opacity: 0;
  transform: translate(-6px, 6px);
  transition: transform 0.3s var(--spring), opacity 0.25s ease;
  color: var(--brand);
}

a.tile:hover .label-arrow,
a.tile:focus-visible .label-arrow { opacity: 1; transform: translate(0, 0); }

/* --- Tile: hero (pink) --- */

.tile-hero {
  background: var(--brand);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.hero-marquee {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  z-index: 1;
}

.hero-marquee .marquee-track {
  display: flex;
  flex-shrink: 0;
  animation: marquee 14s linear infinite;
}

.hero-marquee span {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(120px, 14vw, 230px);
  line-height: 0.9;
  color: var(--white);
  white-space: nowrap;
  padding-right: 0.35em;
}

.hero-avatar {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: -42%;
  height: 118%;
  width: auto;
  max-width: none;
  transform: translateX(-50%);
  filter: drop-shadow(0 12px 28px rgba(42, 43, 47, 0.2));
  transition: transform 0.5s var(--spring);
}

.tile-hero:hover .hero-avatar { transform: translateX(-50%) translateY(-2.5%); }

/* --- Tile: work --- */

.work-stack {
  position: absolute;
  inset: 6% 8% 18% 8%;
  z-index: 1;
}

.work-stack img {
  position: absolute;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(42, 43, 47, 0.18);
  transition: transform 0.5s var(--spring);
}

.work-stack .w-back {
  top: 0;
  right: 0;
  width: 72%;
  transform: rotate(9deg);
}

.work-stack .w-front {
  bottom: 0;
  left: 0;
  width: 76%;
  transform: rotate(-8deg);
}

a.tile-work:hover .w-back { transform: rotate(12deg) translate(2%, -2%); }
a.tile-work:hover .w-front { transform: rotate(-11deg) translate(-2%, -2%); }

/* --- Tile: vibe coded (dark) --- */

.tile-vibe { background: var(--dark); }

.tile-vibe .tile-label { color: var(--white); }

.vibe-stack {
  position: absolute;
  inset: 6% 6% 20% 6%;
  z-index: 1;
}

.v-card {
  position: absolute;
  width: 58%;
  border-radius: var(--radius-sm);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.45);
  transition: transform 0.5s var(--spring);
}

.v-card.v-1 { top: 8%; left: 0; transform: rotate(-8deg); z-index: 1; }
.v-card.v-3 { top: 4%; right: 0; transform: rotate(8deg); z-index: 2; }
.v-card.v-2 { top: 26%; left: 21%; transform: rotate(-1deg); z-index: 3; }

a.tile-vibe:hover .v-card.v-1 { transform: rotate(-11deg) translate(-3%, -3%); }
a.tile-vibe:hover .v-card.v-3 { transform: rotate(11deg) translate(3%, -3%); }
a.tile-vibe:hover .v-card.v-2 { transform: rotate(-1deg) translateY(-4%); }

/* --- Tile: role (ticker) --- */

.tile-role {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 0;
}

.role-ticker {
  overflow: hidden;
  display: flex;
  margin-top: clamp(24px, 6vh, 64px);
}

.role-ticker .marquee-track {
  display: flex;
  flex-shrink: 0;
  align-items: baseline;
  animation: marquee 22s linear infinite;
}

.role-ticker span {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 2.6vw, 42px);
  white-space: nowrap;
  color: var(--ink);
}

.role-ticker .dot {
  color: var(--brand);
  padding: 0 0.5em;
}

.logo-band {
  overflow: hidden;
  display: flex;
  padding: 6px 0 2px;
}

.logo-band .marquee-track {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 20px;
  padding-right: 20px;
  animation: marquee 26s linear infinite reverse;
}

.chip {
  width: clamp(68px, 6.6vw, 96px);
  aspect-ratio: 1;
  flex-shrink: 0;
  background: var(--white);
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px rgba(42, 43, 47, 0.08);
  user-select: none;
}

.chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Tile: playground --- */

.tile-playground { background: var(--pink-soft); }

.playground-rows {
  position: absolute;
  inset: 8% 0 22% 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1;
}

.p-row {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.p-row .marquee-track {
  display: flex;
  flex-shrink: 0;
  gap: 12px;
  padding-right: 12px;
  animation: marquee 36s linear infinite;
}

.p-row-reverse .marquee-track { animation-direction: reverse; animation-duration: 42s; }

.p-row img {
  height: 100%;
  width: auto;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.tile-playground:hover .marquee-track { animation-play-state: paused; }

/* --- Tile: links --- */

.tile-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  padding: 28px;
}

.tile-links .big-link {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(26px, 2.4vw, 38px);
  letter-spacing: 0.04em;
  line-height: 1.45;
  position: relative;
  transition: color 0.25s ease;
}

.tile-links .big-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 2px;
  height: 3px;
  background: var(--brand);
  transition: right 0.35s var(--ease-out);
}

.tile-links .big-link:hover { color: var(--brand); }
.tile-links .big-link:hover::after { right: 0; }

.tile-links .corner-arrow {
  position: absolute;
  left: 28px;
  bottom: 22px;
  font-size: 30px;
  color: var(--brand);
  transition: transform 0.35s var(--spring);
}

.tile-links:hover .corner-arrow { transform: translate(-4px, -4px) scale(1.15); }

/* shared marquee keyframes */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* ============================================
   SUBPAGES — WORK / VIBE CODED
   ============================================ */

.page {
  max-width: 1560px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 56px);
}

.page-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: clamp(36px, 5vw, 72px);
}

.back-arrow {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(32px, 3.4vw, 52px);
  line-height: 1;
  color: var(--ink);
  transition: transform 0.3s var(--spring), color 0.25s ease;
}

.back-arrow:hover {
  color: var(--brand);
  transform: translate(-5px, -5px);
}

.page-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 3.6vw, 56px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3vw, 48px) clamp(20px, 2.4vw, 40px);
}

.project-grid.centered {
  min-height: 58vh;
  align-content: center;
}

.project-card {
  display: block;
  opacity: 0;
  transform: translateY(28px);
}

.project-card.revealed {
  animation: tile-in 0.7s var(--ease-out) forwards;
}

.project-card .card-media {
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 5 / 4;
  background: var(--white);
  box-shadow: 0 2px 10px rgba(42, 43, 47, 0.05);
  transition: box-shadow 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}

.project-card .card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s var(--ease-out);
}

.project-card:hover .card-media {
  box-shadow: 0 20px 44px rgba(42, 43, 47, 0.16);
  transform: translateY(-4px);
}

.project-card:hover .card-media img { transform: scale(1.045); }

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 1.6vw, 26px);
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.card-title .go {
  color: var(--brand);
  opacity: 0;
  transform: translate(-6px, 6px);
  transition: opacity 0.25s ease, transform 0.3s var(--spring);
  font-size: 0.85em;
}

.project-card:hover .card-title .go { opacity: 1; transform: translate(0, 0); }

.soon-badge {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--brand);
  border-radius: 999px;
  padding: 4px 12px;
  margin-left: 4px;
  vertical-align: middle;
}

.project-card.is-soon { cursor: default; }
.project-card.is-soon:hover .card-media { transform: none; box-shadow: 0 2px 10px rgba(42, 43, 47, 0.05); }
.project-card.is-soon:hover .card-media img { transform: none; }

/* Footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: clamp(48px, 7vw, 96px);
  padding-top: 24px;
  border-top: 1px solid rgba(42, 43, 47, 0.12);
  font-size: 14px;
  color: rgba(42, 43, 47, 0.7);
}

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

.site-footer a {
  font-weight: 500;
  transition: color 0.2s ease;
}

.site-footer a:hover { color: var(--brand); }

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1100px) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: minmax(300px, auto);
    min-height: 0;
  }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .bento {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(280px, auto);
  }
  .tile-hero { min-height: 360px; }
  .project-grid { grid-template-columns: 1fr; }
  .project-grid.centered { min-height: 0; }
  .tile-links { align-items: flex-end; }
  .tile-label { left: 20px; bottom: 16px; }
}

/* ============================================
   Reduced motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tile,
  .project-card { opacity: 1; transform: none; animation: none; }
  .marquee-track { animation: none !important; }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
