/* ============================================================================
   Said Dulevic — 2026 editorial redesign
   Loaded AFTER app.css: re-tokenises the palette (Apple blue -> coral) and adds
   the new hero, section-title and portfolio-grid components.
   ========================================================================== */

:root {
  /* ── Coral accent replaces the Apple blue across the whole site ──────────
     Two corals, chosen so the brand reads the same but text stays legible:

       --accent-bright #F9564F  large display type + decorative fills only.
                                3.24:1 on white — passes AA for large text
                                (>=24px, or >=18.7px bold), fails for body text.
       --accent        #D33A32  everything interactive or small: buttons,
                                links, labels. 4.75:1 with white on it.
       --link          #C4362C  body links. 5.37:1 on white.               */
  --accent-bright: #F9564F;
  --accent:        #D33A32;
  --accent-hover:  #C4362C;
  --accent-press:  #B93A2F;
  --link:          #C4362C;
  --accent-ink:    #C4362C;   /* coral that is safe on white or on --coral-50 */
  --accent-dark:   #FF7A73;   /* for dark surfaces only */

  /* Editorial support tones */
  --coral-50:   #FFF3F2;
  --coral-100:  #FFE4E1;
  --coral-200:  #FFCFC9;
  --ink:        #111114;
  --ink-soft:   #55555F;
  /* Adopt the editorial ink site-wide so app.css components match the
     new hero instead of sitting a shade lighter. */
  --text:       #111114;
  --text-muted: #55555F;

  --font-script: "Caveat", "Segoe Script", cursive;
}

/* Heavier display weight than app.css ships with. */
.rd-hero__title,
.rd-section-title,
.rd-portfolio__heading { font-weight: 900; letter-spacing: -.035em; }

/* ============================== HERO ====================================== */

.rd-hero {
  position: relative;
  overflow: hidden;
  background: var(--bg-white);
  padding: clamp(2rem, 6vw, 5rem) 0 clamp(3rem, 8vw, 6rem);
  isolation: isolate;
}

/* Oversized script watermark, echoing the reference background lettering. */
.rd-hero__watermark {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%) rotate(-4deg);
  font-family: var(--font-script);
  font-size: clamp(14rem, 34vw, 30rem);
  line-height: .8;
  color: var(--coral-100);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: -1;
  opacity: .85;
}

.rd-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .92fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
}

.rd-hero__hola {
  font-size: clamp(.95rem, 1.4vw, 1.05rem);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 .35rem;
}

.rd-hero__name {
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 700;
  color: var(--accent-bright);
  margin: 0 0 .3rem;
  letter-spacing: -.02em;
}

.rd-hero__title {
  font-size: clamp(2.9rem, 8.2vw, 6.2rem);
  line-height: .95;
  color: var(--ink);
  margin: 0 0 1.25rem;
}
.rd-dot { color: var(--accent-bright); }   /* only ever on huge display type */

.rd-hero__lead {
  font-size: clamp(1rem, 1.25vw, 1.08rem);
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 34rem;
  margin: 0 0 1.6rem;
}

/* ── social row ──────────────────────────────────────────────────────────── */
.rd-socials { display: flex; gap: 1.15rem; margin-bottom: 1.75rem; }
.rd-socials a {
  display: grid;
  place-items: center;
  width: 2.15rem; height: 2.15rem;
  color: var(--ink);
  transition: color .2s ease, transform .2s ease;
}
.rd-socials a:hover { color: var(--accent); transform: translateY(-2px); }
.rd-socials svg { width: 1.45rem; height: 1.45rem; }

/* ── buttons ─────────────────────────────────────────────────────────────── */
.rd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .85rem 2.4rem;
  font-weight: 600;
  font-size: .95rem;
  border-radius: 4px;
  text-decoration: none;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.rd-btn--accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 26px rgba(211, 58, 50, .26);
}
.rd-btn--accent:hover { background: var(--accent-hover); transform: translateY(-2px); color: #fff; }
.rd-btn--dark { background: var(--ink); color: #fff; }
.rd-btn--dark:hover { background: #000; transform: translateY(-2px); color: #fff; }

/* ── figure: photo shaped into an organic blob, coral blob behind ────────── */
.rd-hero__figure {
  position: relative;
  display: grid;
  place-items: center;
}

/* The blob must be bigger than the portrait on every side, or it is simply
   hidden behind it. Sizing it off the figure box does not work — the figure
   collapses onto the photo — so give it its own size in the photo's own
   4:5 proportion, ~12% larger, and centre it on the same point. */
.rd-blob {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(112%, 28rem);
  aspect-ratio: 4 / 5;
  background: var(--accent-bright);
  border-radius: 58% 42% 47% 53% / 52% 46% 54% 48%;
  animation: rd-blob-morph 16s ease-in-out infinite;
}

@keyframes rd-blob-morph {
  0%, 100% { border-radius: 58% 42% 47% 53% / 52% 46% 54% 48%; }
  33%      { border-radius: 44% 56% 60% 40% / 46% 58% 42% 54%; }
  66%      { border-radius: 52% 48% 38% 62% / 60% 44% 56% 40%; }
}

.rd-hero__photo {
  position: relative;
  width: min(100%, 25rem);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 18%;
  border-radius: 54% 46% 44% 56% / 48% 52% 48% 52%;
  filter: grayscale(1) contrast(1.06);
  box-shadow: 0 30px 70px rgba(17, 17, 20, .22);
}
/* When a transparent cut-out is available it sits on the blob unmasked. */
.rd-hero__photo--cutout {
  border-radius: 0;
  filter: grayscale(1) contrast(1.05);
  box-shadow: none;
  aspect-ratio: auto;
  align-self: end;
}

/* Decorative dashed path, echoing the reference. */
.rd-hero__path {
  position: absolute;
  left: 6%;
  bottom: 4%;
  width: min(38rem, 46vw);
  height: auto;
  color: var(--accent-bright);
  opacity: .55;
  pointer-events: none;
  z-index: -1;
}
.rd-hero__path path {
  stroke-dasharray: 9 11;
  animation: rd-dash 30s linear infinite;
}
@keyframes rd-dash { to { stroke-dashoffset: -400; } }

/* ========================= SECTION TITLES ================================= */

.rd-section-title {
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  line-height: 1.05;
  color: var(--ink);
  margin: 0 0 .9rem;
  text-align: center;
}

/* The About block keeps its two-column layout (bio + timeline), so its title
   stays left-aligned while using the same editorial type as the centred ones. */
.rd-section-title--left { text-align: left; }

.rd-section-lead {
  max-width: 40rem;
  margin: 0 auto;
  text-align: center;
  color: var(--ink-soft);
  line-height: 1.7;
  font-size: clamp(.98rem, 1.2vw, 1.05rem);
}

/* ========================== PORTFOLIO GRID ================================ */

.rd-portfolio { padding: clamp(4rem, 8vw, 8rem) 0; }   /* matches app.css .section */

.rd-portfolio__head {
  margin-bottom: clamp(2rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rd-portfolio__season {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin: 0 auto .9rem;
  padding: .4rem 1rem;
  background: var(--coral-50);
  color: var(--accent-ink);
  border-radius: 980px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .02em;
}

/* 17rem min keeps three columns inside the site's ~980px container; it steps
   down to two, then one, as the viewport narrows. */
.rd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: clamp(1.1rem, 2vw, 1.6rem);
}

.rd-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(17, 17, 20, .08);
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .28s cubic-bezier(.2, .7, .3, 1), box-shadow .28s ease, border-color .28s ease;
}
.rd-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 48px rgba(17, 17, 20, .13);
  border-color: rgba(17, 17, 20, .14);
}

/* Thumbnail area: real screenshot when we have one, branded fallback when not. */
.rd-card__thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--brand, var(--accent));
  display: grid;
  place-items: center;
}
.rd-card__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform .5s cubic-bezier(.2, .7, .3, 1);
}
.rd-card:hover .rd-card__thumb img { transform: scale(1.05); }

/* Fallback tile: brand-coloured field with the initials. */
.rd-card__mark {
  position: relative;
  z-index: 1;
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -.04em;
  color: #fff;
  text-shadow: 0 4px 18px rgba(0, 0, 0, .18);
}
.rd-card__thumb--fallback::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,.20), rgba(0,0,0,.14));
  pointer-events: none;
}

.rd-card__body { padding: 1.1rem 1.15rem 1.25rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }

.rd-card__industry {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.rd-card__name { font-size: 1.06rem; font-weight: 700; color: var(--ink); letter-spacing: -.015em; }
.rd-card__tag { font-size: .88rem; line-height: 1.55; color: var(--ink-soft); }

.rd-card__foot {
  margin-top: auto;
  padding-top: .8rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink);
}
.rd-card__foot svg { width: .95rem; height: .95rem; transition: transform .25s ease; }
.rd-card:hover .rd-card__foot { color: var(--accent-ink); }
.rd-card:hover .rd-card__foot svg { transform: translate(2px, -2px); }

/* ============================ RESPONSIVE ================================== */

@media (max-width: 900px) {
  .rd-hero__grid { grid-template-columns: 1fr; }
  .rd-hero__figure { order: -1; }
  .rd-hero__photo { width: min(76%, 17rem); }
  /* Keep the same ~12% margin around a smaller portrait. */
  .rd-blob { width: min(86%, 19rem); }
  .rd-hero__copy { text-align: center; }
  .rd-hero__lead { margin-inline: auto; }
  .rd-socials { justify-content: center; }
  .rd-hero__path { display: none; }
  .rd-hero__watermark { font-size: 40vw; opacity: .6; }
}

@media (max-width: 560px) {
  .rd-btn { width: 100%; }
  .rd-hero__title { font-size: clamp(2.4rem, 12vw, 3.2rem); }
}

/* ============================ MOTION SAFETY =============================== */

@media (prefers-reduced-motion: reduce) {
  .rd-blob { animation: none; }
  .rd-hero__path path { animation: none; }
  .rd-card, .rd-card__thumb img, .rd-card__foot svg { transition: none; }
  .rd-card:hover { transform: none; }
}


/* ==================== FOCUS + SELECTION (accessibility) ====================
   app.css hardcodes these values, so the token swap never reached them.
   Solid colour, not alpha: #C9302A is 5.33:1 on white, while the same coral
   at 60% alpha composites to #FB9A95 and measures only 2.07:1 — under the
   3:1 floor WCAG 2.1 SC 1.4.11 requires for focus indicators. */
:focus-visible {
  outline: 3px solid #C9302A;
  outline-offset: 2px;
}
.hero-search-input-wrap:focus-within,
.search-input:focus,
.form-control:focus {
  box-shadow: 0 0 0 4px rgba(211, 58, 50, .22);
}
::selection { background: rgba(249, 86, 79, .26); color: var(--ink); }