/* calculon.tech's landing page, scoped under .calculon-home so it can live
   inside Forgejo's chrome. Derived from ananthb/calculon.tech assets/css/style.css
   with CSS nesting: :root and body became the container (&), the fixed
   backdrops became absolute so they stay inside the page, main became
   .calculon, and @keyframes and the dark palette moved to the top level.
   Everything else is the original, verbatim. */
.calculon-home {
  color-scheme: light dark;
  --calculon-gap: 3rem;

  /* ── Colour tokens from Calculon logo ── */
  & {
    --gold-50:  #fffcf5;
    --gold-100: #fff6e0;
    --gold-200: #ffeab8;
    --gold-300: #ffd84a;
    --gold-400: #ffcc30;
    --gold-500: #f0a800;
    --gold-600: #e09600;
    --gold-700: #c87800;
    --gold-800: #8a6010;
    --gold-900: #1a0c00;
  
    --orange:   #e88000;
    --crown:    #ff8c00;
  
    /* ── Light mode: Champagne ── */
    --bg:               #f3d98a;
    --bg-deep:          #e8c768;
    --bg-card:          #fffaec;
    --bg-card-hover:    #ffffff;
    --fg:               #1a0c00;
    --fg-muted:         #4a3210;
    --fg-subtle:        #6b4a18;
    --accent:           #8a4a00;
    --accent-hover:     #c87800;
    --border:           rgba(80, 50, 0, 0.18);
    --border-strong:    rgba(80, 50, 0, 0.32);
    --shadow:           rgba(80, 50, 0, 0.12);
    --shadow-hover:     rgba(80, 50, 0, 0.22);
    --glow:             rgba(255, 220, 120, 0.55);
    --grain:            0.04;
    --vignette:         rgba(120, 70, 0, 0.18);
    --icon-bg:          rgba(200, 120, 0, 0.12);
    --icon-fg:          #8a4a00;
    --gilt-opacity:     0.6;
    --spotlight-size:   900px;
    --spotlight-top:    -25%;
    --spotlight-blend:  screen;
    --cell-inset:       rgba(255, 255, 255, 0.6);
    --cell-inset-hover: rgba(255, 255, 255, 0.8);
    --tagline-shadow:   0 0 24px rgba(255, 220, 120, 0.6);
  
    /* gilt edges — deeper than buttery-gold bg so they actually read */
    --gilt-edge-1:       #6b3a00;
    --gilt-edge-2:       #b06820;
    --gilt-edge-3:       #f0a830;
    --sheen-highlight-1: rgba(255, 250, 220, 0.55);
    --sheen-highlight-2: rgba(255, 255, 255, 0.7);
  }
  
  
  /* ── Reset ── */
  *, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  
  & {
    font-family: -apple-system, "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
    color: var(--fg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    position: relative;
    overflow-x: hidden;
    /* opulent base — top-down lighting on a gilt surface */
    background:
      radial-gradient(ellipse 120% 80% at 50% -10%,
        color-mix(in oklch, var(--bg) 70%, white) 0%,
        var(--bg) 35%,
        var(--bg-deep) 100%);
  }
  
  /* radial spotlight glow above content */
  &::before {
    content: "";
    position: absolute;
    top: var(--spotlight-top);
    left: 50%;
    transform: translateX(-50%);
    width: var(--spotlight-size);
    height: var(--spotlight-size);
    background: radial-gradient(circle, var(--glow) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
    mix-blend-mode: var(--spotlight-blend);
  }
  
  /* film grain — adds material weight so the gold reads as foil, not paint */
  &::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: var(--grain);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    mix-blend-mode: multiply;
  }
  
  /* corner vignette — frames the content, deepens the gold at the edges */
  .vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
      radial-gradient(ellipse 100% 60% at 50% 100%, var(--vignette) 0%, transparent 60%),
      radial-gradient(ellipse 80% 60% at 0% 50%, var(--vignette) 0%, transparent 50%),
      radial-gradient(ellipse 80% 60% at 100% 50%, var(--vignette) 0%, transparent 50%);
  }
  
  /* ── Layout ── */
  .calculon {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
  }
  
  /* ── Hero ── */
  .hero {
    text-align: center;
    padding-bottom: 0.5rem;
  }
  
  .logo-wrap {
    display: inline-block;
    margin-bottom: 1rem;
    position: relative;
  }
  
  /* gilt frame around logo — jewelry-store framing */
  .logo-wrap::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: calc(1.5rem + 6px);
    background: linear-gradient(135deg,
      rgba(255, 240, 180, 0.7) 0%,
      rgba(200, 140, 30, 0.3) 40%,
      rgba(140, 90, 10, 0.5) 100%);
    filter: blur(6px);
    opacity: var(--gilt-opacity);
    z-index: -1;
  }
  
  .logo {
    width: 7.5rem;
    height: 7.5rem;
    border-radius: 1.5rem;
    filter:
      drop-shadow(0 6px 20px rgba(140, 80, 0, 0.35))
      drop-shadow(0 2px 4px rgba(80, 40, 0, 0.25));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  
  @media (prefers-color-scheme: dark) {
    .logo {
      filter: drop-shadow(0 4px 16px rgba(240, 168, 0, 0.3));
    }
  }
  
  .logo:hover {
    transform: scale(1.06) rotate(-2deg);
  }
  
  h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
    color: var(--fg);
  }
  
  .about p:first-child {
    font-size: 1.125rem;
    font-weight: 500;
    font-style: italic;
    color: var(--fg);
    margin-top: 0.5rem;
    line-height: 1.4;
    text-shadow: var(--tagline-shadow);
  }
  
  .about p + p {
    font-size: 0.9375rem;
    color: var(--fg-muted);
    margin-top: 0.5rem;
    line-height: 1.5;
  }
  
  
  /* ── Bento grid ── */
  .bento {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    width: 100%;
  }
  
  /* ── Cell (standard card) ── */
  .cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    color: var(--fg);
    text-decoration: none;
    transition:
      transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
      box-shadow 0.25s ease,
      background 0.2s ease,
      border-color 0.2s ease;
    box-shadow:
      0 1px 0 var(--cell-inset) inset,
      0 1px 4px var(--shadow),
      0 8px 24px -12px var(--shadow);
    position: relative;
    overflow: hidden;
  }
  
  .cell:hover {
    transform: translateY(-3px);
    box-shadow:
      0 1px 0 var(--cell-inset-hover) inset,
      0 12px 36px var(--shadow-hover),
      0 0 0 1px var(--border-strong);
    background: var(--bg-card-hover);
  }
  
  .cell:active {
    transform: translateY(-1px) scale(0.99);
  }
  
  .cell-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    background: var(--icon-bg);
    color: var(--icon-fg);
  }
  
  .cell-icon svg {
    width: 1.125rem;
    height: 1.125rem;
  }
  
  .cell-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  
  .cell-label {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
  }
  
  .cell-sub {
    font-size: 0.75rem;
    color: var(--fg-subtle);
    line-height: 1.3;
    margin-top: 0.125rem;
  }
  
  /* ── Shiny cell (gilt-edged, animated sheen) ── */
  .cell.shiny {
    grid-column: 1 / -1;
    padding: 1.25rem 1.25rem;
    background:
      linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
      conic-gradient(
        from 215deg,
        var(--gilt-edge-1) 0%,
        var(--gilt-edge-2) 18%,
        var(--gilt-edge-3) 32%,
        var(--gilt-edge-1) 50%,
        var(--gilt-edge-3) 68%,
        var(--gilt-edge-2) 82%,
        var(--gilt-edge-1) 100%
      ) border-box;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    box-shadow:
      0 4px 18px var(--shadow),
      0 0 0 1px rgba(255, 216, 74, 0.18);
  }
  
  .cell.shiny::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      115deg,
      transparent 35%,
      var(--sheen-highlight-1) 47%,
      var(--sheen-highlight-2) 50%,
      var(--sheen-highlight-1) 53%,
      transparent 65%
    );
    background-size: 250% 100%;
    background-position: 100% 0;
    pointer-events: none;
    z-index: 1;
    animation: legendary-sheen 5s ease-in-out infinite;
  }
  
  .cell.shiny > * {
    position: relative;
    z-index: 2;
  }
  
  .cell.shiny .cell-icon {
    background: rgba(140, 80, 0, 0.14);
    color: var(--gilt-edge-1);
  }
  
  @media (prefers-color-scheme: dark) {
    .cell.shiny .cell-icon {
      background: rgba(240, 168, 0, 0.16);
      color: var(--gold-300);
    }
  }
  
  .cell.shiny .cell-label {
    background: linear-gradient(
      135deg,
      var(--gilt-edge-1),
      var(--gilt-edge-3),
      var(--gilt-edge-1)
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
  }
  
  .cell.shiny .cell-sub {
    color: var(--fg-muted);
  }
  
  .cell.shiny .cell-arrow {
    display: flex;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
    color: var(--gilt-edge-1);
    opacity: 0.7;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  
  .cell.shiny .cell-arrow svg {
    width: 1.25rem;
    height: 1.25rem;
  }
  
  .cell.shiny:hover {
    transform: translateY(-3px);
    box-shadow:
      0 14px 40px rgba(240, 168, 0, 0.28),
      0 0 0 1px rgba(255, 216, 74, 0.4);
  }
  
  .cell.shiny:hover .cell-arrow {
    transform: translateX(3px);
    opacity: 1;
  }
  
  @media (prefers-color-scheme: dark) {
    .cell.shiny .cell-arrow {
      color: var(--gold-300);
    }
  }
  
  @media (prefers-reduced-motion: reduce) {
    .cell.shiny::before {
      animation: none;
    }
  }
  
  /* ── Featured cell — light: polished gilt panel; dark: espresso ── */
  .cell.featured {
    padding: 1.25rem 1.25rem;
    /* polished-gold panel with conic gilt rim */
    background:
      linear-gradient(135deg,
        #f4dca0 0%,
        #fff2c8 25%,
        #e8b95a 55%,
        #fff2c8 75%,
        #d49d35 100%) padding-box,
      conic-gradient(
        from 215deg,
        var(--gilt-edge-1) 0%,
        var(--gilt-edge-2) 25%,
        var(--gilt-edge-3) 50%,
        var(--gilt-edge-2) 75%,
        var(--gilt-edge-1) 100%
      ) border-box;
    border: 2px solid transparent;
    color: var(--fg);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.7) inset,
      0 10px 28px rgba(180, 110, 0, 0.30),
      0 0 0 1px rgba(255, 220, 120, 0.35);
  }
  
  /* sweeping sheen — strong enough to read on the light gilt panel */
  .cell.featured::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      115deg,
      transparent 35%,
      var(--sheen-highlight-1) 47%,
      var(--sheen-highlight-2) 50%,
      var(--sheen-highlight-1) 53%,
      transparent 65%
    );
    background-size: 250% 100%;
    background-position: 100% 0;
    pointer-events: none;
    z-index: 1;
    animation: legendary-sheen 5s ease-in-out infinite;
  }
  
  .cell.featured > * {
    position: relative;
    z-index: 2;
  }
  
  .cell.featured:hover {
    transform: translateY(-3px);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.9) inset,
      0 18px 44px rgba(180, 110, 0, 0.40),
      0 0 0 1px rgba(255, 220, 120, 0.55);
  }
  
  .cell.featured .cell-label {
    color: var(--fg);
    font-weight: 700;
  }
  
  .cell.featured .cell-icon {
    background: rgba(80, 40, 0, 0.18);
    color: #4a2800;
  }
  
  .cell.featured .cell-sub {
    color: var(--fg-muted);
  }
  
  .cell.featured .cell-arrow {
    color: var(--accent);
    opacity: 0.85;
  }
  
  @media (prefers-reduced-motion: reduce) {
    .cell.featured::before { animation: none; }
  }
  
  /* Dark mode: restore the original opulent espresso treatment */
  @media (prefers-color-scheme: dark) {
    .cell.featured {
      background:
        linear-gradient(135deg, #1a1508 0%, #2c2510 40%, #1a1508 100%);
      border: 1px solid rgba(212, 185, 100, 0.4);
      color: #e8d48a;
      isolation: auto;
      box-shadow:
        0 1px 0 rgba(212, 185, 100, 0.18) inset,
        0 8px 24px rgba(60, 35, 0, 0.25),
        0 0 0 1px rgba(212, 185, 100, 0.08);
    }
  
    /* diagonal catch-light, no animation */
    .cell.featured::before {
      inset: auto;
      top: -60%;
      right: -30%;
      width: 70%;
      height: 220%;
      background: linear-gradient(
        125deg,
        transparent 30%,
        rgba(220, 200, 130, 0.07) 45%,
        rgba(255, 240, 180, 0.10) 50%,
        rgba(220, 200, 130, 0.07) 55%,
        transparent 70%
      );
      background-size: auto;
      background-position: 0 0;
      animation: none;
    }
  
    .cell.featured::after {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: inherit;
      background:
        radial-gradient(ellipse at 15% 50%, rgba(200, 175, 90, 0.06) 0%, transparent 55%);
      pointer-events: none;
    }
  
    .cell.featured:hover {
      transform: translateY(-3px);
      background:
        linear-gradient(135deg, #222010 0%, #363014 40%, #222010 100%);
      border-color: rgba(212, 185, 100, 0.55);
      box-shadow:
        0 1px 0 rgba(212, 185, 100, 0.28) inset,
        0 16px 44px rgba(60, 35, 0, 0.35),
        0 0 0 1px rgba(212, 185, 100, 0.15);
    }
  
    .cell.featured .cell-label { color: #f0e4b8; }
    .cell.featured .cell-icon  { background: rgba(200, 175, 90, 0.12); color: #d4b964; }
    .cell.featured .cell-sub   { color: rgba(212, 185, 100, 0.5); }
    .cell.featured .cell-arrow { color: inherit; opacity: 0.6; }
  }
  
  .cell-arrow {
    display: flex;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
    opacity: 0.6;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  
  .cell-arrow svg {
    width: 1.25rem;
    height: 1.25rem;
  }
  
  .cell.featured:hover .cell-arrow {
    transform: translateX(3px);
    opacity: 1;
  }
  
  /* ── Social row ── */
  .socials {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .social {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--fg-muted);
    text-decoration: none;
    transition:
      transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
      box-shadow 0.25s ease,
      color 0.2s ease,
      border-color 0.2s ease,
      background 0.2s ease;
    box-shadow:
      0 1px 0 var(--cell-inset) inset,
      0 1px 4px var(--shadow);
  }
  
  .social svg {
    width: 1.25rem;
    height: 1.25rem;
  }
  
  .social:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 8px 24px var(--shadow-hover);
    color: var(--accent);
    border-color: var(--border-strong);
    background: var(--bg-card-hover);
  }
  
  .social:active {
    transform: translateY(0) scale(0.95);
  }
  
  /* ── Footer ── */
  .site-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    opacity: 0.5;
  }
  
  .site-name {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-subtle);
  }
  
  .site-by {
    font-size: 0.6875rem;
    color: var(--fg-subtle);
    font-style: italic;
  }
  
  .site-author {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--fg-subtle);
  }
  
  /* ── Responsive ── */
  @media (max-width: 420px) {
    .logo {
      width: 6rem;
      height: 6rem;
      border-radius: 1.125rem;
    }
  
    h1 {
      font-size: 1.5rem;
    }
  
    .bento {
      gap: 0.625rem;
    }
  
    .cell {
      padding: 1rem 0.875rem;
    }
  }
  
  /* ── Universe page ── */
  .calculon.techverse {
    max-width: min(1100px, 100%);
    align-items: stretch;
    gap: 1.5rem;
  }
  
  .back-link {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--fg-muted);
    text-decoration: none;
    padding: 0.4rem 0.7rem 0.4rem 0.5rem;
    border-radius: 0.5rem;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  }
  
  .back-link:hover {
    color: var(--accent);
    background: var(--bg-card);
    transform: translateX(-2px);
  }
  
  .back-arrow {
    display: inline-flex;
    transform: rotate(180deg);
  }
  
  .back-arrow svg {
    width: 1rem;
    height: 1rem;
  }
  
  .techverse-hero {
    text-align: center;
    padding: 0 0.5rem;
  }
  
  .techverse-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    letter-spacing: -0.02em;
    background: linear-gradient(
      135deg,
      var(--gilt-edge-1) 0%,
      var(--gilt-edge-3) 50%,
      var(--gilt-edge-1) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 12px var(--glow));
  }
  
  .techverse-hero .about p {
    font-size: 0.9375rem;
    color: var(--fg-muted);
    max-width: 520px;
    margin: 0.75rem auto 0;
    line-height: 1.55;
  }
  
  /* ── Card rail (horizontal scroll) ── */
  .card-rail {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 1.25rem 0.5rem 2rem;
    margin-inline: -0.5rem;
    scroll-padding-inline: 0.5rem;
    scrollbar-color: var(--gold-600) transparent;
    -webkit-overflow-scrolling: touch;
  }
  
  .card-rail:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 0.75rem;
  }
  
  .card-rail::-webkit-scrollbar {
    height: 8px;
  }
  
  .card-rail::-webkit-scrollbar-track {
    background: transparent;
  }
  
  .card-rail::-webkit-scrollbar-thumb {
    background: var(--gold-600);
    border-radius: 4px;
  }
  
  .card-rail::-webkit-scrollbar-thumb:hover {
    background: var(--gold-500);
  }
  
  /* ── Trading card ── */
  .trading-card {
    flex: 0 0 290px;
    min-height: 470px;
    scroll-snap-align: start;
    position: relative;
    border-radius: 1rem;
    text-decoration: none;
    color: var(--fg);
    transition:
      transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
      box-shadow 0.25s ease;
    isolation: isolate;
    /* gilt edge: gradient border via padding-box / border-box layering */
    background:
      linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
      linear-gradient(135deg,
        var(--gilt-edge-1),
        var(--gilt-edge-2),
        var(--gilt-edge-1)) border-box;
    border: 2px solid transparent;
    box-shadow: 0 4px 16px var(--shadow);
  }
  
  .trading-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px var(--shadow-hover);
  }
  
  .trading-card:active {
    transform: translateY(-2px) scale(0.99);
  }
  
  .card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: inherit;
    padding: 1rem 1.1rem 1.1rem;
    gap: 0.85rem;
    border-radius: calc(1rem - 2px);
    background: var(--bg-card);
    position: relative;
    overflow: hidden;
  }
  
  .card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.6rem;
    /* leave room for the absolutely-positioned .card-meta overlay */
    padding-right: 6.5rem;
    position: relative;
    z-index: 2;
  }
  
  .card-name {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--fg);
  }
  
  /* Top-right overlay carrying the octocat + rarity. Positioned outside
     the card-header so the octocat sits in the same stacking context as
     the stretched link and can be raised above it. */
  .card-meta {
    position: absolute;
    top: 1.05rem;
    right: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    z-index: 4;
  }
  
  .card-rarity {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 600;
    color: var(--fg-subtle);
    white-space: nowrap;
    /* let clicks on the rarity badge fall through to the stretched link */
    pointer-events: none;
  }
  
  /* Octocat link — sits above the stretched-link overlay so it
     navigates to the repo separately. */
  .card-repo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 0.45rem;
    color: var(--fg-muted);
    text-decoration: none;
    position: relative;
    z-index: 4;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  }
  
  .card-repo svg {
    width: 1rem;
    height: 1rem;
  }
  
  .card-repo:hover {
    color: var(--fg);
    background: rgba(80, 50, 0, 0.10);
    transform: scale(1.08);
  }
  
  @media (prefers-color-scheme: dark) {
    .card-repo:hover {
      background: rgba(240, 168, 0, 0.12);
      color: var(--gold-300);
    }
  }
  
  /* Stretched-link overlay — makes the whole article navigate to .url
     while leaving the octocat (z-index 4) clickable on its own. */
  .card-stretched-link {
    position: absolute;
    inset: 0;
    z-index: 3;
    border-radius: inherit;
  }
  
  .card-stretched-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
  }
  
  .card-art {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 110px;
    border-radius: 0.5rem;
    background:
      radial-gradient(ellipse at center, #e5dec9, transparent 65%),
      repeating-linear-gradient(
        45deg,
        transparent 0,
        transparent 8px,
        rgba(197, 160, 89, 0.04) 8px,
        rgba(197, 160, 89, 0.04) 9px
      );
    position: relative;
    overflow: hidden;
    z-index: 2;
  }
  
  @media (prefers-color-scheme: dark) {
    .card-art {
      background:
        radial-gradient(ellipse at center, rgba(200, 120, 0, 0.20), transparent 65%),
        repeating-linear-gradient(
          45deg,
          transparent 0,
          transparent 8px,
          rgba(240, 168, 0, 0.06) 8px,
          rgba(240, 168, 0, 0.06) 9px
        );
    }
  }
  
  .card-logo {
    width: 78%;
    height: 80%;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.18));
  }
  
  .card-monogram {
    font-size: 4.5rem;
    font-weight: 800;
    font-family: ui-serif, "Times New Roman", serif;
    font-style: italic;
    background: linear-gradient(
      135deg,
      var(--gilt-edge-3) 0%,
      var(--gilt-edge-1) 50%,
      var(--gilt-edge-3) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(120, 70, 0, 0.3));
    line-height: 1;
  }
  
  .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    position: relative;
    z-index: 2;
  }
  
  .card-tagline {
    font-size: 0.875rem;
    font-weight: 600;
    font-style: italic;
    color: var(--fg);
    line-height: 1.35;
  }
  
  .card-desc {
    font-size: 0.8125rem;
    color: var(--fg-muted);
    line-height: 1.5;
  }
  
  .card-footer {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: auto;
    padding-top: 0.7rem;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 2;
  }
  
  .card-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
  }
  
  .card-chip {
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.18rem 0.5rem;
    background: rgba(140, 80, 0, 0.12);
    color: var(--gilt-edge-1);
    border-radius: 0.3rem;
  }
  
  @media (prefers-color-scheme: dark) {
    .card-chip {
      background: rgba(200, 120, 0, 0.15);
      color: var(--gold-300);
    }
  }
  
  .card-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }
  
  .card-category {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--fg-subtle);
    font-weight: 600;
  }
  
  .card-action {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
  }
  
  .card-action svg {
    width: 0.9rem;
    height: 0.9rem;
    transition: transform 0.2s ease;
  }
  
  .trading-card:hover .card-action svg {
    transform: translateX(3px);
  }
  
  /* ── Rarity: Rare ── */
  .trading-card.rarity-rare {
    background:
      linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
      linear-gradient(135deg,
        var(--gilt-edge-3) 0%,
        var(--gilt-edge-1) 50%,
        var(--gilt-edge-3) 100%
      ) border-box;
    border-width: 2px;
    box-shadow:
      0 4px 18px var(--shadow),
      0 0 0 1px rgba(255, 216, 74, 0.18);
  }
  
  .trading-card.rarity-rare .card-rarity {
    color: var(--gilt-edge-1);
  }
  
  @media (prefers-color-scheme: dark) {
    .trading-card.rarity-rare .card-rarity {
      color: var(--gold-300);
    }
  }
  
  .trading-card.rarity-rare:hover {
    box-shadow:
      0 16px 44px rgba(240, 168, 0, 0.22),
      0 0 0 1px rgba(255, 216, 74, 0.32);
  }
  
  /* ── Rarity: Legendary ── */
  .trading-card.rarity-legendary {
    background:
      linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
      conic-gradient(
        from 215deg,
        var(--gilt-edge-1) 0%,
        var(--gilt-edge-2) 18%,
        var(--gilt-edge-3) 32%,
        var(--gilt-edge-1) 50%,
        var(--gilt-edge-3) 68%,
        var(--gilt-edge-2) 82%,
        var(--gilt-edge-1) 100%
      ) border-box;
    border-width: 3px;
    box-shadow:
      0 6px 28px rgba(240, 168, 0, 0.28),
      0 0 0 1px rgba(255, 216, 74, 0.25);
  }
  
  .trading-card.rarity-legendary .card-rarity {
    color: var(--gilt-edge-1);
    font-weight: 700;
    letter-spacing: 0.18em;
  }
  
  @media (prefers-color-scheme: dark) {
    .trading-card.rarity-legendary .card-rarity {
      color: var(--gold-300);
    }
  }
  
  .trading-card.rarity-legendary .card-name {
    background: linear-gradient(
      135deg,
      var(--gilt-edge-1),
      var(--gilt-edge-3),
      var(--gilt-edge-1)
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  
  /* holographic sweeping sheen */
  .trading-card.rarity-legendary .card-inner::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      115deg,
      transparent 35%,
      var(--sheen-highlight-1) 47%,
      var(--sheen-highlight-2) 50%,
      var(--sheen-highlight-1) 53%,
      transparent 65%
    );
    background-size: 250% 100%;
    background-position: 100% 0;
    pointer-events: none;
    z-index: 1;
    animation: legendary-sheen 5s ease-in-out infinite;
  }
  
  
  .trading-card.rarity-legendary:hover {
    box-shadow:
      0 20px 60px rgba(240, 168, 0, 0.4),
      0 0 0 1px rgba(255, 216, 74, 0.45);
  }
  
  @media (prefers-reduced-motion: reduce) {
    .trading-card.rarity-legendary .card-inner::before {
      animation: none;
    }
  }
  
  /* ── Card-rail responsive ── */
  @media (max-width: 600px) {
    .trading-card {
      flex: 0 0 86vw;
      max-width: 320px;
    }
  
    .card-rail {
      scroll-snap-type: x mandatory;
    }
  }
  
  /* ── Legal pages (privacy, terms) ── */
  .calculon.legal {
    max-width: min(720px, 100%);
    align-items: stretch;
    gap: 1.5rem;
  }
  
  .legal-doc {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem clamp(1.25rem, 4vw, 2.5rem);
    box-shadow: 0 1px 3px var(--shadow);
  }
  
  .legal-head {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .legal-head h1 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    letter-spacing: -0.02em;
  }
  
  .legal-effective {
    margin-top: 0.4rem;
    font-size: 0.8125rem;
    color: var(--fg-subtle);
    font-style: italic;
  }
  
  .prose {
    color: var(--fg-muted);
    font-size: 0.9375rem;
    line-height: 1.65;
  }
  
  .prose h2 {
    font-size: 1.1875rem;
    font-weight: 600;
    color: var(--fg);
    letter-spacing: -0.01em;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
  }
  
  .prose p {
    margin-top: 0.75rem;
  }
  
  .prose ul {
    margin-top: 0.75rem;
    padding-left: 1.25rem;
    list-style: disc;
  }
  
  .prose li {
    margin-top: 0.35rem;
  }
  
  .prose strong {
    color: var(--fg);
    font-weight: 600;
  }
  
  .prose a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
  }
  
  .prose a:hover {
    color: var(--accent-hover);
  }
  
  /* ── Footer legal links ── */
  .footer-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
  }
  
  .footer-links a {
    font-size: 0.75rem;
    color: var(--fg-subtle);
    text-decoration: none;
    transition: color 0.2s ease;
  }
  
  .footer-links a:hover {
    color: var(--accent);
  }
  
  .footer-links .sep {
    color: var(--fg-subtle);
    opacity: 0.5;
  }

  /* Forgejo's .page-content gives the body margins; the landing page brings its
     own and stacks its sections. */
  & {
    flex-direction: column;
    gap: var(--calculon-gap);
    overflow: hidden;
  }
  & .calculon.techverse,
  & .calculon.now {
    max-width: min(1100px, 100%);
  }
  & .now-hero {
    text-align: center;
  }
  & .now-hero h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--fg);
  }
  & .now-hero p {
    color: var(--fg-muted);
    font-size: 0.95rem;
    margin-top: 0.35rem;
  }
  & .now-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
    width: 100%;
  }
  & .now-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem 1.125rem;
    border-radius: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: 0 2px 12px var(--shadow), inset 0 1px 0 var(--cell-inset);
    color: var(--fg);
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  }
  & .now-card:hover {
    transform: translateY(-2px);
    background: var(--bg-card-hover);
    box-shadow: 0 8px 24px var(--shadow-hover), inset 0 1px 0 var(--cell-inset-hover);
  }
  & .now-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--accent);
  }
  & .now-desc {
    font-size: 0.85rem;
    color: var(--fg-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  & .now-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--fg-subtle);
    margin-top: auto;
  }
  & .now-empty {
    grid-column: 1 / -1;
    color: var(--fg-subtle);
    font-size: 0.9rem;
    text-align: center;
  }
}

@keyframes legendary-sheen {
  0%, 100% { background-position: 200% 0; }
  50%      { background-position: -100% 0; }
}

/* Dark palette. Two triggers: the system preference while Forgejo's theme is
   "auto" (its default), and an explicit dark theme, which the picker can
   force regardless of the system. Top-level rules on purpose: a nested rule
   with a selector before the ampersand (html[...] &) misparses in Chromium
   and leaks layout onto the whole page. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="forgejo-light"]):not([data-theme="gitea-light"]) .calculon-home {
      --bg:            #0c0906;
      --bg-deep:        #0c0906;
      --bg-card:       #18120a;
      --bg-card-hover: #201810;
      --fg:            #f0e4d0;
      --fg-muted:      #c8a868;
      --fg-subtle:     #907848;
      --accent:        var(--gold-500);
      --accent-hover:  var(--gold-300);
      --border:        rgba(200, 120, 0, 0.10);
      --border-strong: rgba(200, 120, 0, 0.30);
      --shadow:        rgba(0, 0, 0, 0.25);
      --shadow-hover:  rgba(240, 168, 0, 0.12);
      --glow:          rgba(255, 216, 74, 0.15);
      --grain:         0;
      --vignette:      transparent;
      --icon-bg:       rgba(200, 120, 0, 0.15);
      --icon-fg:       var(--gold-500);
      --gilt-opacity:  0;
      --spotlight-size: 600px;
      --spotlight-top: -20%;
      --spotlight-blend: normal;
      --cell-inset:        rgba(255, 255, 255, 0);
      --cell-inset-hover:  rgba(255, 255, 255, 0);
      --tagline-shadow:    0 0 20px var(--glow), 0 0 40px var(--glow);
  
      /* dark mode keeps the brighter logo-palette golds */
      --gilt-edge-1:       var(--gold-700);
      --gilt-edge-2:       var(--gold-500);
      --gilt-edge-3:       var(--gold-300);
      --sheen-highlight-1: rgba(255, 240, 180, 0.18);
      --sheen-highlight-2: rgba(255, 255, 255, 0.12);
  }
}

:root[data-theme="forgejo-dark"] .calculon-home,
:root[data-theme="gitea-dark"] .calculon-home {
    --bg:            #0c0906;
    --bg-deep:        #0c0906;
    --bg-card:       #18120a;
    --bg-card-hover: #201810;
    --fg:            #f0e4d0;
    --fg-muted:      #c8a868;
    --fg-subtle:     #907848;
    --accent:        var(--gold-500);
    --accent-hover:  var(--gold-300);
    --border:        rgba(200, 120, 0, 0.10);
    --border-strong: rgba(200, 120, 0, 0.30);
    --shadow:        rgba(0, 0, 0, 0.25);
    --shadow-hover:  rgba(240, 168, 0, 0.12);
    --glow:          rgba(255, 216, 74, 0.15);
    --grain:         0;
    --vignette:      transparent;
    --icon-bg:       rgba(200, 120, 0, 0.15);
    --icon-fg:       var(--gold-500);
    --gilt-opacity:  0;
    --spotlight-size: 600px;
    --spotlight-top: -20%;
    --spotlight-blend: normal;
    --cell-inset:        rgba(255, 255, 255, 0);
    --cell-inset-hover:  rgba(255, 255, 255, 0);
    --tagline-shadow:    0 0 20px var(--glow), 0 0 40px var(--glow);

    /* dark mode keeps the brighter logo-palette golds */
    --gilt-edge-1:       var(--gold-700);
    --gilt-edge-2:       var(--gold-500);
    --gilt-edge-3:       var(--gold-300);
    --sheen-highlight-1: rgba(255, 240, 180, 0.18);
    --sheen-highlight-2: rgba(255, 255, 255, 0.12);
}
