/* ==========================================================================
   Landing page - styles on top of base.css
   Uses both project accents: teal for GeoAPP, pumpkin for KittyCats.
   ========================================================================== */

@layer page {
  :root {
    --accent: var(--c-text);
    --accent-soft: var(--c-surface-2);
  }

  /* ---------- Intro ---------- */

  .intro {
    display: grid;
    align-items: center;
    gap: var(--space-6);
    padding-block: var(--space-8) var(--space-7);
  }

  @media (min-width: 48em) {
    .intro {
      grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    }
  }

  .intro__text {
    display: grid;
    justify-items: start;
    gap: var(--space-4);
  }

  .intro h1 {
    font-size: clamp(2rem, 1.4rem + 3.4vw, 4.25rem);
    letter-spacing: -0.03em;
  }

  .intro__role {
    margin-top: calc(-1 * var(--space-2));
    font-size: var(--step-2);
    font-weight: 600;
    color: var(--c-text-muted);
  }

  .skills,
  .tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: 0;
    list-style: none;
  }

  .skills li {
    padding: var(--space-1) var(--space-3);
    font-size: var(--step--1);
    font-weight: 600;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-pill);
  }

  .intro__links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-2);
    padding: 0;
    list-style: none;
  }

  .intro__art {
    justify-self: center;
    width: min(100%, 22rem);
  }

  @media (max-width: 47.99em) {
    .intro__art {
      display: none;
    }
  }

  .intro__art svg {
    width: 100%;
    aspect-ratio: 1;
    overflow: visible;
  }

  .intro__ring {
    fill: none;
    stroke: var(--c-border-strong);
    stroke-width: 1.5;
    stroke-dasharray: 3 9;
    transform-origin: center;
    animation: turn 60s linear infinite;
  }

  .intro__dot-a {
    fill: var(--c-geo);
  }

  .intro__dot-b {
    fill: var(--c-kitty);
    fill-opacity: 0.86;
  }

  .intro__spark {
    fill: var(--c-kitty-deco);
  }

  .intro__spark--b {
    fill: var(--c-geo);
  }

  @keyframes turn {
    to {
      transform: rotate(1turn);
    }
  }

  /* ---------- Projects ---------- */

  .projects__head {
    margin-bottom: var(--space-6);
  }

  .section-text {
    max-width: 62ch;
    margin-top: var(--space-3);
    color: var(--c-text-muted);
  }

  .projects__grid {
    display: grid;
    gap: var(--space-5);
    padding: 0;
    list-style: none;
  }

  @media (min-width: 48em) {
    .projects__grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  .project--geo {
    --accent: var(--c-geo);
    --accent-soft: var(--c-geo-soft);
  }

  .project--kitty {
    --accent: var(--c-kitty);
    --accent-soft: var(--c-kitty-soft);
  }

  /* The whole card is clickable through the heading link (stretched ::after);
     the card itself stays a plain list item for screen readers. */
  .project {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
  }

  .project:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-2);
    transform: translateY(-4px);
  }

  .project:has(.project__link:focus-visible) {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
  }

  .project__link {
    color: inherit;
    text-decoration: none;
  }

  .project__link:focus-visible {
    outline: none;
  }

  .project__link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
  }

  .project__visual {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 9;
    max-height: 16rem;
    overflow: hidden;
    background: var(--accent-soft);
    border-bottom: 1px solid var(--c-border);
  }

  .project__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-5);
  }

  .project__body .eyebrow {
    color: var(--accent);
  }

  .project__body h3 {
    font-size: var(--step-3);
  }

  .project__body > p:not(.eyebrow) {
    color: var(--c-text-muted);
  }

  .tags li {
    padding: 0 var(--space-2);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--c-text-muted);
    background: var(--c-surface-2);
    border-radius: var(--radius-sm);
  }

  .project__cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: auto;
    padding-top: var(--space-2);
    font-weight: 700;
    color: var(--accent);
  }

  .project__cta svg {
    width: 1.1em;
    height: 1.1em;
    transition: transform var(--dur) var(--ease);
  }

  .project:hover .project__cta svg {
    transform: translateX(4px);
  }

  /* GeoAPP preview: a tiny quiz built from HTML and CSS */
  .mini-quiz {
    display: grid;
    justify-items: center;
    gap: var(--space-1);
    width: min(78%, 20rem);
    padding: var(--space-4);
    color: #fff;
    background: linear-gradient(150deg, #134e4a, #0f2f2d);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-2);
    rotate: -2deg;
  }

  .mini-quiz__word {
    font-family: var(--font-ka);
    font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem);
    font-weight: 700;
    line-height: 1.2;
  }

  .mini-quiz__translit {
    font-size: var(--step--1);
    color: #cfe5e1;
  }

  .mini-quiz__options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2);
    width: 100%;
    margin-top: var(--space-2);
  }

  .mini-quiz__options span {
    padding: var(--space-1) 0;
    font-weight: 800;
    text-align: center;
    background: rgb(255 255 255 / 0.1);
    border: 1px solid rgb(255 255 255 / 0.25);
    border-radius: var(--radius-sm);
  }

  .mini-quiz__options .is-correct {
    color: #0f2f2d;
    background: #5eead4;
    border-color: #5eead4;
  }

  /* KittyCats preview: kitten + a tiny wireframe of a grid */
  .project__visual--kitty {
    grid-template-columns: auto auto;
    gap: var(--space-5);
  }

  .mini-kitten {
    width: clamp(6rem, 4rem + 8vw, 9rem);
    aspect-ratio: 1;
    rotate: -4deg;
  }

  .mini-layout {
    display: grid;
    grid-template-columns: repeat(2, 2.75rem);
    grid-template-rows: repeat(2, 2.75rem);
    gap: var(--space-2);
  }

  .mini-layout span {
    border: 2px dashed var(--accent);
    border-radius: var(--radius-sm);
  }

  .mini-layout span:first-child {
    grid-row: span 2;
    background: color-mix(in srgb, var(--accent) 18%, transparent);
  }
}
