/* links.padelde.co (padelde/links.py): one calm column of links, phone first; a card on a darker
   tint of the page's background on wide screens, with a QR code to open it on a phone.
   Colours, radii and the display font come from the page's theme (padelde/link_theme.py) as
   custom properties in one <style> element; this file never hard-codes a theme colour.
   Classes on <body>: s-fill | s-outline | s-shadow (button style), r-square | r-soft | r-pill,
   f-inter-tight | f-inter | f-archivo. No motion but the button press (anticipation), none
   under reduced motion; no fades. */

@layer reset, tokens, base, components;

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 500 900;
  font-display: swap;
  src: url("fonts/inter-tight-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 500 900;
  font-display: swap;
  src: url("fonts/inter-tight-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Archivo (OFL): the sporty voice, a touch expanded (as on padelde.co's events panel). */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 700 900;
  font-stretch: 100% 125%;
  font-display: swap;
  src: url("fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 700 900;
  font-stretch: 100% 125%;
  font-display: swap;
  src: url("fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  body,
  h1,
  h2,
  p,
  ul {
    margin: 0;
  }
  ul {
    padding: 0;
    list-style: none;
  }
  img,
  svg {
    display: block;
  }
  img {
    max-inline-size: 100%;
    block-size: auto;
  }
  button {
    font: inherit;
    color: inherit;
    border: 0;
    background: none;
    padding: 0;
    cursor: pointer;
  }
}

@layer tokens {
  :root {
    /* Fallbacks only: the page's <style> sets every one of these from its theme. */
    --bg: #f4f0e6;
    --backdrop: #d2cec6;
    --backdrop-text: #121417;
    --text: #121417;
    --muted: #4d5257;
    --edge: rgb(18 20 23 / 0.14);
    --chip: rgb(18 20 23 / 0.08);
    --chip-hover: rgb(18 20 23 / 0.14);
    --btn: #fff;
    --btn-text: #121417;
    --btn-sub: #4d5257;
    --btn-edge: rgb(18 20 23 / 0.1);
    --accent: #1550ff;
    --accent-text: #fff;
    --accent-sub: #e3e9ff;
    --r-btn: 1rem;
    --r-card: 1.25rem;
    --r-thumb: 0.625rem;
    --font-display: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
    --display-weight: 700;
    --display-stretch: 100%;
    --transform: none;
    --font-text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --gutter: 1rem;
    --ring: #1550ff;
    --sheen: rgb(255 255 255 / 0.5);
    --sheen-main: rgb(255 255 255 / 0.5);
    /* Elevation (the theme sets light/dark values): 1 at rest, 2 raised, 3 the card. */
    --shadow-1: 0 1px 2px rgb(16 18 20 / 0.06), 0 2px 6px rgb(16 18 20 / 0.05);
    --shadow-2: 0 2px 4px rgb(16 18 20 / 0.06), 0 10px 24px -4px rgb(16 18 20 / 0.12);
    --shadow-3: 0 4px 10px rgb(16 18 20 / 0.06), 0 28px 64px -12px rgb(16 18 20 / 0.24);
    --highlight: inset 0 0 0 0 transparent;
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --quick: 180ms;
  }
}

@layer base {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  body {
    min-block-size: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-text);
    font-size: 1rem;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    overflow-wrap: break-word;
  }
  a {
    color: inherit;
    -webkit-tap-highlight-color: transparent;
  }
  :focus-visible {
    outline: 3px solid var(--ring);
    outline-offset: 3px;
  }
}

@layer components {
  /* The page: full-bleed on phones. */
  .lp {
    display: flex;
    flex-direction: column;
    min-block-size: 100dvh;
    inline-size: 100%;
    max-inline-size: 37.5rem;
    margin-inline: auto;
    padding-block: calc(0.75rem + env(safe-area-inset-top, 0px)) calc(1rem + env(safe-area-inset-bottom, 0px));
    padding-inline: calc(var(--gutter) + env(safe-area-inset-left, 0px)) calc(var(--gutter) + env(safe-area-inset-right, 0px));
    background: var(--bg);
  }

  /* Wide screens: a card on a darker tint of the background. */
  @media (min-width: 40rem) {
    body {
      background: var(--backdrop);
    }
    .lp {
      --gutter: 2.25rem;
      min-block-size: calc(100dvh - 4rem);
      margin-block: 2rem;
      padding-block: 1.75rem 1.5rem;
      border-radius: 2rem;
      box-shadow: 0 0 0 1px var(--edge), var(--highlight), var(--shadow-3);
    }
  }

  /* Top bar: our mark home, the Mesaj pill and share. */
  .lp-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }
  .lp-bar-end {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .lp-round,
  .lp-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    block-size: 3rem;
    border-radius: 999px;
    background: var(--chip);
    color: var(--text);
    text-decoration: none;
    touch-action: manipulation;
    --rest: var(--highlight), var(--shadow-1);
    --raised: var(--highlight), var(--shadow-2);
    box-shadow: var(--rest);
  }
  .lp-round {
    inline-size: 3rem;
  }
  .lp-round img {
    block-size: 1.75rem;
    inline-size: auto;
  }
  .lp-round svg {
    inline-size: 1.375rem;
    block-size: 1.375rem;
  }
  .lp-pill {
    padding-inline: 1.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
  }
  @media (hover: hover) {
    .lp-round:hover,
    .lp-pill:hover,
    .lp-socials a:hover {
      background: var(--chip-hover);
    }
  }

  .lp-main {
    flex: 1;
  }

  /* Header: avatar, title, bio, social icons. */
  .lp-head {
    display: grid;
    justify-items: center;
    gap: 0.5rem;
    margin-block: 1.5rem 2rem;
    text-align: center;
  }
  .lp-avatar {
    inline-size: 6rem;
    block-size: 6rem;
    margin-block-end: 0.5rem;
    border-radius: 50%;
    object-fit: cover;
    /* A ring in the page's colour, a hairline, then a soft lift. */
    box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--edge), var(--shadow-2);
  }
  .lp-title {
    max-inline-size: 100%;
    font-family: var(--font-display);
    font-weight: 800;
    font-stretch: var(--display-stretch);
    font-size: 1.5rem;
    line-height: 1.15;
    letter-spacing: -0.022em;
    text-wrap: balance;
  }
  .f-archivo .lp-title {
    letter-spacing: 0;
  }
  .lp-bio {
    max-inline-size: 28rem;
    color: var(--muted);
    font-size: 1rem;
    text-wrap: balance;
  }
  .lp-socials {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 0.25rem;
    margin-block-start: 0.25rem;

    & a {
      display: grid;
      place-items: center;
      inline-size: 2.75rem;
      block-size: 2.75rem;
      border-radius: 999px;
      color: var(--text);
    }
    & svg {
      inline-size: 1.5rem;
      block-size: 1.5rem;
    }
  }

  /* The items. */
  .lp-list {
    display: grid;
    gap: 0.875rem;
  }

  /* Section header: the team's words, the page's voice. */
  .lp-section {
    padding-block: 0.875rem 0.125rem;
    text-align: center;

    & h2 {
      font-family: var(--font-display);
      font-weight: 800;
      font-stretch: var(--display-stretch);
      font-size: 1rem;
      line-height: 1.25;
      letter-spacing: var(--section-tracking, 0.01em);
      text-transform: var(--transform);
      text-wrap: balance;
    }
  }
  .lp-list > .lp-section:first-child {
    padding-block-start: 0;
  }

  /* A link: the whole button is the target (Fitts: 60px+). The title stays centred on the
     button, also beside a thumbnail (an empty column of the same width balances it). */
  .lp-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    min-block-size: 3.75rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--r-btn);
    background: var(--btn);
    color: var(--btn-text);
    box-shadow: inset 0 0 0 1px var(--btn-edge);
    text-decoration: none;
    touch-action: manipulation;
  }
  .lp-link.has-thumb {
    grid-template-columns: 3.5rem minmax(0, 1fr) 3.5rem;
    gap: 0.5rem;
    min-block-size: 4.5rem;
    padding: 0.5rem;
  }
  .r-pill .lp-link.has-thumb {
    padding-inline-end: 0.75rem;
  }
  .lp-link.has-thumb::after {
    content: "";
  }
  /* Narrow phones (320 px): the text gets the room, a little off centre. */
  @media (max-width: 24rem) {
    .lp-link.has-thumb {
      grid-template-columns: 3rem minmax(0, 1fr) 0.25rem;
    }
    .lp-link.has-thumb .lp-thumb {
      inline-size: 3rem;
      block-size: 3rem;
    }
  }
  .lp-thumb {
    display: block;
    overflow: hidden;
    inline-size: 3.5rem;
    block-size: 3.5rem;
    border-radius: var(--r-thumb);

    & img {
      inline-size: 100%;
      block-size: 100%;
      object-fit: cover;
    }
  }
  .lp-text {
    display: grid;
    gap: 0.125rem;
    text-align: center;
  }
  .lp-label {
    font-family: var(--font-display);
    font-weight: var(--display-weight);
    font-stretch: var(--display-stretch);
    font-size: 1.0625rem;
    line-height: 1.25;
    letter-spacing: var(--tracking, -0.006em);
    text-transform: var(--transform);
    text-wrap: balance;
  }
  .f-archivo .lp-label {
    font-size: 1rem;
  }
  .lp-sub {
    color: var(--btn-sub);
    font-size: 0.875rem;
    line-height: 1.35;
    text-wrap: balance;
  }

  /* Elevation per style: dolu rests on shadow-1, gölgeli on shadow-2 (the strongest), çerçeve
     on none (it lifts only on hover). --rest/--raised are what the hover swaps between. */
  .lp-link {
    --rest: inset 0 0 0 1px var(--btn-edge), var(--highlight), var(--shadow-1);
    --raised: inset 0 0 0 1px var(--btn-edge), var(--highlight), var(--shadow-2);
    box-shadow: var(--rest);
  }
  .s-shadow .lp-link {
    --rest: inset 0 0 0 1px var(--btn-edge), var(--highlight), var(--shadow-2);
    --raised: inset 0 0 0 1px var(--btn-edge), var(--highlight), var(--shadow-2), var(--shadow-1);
  }
  .s-outline .lp-link {
    --rest: inset 0 0 0 2px var(--btn-edge);
    --raised: inset 0 0 0 2px var(--btn-edge), var(--shadow-2);
    background: transparent;
  }

  /* The page's main action: the accent, the one strong voice. */
  .lp-link.is-main {
    min-block-size: 4.25rem;
    --rest: var(--highlight), var(--shadow-2);
    --raised: var(--highlight), var(--shadow-2), var(--shadow-1);
    --sheen: var(--sheen-main);
    background: var(--accent);
    color: var(--accent-text);

    & .lp-label {
      font-weight: 800;
      font-size: 1.125rem;
    }
    & .lp-sub {
      color: var(--accent-sub);
    }
  }
  .lp-link.is-main.has-thumb {
    min-block-size: 4.75rem;
  }

  /* Featured: a picture card, the title over a dark gradient at its foot. */
  .lp-feature {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: var(--r-card);
    background: var(--chip);
    color: #fff;
    text-decoration: none;
    --rest: 0 0 0 1px var(--edge), var(--shadow-2);
    --raised: 0 0 0 1px var(--edge), var(--shadow-2), var(--shadow-1);
    box-shadow: var(--rest);
    touch-action: manipulation;

    & img {
      inline-size: 100%;
      block-size: 100%;
      object-fit: cover;
    }
    & .lp-feature-text {
      position: absolute;
      inset-inline: 0;
      inset-block-end: 0;
      display: grid;
      gap: 0.125rem;
      padding: 3rem 1.25rem 1rem;
      background: linear-gradient(to bottom, rgb(0 0 0 / 0), rgb(0 0 0 / 0.72) 62%);
      text-align: center;
    }
    & .lp-label {
      font-size: 1.125rem;
      text-shadow: 0 1px 2px rgb(0 0 0 / 0.35);
    }
    & .lp-sub {
      color: rgb(255 255 255 / 0.88);
    }
  }
  .lp-feature.is-main {
    --rest: 0 0 0 3px var(--accent), var(--shadow-2);
    --raised: 0 0 0 3px var(--accent), var(--shadow-2), var(--shadow-1);
  }

  .lp-empty {
    padding: 1.5rem 1.25rem;
    border-radius: var(--r-card);
    background: var(--chip);
    color: var(--muted);
    text-align: center;
  }

  .lp-foot {
    display: flex;
    justify-content: center;
    margin-block-start: 2rem;
    font-size: 0.875rem;
    color: var(--muted);

    & a {
      display: inline-flex;
      align-items: center;
      min-block-size: 2.75rem;
      padding-inline: 0.75rem;
      text-underline-offset: 0.2em;
    }
  }

  /* "Telefonda aç": the page's address as a QR code, on wide screens with a mouse only. */
  .lp-qr {
    display: none;
  }
  @media (min-width: 64rem) and (hover: hover) {
    .lp-qr {
      position: fixed;
      inset-inline-end: 2rem;
      inset-block-end: 2rem;
      display: grid;
      justify-items: center;
      gap: 0.5rem;
      color: var(--backdrop-text);
      font-size: 0.875rem;
      font-weight: 600;

      & svg {
        inline-size: 7.5rem;
        block-size: 7.5rem;
        border-radius: 0.75rem;
        box-shadow: var(--shadow-2);
      }
    }
  }

  /* Share's answer when it copied the link (static/links.js). */
  .lp-toast {
    position: fixed;
    inset-inline: 0;
    inset-block-end: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    inline-size: max-content;
    max-inline-size: calc(100% - 2rem);
    margin-inline: auto;
    padding: 0.625rem 1.125rem;
    border-radius: 999px;
    background: var(--text);
    color: var(--bg);
    font-size: 0.9375rem;
    font-weight: 600;
    box-shadow: var(--shadow-2);
  }
  .lp-toast:empty {
    display: none;
  }

  /* ops > Linkler's preview: the page as it is, nothing opens. */
  .is-preview {
    & a,
    & button {
      pointer-events: none;
    }
    & .lp-qr {
      display: none;
    }
  }

  /* --- Motion (brand/GUIDELINES.md > Interaction patterns) ---------------------------------
     Microinteractions: hover lifts a target (translate + the next shadow), press sinks it
     (scale .98, a shallower shadow): anticipation, so a tap feels answered before the page
     changes. Pictures zoom a touch inside their frame on hover (feedforward: this opens).
     Individual transform properties (translate / scale / rotate) so hover, press and an
     attention animation never overwrite each other. Under reduced motion nothing moves; the
     shadow and colour still answer. No fades on content. */
  .lp-link,
  .lp-feature,
  .lp-round,
  .lp-pill,
  .lp-socials a {
    transition:
      translate var(--quick) var(--ease),
      scale var(--quick) var(--ease),
      box-shadow var(--quick) var(--ease),
      background-color var(--quick) var(--ease);
  }
  .lp-thumb img,
  .lp-feature img {
    transition: scale 400ms var(--ease);
  }
  @media (hover: hover) {
    :is(.lp-link, .lp-feature, .lp-round, .lp-pill):hover {
      box-shadow: var(--raised);
    }
    .lp-thumb img:is(.lp-link:hover *),
    .lp-feature:hover img {
      scale: 1.03;
    }
  }
  :is(.lp-link, .lp-feature, .lp-round, .lp-pill):active {
    box-shadow: var(--rest);
  }
  @media (prefers-reduced-motion: no-preference) {
    @media (hover: hover) {
      :is(.lp-link, .lp-feature, .lp-round, .lp-pill, .lp-socials a):hover {
        translate: 0 -2px;
      }
    }
    :is(.lp-link, .lp-feature, .lp-round, .lp-pill, .lp-socials a):active {
      translate: 0 0;
      scale: 0.98;
      transition-duration: 90ms;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .lp-thumb img,
    .lp-feature img {
      scale: 1 !important; /* reduced motion: pictures stay still */
    }
  }

  /* Attention (anticipation): an item the team marked in ops (link_items.animation) moves at once and
     every 4.5 s for as long as the page is open (Cem); it stops while hovered. Off under reduced motion. */
  @media (prefers-reduced-motion: no-preference) {
    .an-pulse {
      animation: lp-pulse 4.5s var(--ease) infinite;
    }
    .an-wiggle {
      animation: lp-wiggle 4.5s ease-in-out infinite;
    }
    .an-shine {
      position: relative;
      overflow: hidden;
    }
    .an-shine::before {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 1;
      pointer-events: none;
      background: linear-gradient(105deg, transparent 35%, var(--sheen) 50%, transparent 65%);
      translate: -110% 0;
      animation: lp-shine 4.5s ease-in-out infinite;
    }
    :is(.an-pulse, .an-wiggle, .an-shine):hover,
    :is(.an-shine):hover::before {
      animation-play-state: paused;
    }
  }
  @keyframes lp-pulse {
    0%,
    30%,
    100% {
      scale: 1;
    }
    10% {
      scale: 1.025;
    }
    20% {
      scale: 0.995;
    }
  }
  @keyframes lp-wiggle {
    0%,
    24%,
    100% {
      rotate: 0deg;
    }
    4% {
      rotate: -1.6deg;
    }
    9% {
      rotate: 1.4deg;
    }
    14% {
      rotate: -1deg;
    }
    19% {
      rotate: 0.5deg;
    }
  }
  @keyframes lp-shine {
    0% {
      translate: -110% 0;
    }
    30%,
    100% {
      translate: 110% 0;
    }
  }
}
