/* ==========================================================================
   Home page — extensions to the design system
   Builds on style-guide/styles.css. Page-specific layout only.
   ========================================================================== */

/* Narrower editorial column for the home page. The design system default
   (1100px) suits the style-guide's wide swatches/cards; a text-forward
   home page reads better in a tighter measure. */
:root {
  --col: 780px;
}

/* ----- Brand fruit cycler ------------------------------------------------ */
/* Replaces the .px-dot in the nav brand mark with a 7-fruit cycle that
   matches the brand-color rhythm. Same 12×12 footprint. */
.px-fruit {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 16px;
}
.px-fruit svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  animation: px-fruit-cycle 5.6s steps(1) infinite;
}
.px-fruit svg:nth-child(1) { animation-delay: 0s; }
.px-fruit svg:nth-child(2) { animation-delay: -0.8s; }
.px-fruit svg:nth-child(3) { animation-delay: -1.6s; }
.px-fruit svg:nth-child(4) { animation-delay: -2.4s; }
.px-fruit svg:nth-child(5) { animation-delay: -3.2s; }
.px-fruit svg:nth-child(6) { animation-delay: -4.0s; }
.px-fruit svg:nth-child(7) { animation-delay: -4.8s; }
@keyframes px-fruit-cycle {
  0%, 14.28%   { opacity: 1; }
  14.29%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .px-fruit svg { animation: none; }
  .px-fruit svg:nth-child(1) { opacity: 1; }
}

/* ----- Brand mark (sun, spins on hover) ---------------------------------- */
.brand-mark {
  display: inline-block;
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  color: var(--ipe);
}
.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
  transition: transform 200ms var(--ease-back, cubic-bezier(.34,1.56,.64,1));
}
.brand:hover .brand-mark svg,
.brand:focus-visible .brand-mark svg {
  animation: sun-spin 800ms steps(8, end) 1;
}

/* ----- Hero -------------------------------------------------------------- */
.home-hero {
  padding: 24px 0 8px;
}
.home-hero .h-page {
  font-size: 34px;
  line-height: 1.18;
  letter-spacing: -0.02em;
  max-width: 30ch;
}
.home-hero .lede {
  margin-top: 8px;
  margin-bottom: 0;
}
.hero-socials,
.foot-socials {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.foot-socials {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.foot-socials a {
  color: var(--ink-1);
}
.foot-socials a:hover,
.foot-socials a:focus-visible {
  color: var(--bougainvillea-strong);
}

/* ----- Section heads on the home page ------------------------------------ */
.home-section {
  padding: 56px 0;
  border-top: 1px solid var(--line);
}
.home-section:first-of-type {
  border-top: 0;
}
.home-section .section-head {
  margin-bottom: 24px;
}
.home-section .section-head .h-sub {
  margin: 0;
}
.home-section .section-head .mono {
  margin-left: auto;
}

/* ----- Work grid — 2-column tiles ---------------------------------------- */
.work-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}
.work-row {
  display: block;
}
.work-row--featured {
  grid-column: 1 / -1;
}
.work-row a {
  display: block;
  text-decoration: none;
  color: var(--ink);
}
.work-row .thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-md);
  border: 2px solid var(--line-2);
  margin-bottom: 16px;
  overflow: hidden;
  transition: transform var(--t-fast) var(--ease-back), box-shadow var(--t-med) var(--ease), border-color var(--t-med) var(--ease), background-color var(--t-med) var(--ease);
}
.work-row--featured .thumb {
  aspect-ratio: 16 / 7;
}
.work-row a:hover .thumb {
  transform: translate(-4px, -4px);
}
/* Per-tile accent — tinted bg at rest, saturated border + shadow on hover */
.thumb--tijuca        { background: var(--tijuca-50); }
.thumb--ipanema       { background: var(--ipanema-50); }
.thumb--bougainvillea { background: var(--bougainvillea-50); }
.work-row a:hover .thumb--tijuca        { border-color: var(--tijuca);        box-shadow: 6px 6px 0 var(--tijuca); }
.work-row a:hover .thumb--ipanema       { border-color: var(--ipanema);       box-shadow: 6px 6px 0 var(--ipanema); }
.work-row a:hover .thumb--bougainvillea { border-color: var(--bougainvillea); box-shadow: 6px 6px 0 var(--bougainvillea); }
.work-row .thumb > * {
  position: relative;
  z-index: 1;
}
.work-row--featured .thumb {
  aspect-ratio: auto;
  padding: 40px 50px 0;
  display: block;
}
.work-row--featured .thumb img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: -160px;
  border-radius: var(--r-sm);
  border: 1px solid #D1D9E0;
}
/* Centered (no bleed) variant — for device mockups / illustrations */
.work-row--featured .thumb--center {
  padding: 32px 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.work-row--featured .thumb--center img {
  width: auto;
  max-width: 100%;
  max-height: 420px;
  margin: 0;
  border-radius: 0;
  border: 0;
}
@media (max-width: 720px) {
  .work-row--featured .thumb {
    padding: 16px 16px 0;
    aspect-ratio: auto;
  }
}
.work-row-body { padding: 0 2px; }
.work-row .work-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-1);
  margin: 0 0 6px;
}
.work-row .title {
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 600;
  color: var(--ink);
}
.work-row .blurb {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-1);
  margin-top: 6px;
  max-width: 50ch;
}
.work-row .meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
}
@media (max-width: 720px) {
  .work-list { grid-template-columns: 1fr; gap: 32px; }
  .work-row--featured .thumb { aspect-ratio: 4 / 3; }
}

/* Outcome pill — small, restrained */
.outcome {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  background: var(--line);
  color: #6B6050;
  white-space: nowrap;
}
.outcomes {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ----- Foot row (contact CTA) ------------------------------------------- */
.foot-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 80px 0 0;
  margin-top: 0;
}
.flags {
  display: inline-flex;
  gap: 3px;
  margin-left: 4px;
  vertical-align: -1px;
}
.flag {
  display: inline-block;
  shape-rendering: crispEdges;
  image-rendering: pixelated;
  border-radius: 1px;
}

/* ----- Responsive -------------------------------------------------------- */
@media (max-width: 720px) {
  .work-row .title { font-size: 19px; }
  .home-section { padding: 40px 0; }
  .foot-row { gap: 12px; }
}

/* ==========================================================================
   Cursor-companion picker — floating button + overlay panel
   ========================================================================== */
.pal-toggle {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 50;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 22px -10px rgba(17,17,17,.18);
  transition:
    transform var(--t-med) var(--ease-back),
    box-shadow var(--t-med) var(--ease),
    border-color var(--t-fast) var(--ease);
}
.pal-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -12px rgba(17,17,17,.22);
  border-color: var(--tijuca);
}
.pal-toggle:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.pal-toggle:active { transform: translateY(0) scale(.96); }
.pal-toggle-fruit { display: inline-flex; }
.pal-toggle-fruit svg { shape-rendering: crispEdges; image-rendering: pixelated; display: block; }

/* Cursor pal — slightly smaller than the design-system default */
.px-pal { width: 24px; height: 28px; }

.pal-panel {
  position: fixed;
  left: 24px;
  bottom: 88px;
  z-index: 51;
  width: 280px;
  padding: 18px 18px 34px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 48px -20px rgba(17,17,17,.22), 0 4px 14px -8px rgba(17,17,17,.10);
  opacity: 0;
  transform: translateY(8px) scale(.96);
  transform-origin: 28px calc(100% + 28px);
  transition:
    opacity var(--t-med) var(--ease),
    transform var(--t-med) var(--ease-back);
  pointer-events: none;
}
.pal-panel[hidden] { display: none; }
.pal-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.pal-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.pal-panel-hint {
  font-size: 13px;
  color: var(--ink-1);
  margin: 0 0 14px;
}
.pal-close {
  background: none;
  border: 0;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-1);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--r-sm);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.pal-close:hover { background: var(--line); color: var(--ink); }
.pal-close:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.pal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px 6px;
}
.pal-opt {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease-back);
}
.pal-opt:hover {
  background: var(--line);
  transform: translateY(-1px);
}
.pal-opt:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.pal-opt[aria-checked="true"] {
  background: var(--ipanema-50);
  border-color: var(--ipanema);
}
.pal-opt svg { shape-rendering: crispEdges; image-rendering: pixelated; display: block; }
.pal-opt .pal-opt-name {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-1);
  pointer-events: none;
  white-space: nowrap;
}
.pal-opt .pal-opt-name .en { display: none; }
.pal-opt:hover .pal-opt-name .pt,
.pal-opt:focus-visible .pal-opt-name .pt { display: none; }
.pal-opt:hover .pal-opt-name .en,
.pal-opt:focus-visible .pal-opt-name .en { display: inline; color: var(--ink); }

/* Hide picker on touch / coarse pointers — cursor companion doesn't apply */
@media (pointer: coarse) {
  .pal-toggle, .pal-panel { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .pal-panel { transition: opacity 0.001ms, transform 0.001ms; }
  .pal-toggle { transition: none; }
}
