/* ==========================================================================
   Ferhad Hub — design system
   --------------------------------------------------------------------------
   Direction: a printed catalogue, not a product landing page. Warm paper,
   black editorial type, hairline rules, numbered index rows, one cobalt
   accent. No cards, no glass, no glow, no gradients — the structure is the
   decoration.

   Every colour, size, radius and duration is defined once, here.
   ========================================================================== */

@import '/tema.css';

/* ----------------------------------------------------------------- tokens */
/* Bütün rənglər /tema.css-dən gəlir — burada yalnız yerli adlara bağlanır.
   Rəng dəyişmək lazım olsa, tema.css-də dəyişir, hər sayta tətbiq olunur. */
:root {
  --paper: var(--t-bg);
  --paper-sunk: var(--t-sunk);
  --paper-ink: var(--t-fg);

  --ink: var(--t-fg);
  --ink-muted: var(--t-fg-2);
  --ink-faint: var(--t-fg-3);

  --rule: var(--t-line);
  --rule-strong: var(--t-line-2);

  --accent: var(--t-ac);
  --accent-deep: var(--t-ac-hi);
  --accent-wash: var(--t-ac-wash);

  /* Type */
  --font-display: var(--t-display);
  --font-ui: var(--t-ui);

  --step-hero: clamp(2.6rem, 1.2rem + 6vw, 6.5rem);
  --step-h2: clamp(1.5rem, 1.1rem + 1.8vw, 2.4rem);
  --step-h3: clamp(1.125rem, 1rem + 0.55vw, 1.4rem);
  --step-body: 1rem;
  --step-small: 0.8125rem;
  --step-label: 0.6875rem;

  /* Space — 4px base */
  --gutter: 1.25rem;
  --section-gap: clamp(3.5rem, 2.5rem + 4vw, 6rem);

  /* Form & motion */
  --radius: 2px;
  --radius-pill: 999px;
  --dur-fast: 130ms;
  --dur: 200ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (min-width: 48rem) {
  :root {
    --gutter: 2.5rem;
  }
}
@media (min-width: 75rem) {
  :root {
    --gutter: 3.5rem;
  }
}

/* ------------------------------------------------------------------ base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--step-body);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}
ul,
ol {
  list-style: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: color-mix(in srgb, var(--accent) 18%, transparent);
}

img,
svg {
  display: block;
  max-width: 100%;
}

::selection {
  background: var(--accent);
  color: var(--paper);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius);
}

/* Yüngül film dənəsi — statik, animasiya yoxdur, kadr xərci sıfırdır */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 1.125rem;
  background: var(--accent);
  color: var(--paper);
  font-family: var(--font-ui);
  font-size: var(--step-small);
  font-weight: 600;
  transform: translateY(-250%);
  transition: transform var(--dur-fast) var(--ease);
}
.skip-link:focus {
  transform: none;
}

/* ---------------------------------------------------------------- layout */
.shell {
  width: 100%;
  max-width: 78rem;
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
  position: relative;
  z-index: 1;
}

/* ---------------------------------------------------------------- header */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 4rem;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 100%;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.wordmark b {
  font-weight: 700;
}
.wordmark span {
  font-family: var(--font-ui);
  font-size: var(--step-label);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.mast-nav {
  display: none;
  gap: 1.75rem;
}
@media (min-width: 48rem) {
  .mast-nav {
    display: flex;
  }
}
.mast-nav a {
  font-size: var(--step-small);
  font-weight: 500;
  color: var(--ink-muted);
  padding-block: 0.5rem;
  transition: color var(--dur-fast) var(--ease);
}
.mast-nav a:hover {
  color: var(--ink);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.25rem;
  font-size: var(--step-small);
  font-weight: 500;
  color: var(--ink-muted);
  transition: color var(--dur-fast) var(--ease);
}
.back-link:hover {
  color: var(--accent);
}

/* ------------------------------------------------------------------ hero */
.hero {
  padding-block: clamp(3rem, 2rem + 6vw, 7rem) clamp(2.5rem, 2rem + 3vw, 4rem);
}
.hero__eyebrow {
  font-size: var(--step-label);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero__title {
  margin-top: 1.25rem;
  font-family: var(--font-display);
  font-size: var(--step-hero);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.025em;
  text-wrap: balance;
  max-width: 16ch;
}
.hero__title em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}
.hero__lead {
  margin-top: 1.5rem;
  max-width: 46ch;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem);
  color: var(--ink-muted);
  text-wrap: pretty;
}

/* Counts read as a printed colophon line, not as stat cards */
.tally {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: var(--step-small);
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.tally b {
  color: var(--ink);
  font-weight: 600;
}

/* ---------------------------------------------------------------- portal
   Ana səhifə bölmə seçimidir: dörd giriş, hər biri öz səhifəsinə aparır.
   Elementlərin siyahısı ana səhifədə deyil — beləliklə geri qayıdanda adam
   həmişə eyni qısa seçim ekranına düşür, siyahının ortasına yox.
   ------------------------------------------------------------------------ */
.portal__basliq {
  margin-top: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  margin-bottom: 1rem;
  font-family: var(--font-ui);
  font-size: var(--step-label);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.portal {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--rule);
  border-block: 1px solid var(--rule);
}
@media (min-width: 48rem) {
  .portal {
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--rule);
  }
}

.portal__item {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    'num ad'
    'num desc'
    'num meta';
  column-gap: 1.15rem;
  row-gap: 0.3rem;
  padding: 1.5rem 1.35rem;
  background: var(--paper);
  transition: background var(--dur-fast) var(--ease);
}
.portal__item:hover {
  background: var(--accent-wash);
}
.portal__item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.portal__num {
  grid-area: num;
  font-size: var(--step-label);
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.9;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.portal__ad {
  grid-area: ad;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.015em;
}
.portal__ox {
  color: var(--ink-faint);
  transition:
    transform var(--dur) var(--ease),
    color var(--dur-fast) var(--ease);
}
.portal__item:hover .portal__ox {
  transform: translateX(3px);
  color: var(--accent);
}
.portal__desc {
  grid-area: desc;
  font-size: var(--step-small);
  line-height: 1.55;
  color: var(--ink-muted);
  max-width: 34ch;
}
.portal__meta {
  grid-area: meta;
  margin-top: 0.35rem;
  font-size: var(--step-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------- section */
.section {
  padding-bottom: var(--section-gap);
}
.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule-strong);
}
.section__num {
  font-family: var(--font-ui);
  font-size: var(--step-label);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.section__title {
  font-family: var(--font-display);
  font-size: var(--step-h2);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.section__count {
  margin-left: auto;
  font-size: var(--step-small);
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------ index rows */
.items {
  display: block;
}

.item {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  gap: 0.25rem 0.875rem;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
@media (min-width: 60rem) {
  .item {
    grid-template-columns: 3rem minmax(0, 1fr) minmax(0, 16rem);
    align-items: start;
    gap: 2rem;
    padding-block: 1.75rem;
  }
}

/* Ordinal in the margin — the catalogue's spine */
.item__num {
  font-size: var(--step-small);
  font-weight: 600;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  padding-top: 0.2rem;
}

.item__body {
  min-width: 0;
}
.item__title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: var(--step-h3);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.item__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--dot, var(--accent));
  flex-shrink: 0;
}
.item__desc {
  margin-top: 0.4rem;
  max-width: 60ch;
  font-size: var(--step-small);
  line-height: 1.6;
  color: var(--ink-muted);
  text-wrap: pretty;
}

.item__actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.875rem;
}
@media (min-width: 60rem) {
  .item__actions {
    grid-column: 3;
    justify-content: flex-end;
    margin-top: 0;
  }
}

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding-inline: 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: var(--step-small);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}
.btn:active {
  transform: translateY(1px);
}

.btn--solid {
  background: var(--accent);
  color: var(--paper);
}
.btn--solid:hover {
  background: var(--accent-deep);
}

.btn--line {
  border-color: var(--rule-strong);
  color: var(--ink);
}
.btn--line:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Weight, not opacity, carries the hierarchy here — a faded label on the solid
   button drops below the 4.5:1 floor. */
.btn__meta {
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.5rem 0.15rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-pill);
  font-size: var(--step-label);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.chip--new {
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--accent-deep);
}

/* ---------------------------------------------------------------- footer */
.foot {
  border-top: 1px solid var(--rule-strong);
  padding-block: 2.5rem 3.5rem;
  font-size: var(--step-small);
  color: var(--ink-faint);
}
.foot__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  align-items: baseline;
  justify-content: space-between;
}
.foot a {
  color: var(--ink-muted);
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-color: var(--rule-strong);
}
.foot a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

/* ----------------------------------------------------------- entrance */
/* One quiet entrance on load. Nothing animates on scroll. */
@media (prefers-reduced-motion: no-preference) {
  .rise {
    animation: rise 520ms var(--ease) both;
    animation-delay: var(--delay, 0ms);
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translate3d(0, 0.75rem, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------- tema düyməsi
   Gecə / gündüz. Hərəkət ölçülüdür: yalnız rənglərin 220ms krossfeydi və
   ikonun öz yerində dəyişməsi — səhifədə heç nə sürüşmür, sıçramır.
   -------------------------------------------------------------------------- */
.mast-end {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.tema-duymesi {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  padding: 0;
  background: transparent;
  color: var(--ink-muted);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    background-color var(--dur-fast) var(--ease);
}
.tema-duymesi:hover {
  color: var(--ink);
  border-color: var(--rule-strong);
  background: var(--paper-sunk);
}
.tema-duymesi:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tema-duymesi svg {
  position: absolute;
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition:
    opacity var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}
/* Gecədə ay görünür, gündüzdə günəş. */
.tema-duymesi .ikon-gunes {
  opacity: 0;
  transform: rotate(-45deg) scale(0.7);
}
:root[data-tema='isiq'] .tema-duymesi .ikon-gunes {
  opacity: 1;
  transform: none;
}
:root[data-tema='isiq'] .tema-duymesi .ikon-ay {
  opacity: 0;
  transform: rotate(45deg) scale(0.7);
}

/* Rejim dəyişəndə rənglər bir dəfəlik yumşaq keçir; skript sinfi 240ms sonra
   silir ki, adi hover və scroll işi transition yükü daşımasın. */
.tema-kecid,
.tema-kecid *,
.tema-kecid *::before,
.tema-kecid *::after {
  transition:
    background-color 220ms var(--ease),
    border-color 220ms var(--ease),
    color 220ms var(--ease),
    fill 220ms var(--ease),
    outline-color 220ms var(--ease) !important;
}

@media (prefers-reduced-motion: reduce) {
  .tema-duymesi svg {
    transition: none;
  }
  .tema-kecid,
  .tema-kecid *,
  .tema-kecid *::before,
  .tema-kecid *::after {
    transition: none !important;
  }
}

/* Ana səhifə seçim ekranıdır — dörd giriş mümkün qədər tez görünsün deyə
   hero burada daha sıxdır. Alt səhifələrdə hero olduğu kimi qalır. */
.hero--portal {
  padding-block: clamp(2.25rem, 1.5rem + 3vw, 4rem) clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
}
.hero--portal .hero__title {
  font-size: clamp(2.4rem, 1.2rem + 4.6vw, 5rem);
}
.hero--portal .portal__basliq {
  margin-top: clamp(1.75rem, 1.25rem + 1.5vw, 2.5rem);
}
