/* TOINMAX — CLEAN BUILD (20260220) */

:root{
  --text: rgba(0,0,0,0.90);
  --muted: rgba(0,0,0,0.62);
  --border: rgba(0,0,0,0.10);
  --card: rgba(255,255,255,0.0);
  --shadow: 0 0 0 rgba(0,0,0,0);
  --radius: 18px;
  --maxw: 1100px;
  --pad: 20px;
  --topbar-h: 64px;

  /* HERO focus control (px, not %) — stable on real phones */
  --hero-shift-x: 0px;
}

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

html, body{
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  height: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* IMPORTANT: outside area must be black (no white strip on overscroll/padding) */
html{ background:#000; }

/* BODY is black — sections paint their own backgrounds */
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  color: var(--text);
  background:#000;
  touch-action: pan-y;
  position: relative;
}

::selection{ background: rgba(0,0,0,0.08); }

img, video, svg, canvas{
  max-width: 100%;
  height: auto;
}

/* =============================== */
/* TOP BAR                         */
/* =============================== */

/* Ask browser not to "repaint" UI into dark scheme */
:root{ color-scheme: light; }

.topbar{
  position: sticky;
  top: 0;
  z-index: 4000;
  height: var(--topbar-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 14px;

  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.topbar-right{
  justify-self: end;
  display:flex;
  gap: 8px;
}

.icon-btn{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.08);
  background: transparent;
  display:grid;
  place-items:center;
  cursor:pointer;
  color: rgba(0,0,0,0.78);
}
.icon-btn:hover{ border-color: rgba(0,0,0,0.14); }

.icon{ width: 22px; height: 22px; }

.hamburger{
  width: 18px; height: 2px; background: currentColor;
  position: relative; display:block; border-radius: 2px;
}
.hamburger::before,.hamburger::after{
  content:""; position:absolute; left:0;
  width: 18px; height: 2px; background: currentColor; border-radius:2px;
}
.hamburger::before{ top: -6px; }
.hamburger::after{ top: 6px; }

.brand{
  justify-self: center;
  display:flex;
  align-items:center;
  text-decoration:none;
}
.brand-logo{
  height: 44px;
  width: auto;
  display:block;
}

/* =============================== */
/* DRAWER                          */
/* =============================== */
.drawer{
  position: fixed;
  inset: 0 auto 0 0;
  width: min(340px, 86vw);
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(0,0,0,0.08);
  transform: translateX(-102%);
  transition: transform 220ms ease;
  z-index: 12000;
}
.drawer.open{ transform: translateX(0); }

.drawer-head{
  display:flex; align-items:center; justify-content: space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.drawer-title{ font-weight: 700; }

.x{ width: 18px; height: 18px; position: relative; display:block; }
.x::before,.x::after{
  content:""; position:absolute; inset:0; margin:auto;
  width: 18px; height: 2px; background: currentColor; border-radius:2px;
}
.x::before{ transform: rotate(45deg); }
.x::after{ transform: rotate(-45deg); }

.drawer-nav{
  display:grid;
  padding: 10px 14px 14px;
  gap: 8px;
}
.drawer-nav a{
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.08);
  text-decoration:none;
  color: rgba(0,0,0,0.86);
}
.drawer-nav a:hover{ border-color: rgba(0,0,0,0.14); }

.backdrop{
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 11900;
}

/* =============================== */
/* LAYOUT / TYPOGRAPHY             */
/* =============================== */
.section{ padding: 54px 0; }
.container{ max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }

.two-col{
  display:grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
  align-items: start;
}
@media (max-width: 900px){ .two-col{ grid-template-columns: 1fr; } }

.section-head{
  display:flex; align-items: baseline; justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

h1,h2{ margin: 0 0 10px; }
h2{ font-size: clamp(22px, 2.6vw, 34px); letter-spacing: -0.02em; }

p{ margin: 0 0 10px; line-height: 1.55; }
.muted{ color: var(--muted); }

/* =============================== */
/* SCHEMES (sections paint bg)     */
/* =============================== */
.section-light{ background: #ffffff; }
.section-mid{ background: #f2f2f2; }

.section-dark{
  background: #000;
  color: rgba(255,255,255,0.92);
}
.section-dark .muted{ color: rgba(255,255,255,0.70); }
.section-dark .tm-card{ border-color: rgba(255,255,255,0.16); }
.section-dark .dark-card{ background: rgba(255,255,255,0.02); }

/* =============================== */
/* HERO — CLEAN STABLE VERSION     */
/* =============================== */

.hero{
  padding-top: 26px;
}

.hero-inner{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: grid;

  /* ДЕСКТОП: 2 колонки как в “эталоне” */
  grid-template-columns: 1.2fr 0.8fr;
  gap: 26px;
  align-items: center;
}

/* МОБИЛА/ПЛАНШЕТ: в 1 колонку */
@media (max-width: 900px){
  .hero-inner{ grid-template-columns: 1fr; }
}

.hero-title{
  font-size: clamp(36px, 4.2vw, 58px);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.hero-sub{
  font-size: 16px;
  max-width: 56ch;
}

/* IMAGE BLOCK */
.hero-art{
  border-radius: var(--radius);
  overflow: hidden;
  background: #e6e6e6;
  aspect-ratio: 16 / 10;
}

/* IMAGE */
.hero-img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
}

/* =============================== */
/* BUTTONS / CARDS                 */
/* =============================== */
.btn{
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.12);
  text-decoration:none;
  color: rgba(0,0,0,0.90);
  font-weight: 700;
}
.btn:hover{ border-color: rgba(0,0,0,0.18); }
.btn.ghost{ background: transparent; }

.tm-card{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.card{ padding: 18px; }
.card-title{ font-weight: 800; margin-bottom: 10px; }
.list{ margin: 0; padding-left: 18px; line-height: 1.6; }

.grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
@media (max-width: 1020px){ .grid{ grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px){ .grid{ grid-template-columns: repeat(2, 1fr); } }

.tile{
  text-decoration:none;
  color: inherit;
  overflow: hidden;
  display:grid;
  border-radius: var(--radius);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}
@media (hover:hover){
  .tile:hover{
    transform: translateY(-6px);
    box-shadow: 0 18px 42px rgba(0,0,0,0.08);
    border-color: rgba(0,0,0,0.14);
  }
}

.tile-img{
  height: 260px;
  background-color: #e9e9e9;
}
@media (max-width: 720px){ .tile-img{ height: 200px; } }

.tile-img img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.tile-meta{
  padding: 14px 14px 16px;
  display:flex;
  justify-content: space-between;
  gap: 10px;
}
.tile-title{ font-weight: 800; }
.tile-sub{ white-space: nowrap; }

.stats{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.stat{ border: 1px solid var(--border); border-radius: 16px; padding: 12px; }
.stat-n{ font-weight: 900; font-size: 20px; }
.stat-t{ color: var(--muted); font-size: 12px; }

.footer-mini{ padding: 18px 0 0; text-align: center; }

/* =============================== */
/* HAIRLINE                        */
/* =============================== */
.hairline{
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 2px;
  background: #ffffff;
  opacity: 0.95;
  pointer-events: none;
  z-index: 3500;
  transform: translateY(-20px);
  will-change: transform;
  box-shadow:
    0 0 10px rgba(255,255,255,0.65),
    0 0 24px rgba(255,255,255,0.35);
  border-radius: 2px;
}
@media (prefers-reduced-motion: reduce){
  .hairline{ display:none; }
}

/* =============================== */
/* CERTIFICATES IMAGE              */
/* =============================== */
.auth{ padding: 16px; }
.auth-img{
  width: min(1100px, 100%);
  height: auto;
  display: block;
  margin: 0 auto;
}

/* =============================== */
/* BOTTOM NAV (TOUCH ONLY)         */
/* =============================== */
.tm-bottom-nav{
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 72px;
  background: #ffffff;
  z-index: 7000;

  /* no border => no “hair gap” line */
  border-top: none;
  box-shadow: 0 -1px 0 rgba(0,0,0,0.10);

  transform: translate3d(0,0,0);
  -webkit-transform: translate3d(0,0,0);
  backface-visibility: hidden;

  display: none;
}

.tm-bottom-nav .inner{
  height: 72px;
  display:grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
}

.tm-bottom-nav .tab{
  text-decoration:none;
  color: rgba(0,0,0,0.78);
  display:grid;
  gap: 0;
  justify-items: center;
  align-content: center;
}

/* делаем иконки крупнее */
.tm-bottom-nav .tab .icon{
  width: 23px;
  height: 23px;
}

/* center logo: same size as icons */
.tm-bottom-nav .tab .icon-mark{
  width: 23px;
  height: 23px;
  display: block;
}

/* подписи убираем */
.tm-bottom-nav .tab span{
  display: none;
}

/* Touch devices only */
@media (hover: none) and (pointer: coarse){
  .tm-bottom-nav{ display:block; }

  /* reserve safe space */
  body{ padding-bottom: calc(72px + env(safe-area-inset-bottom) + 12px); }

  /* footer hidden on mobile */
  .footer-mini{ display:none !important; }

  /* last black section must extend under nav */
  #auth{
    padding-bottom: calc(54px + 72px + env(safe-area-inset-bottom));
  }
}

/* Desktop */
@media (hover: hover) and (pointer: fine){
  .tm-bottom-nav{ display:none; }
  body{ padding-bottom: 0 !important; }
}

@media (max-width: 1024px){

  #menuBtn{ display:none !important; }
  .topbar-right{ display:none !important; }

  .topbar{ position: relative !important; }

  .topbar .brand{
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
  }
}

@media (min-width: 1025px){
  :root{ --topbar-h: 72px; }

  .topbar{
    position: fixed !important;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    background: #ececec;   /* ВАЖНО: без rgba */
    opacity: 1;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  #hairline{ display:none !important; }

  main{
    padding-top: var(--topbar-h);
  }
}


/* Remove mobile tap highlight / focus glow */
a, button { -webkit-tap-highlight-color: transparent; }

.tm-bottom-nav .tab:focus { outline: none; }
.tm-bottom-nav .tab:focus-visible { outline: none; }

/* Hide close button on touch devices */
@media (hover: none) and (pointer: coarse){
  #closeDrawer{ display:none; }
}

/* Center logo in bottom nav: make it visually same size as others */
.tm-bottom-nav .inner .tab:nth-child(3) .icon-mark{
  width: 19px;   /* подгони: 18-21 */
  height: 19px;
  transform: translateY(1px); /* чуть вниз, чтобы ровно смотрелось */
}

.hero-art video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-art video::poster {
  object-fit: cover;
}


@media (hover: none) and (pointer: coarse){
  #hairline{ display:none !important; }
}

/* =============================== */
/* SEARCH OVERLAY                  */
/* =============================== */

.tm-search-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 15000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 90px;
}

.tm-search-box{
  width: min(720px,92%);
  background: #0e0e0e;
  border-radius: 18px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.08);
}

#tmSearchInput{
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #000;
  color: #fff;
  font-size: 16px;
  outline: none;
}

.tm-search-results{
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tm-search-item{
  padding: 12px 14px;
  border-radius: 12px;
  background: #111;
  border: 1px solid rgba(255,255,255,0.06);
  color: #fff;
  cursor: pointer;
  font-size: 15px;
}

.tm-search-item:hover{
  background:#1a1a1a;
  border-color: rgba(255,255,255,0.12);
}


/* close button */
.tm-search-close{
  position:absolute;
  right:14px;
  top:12px;
  width:28px;
  height:28px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.08);
  background:#0b0b0b;
  color:#fff;
  font-size:16px;
  line-height:24px;
  text-align:center;
  cursor:pointer;
}

.tm-search-close:hover{
  background:#151515;
  border-color:rgba(255,255,255,0.18);
}

.tm-search-box{
  position:relative;
}

/* mobile tuning */
@media (hover:none) and (pointer:coarse){
  .tm-search-overlay{
    padding-top: 70px;
  }

  .tm-search-box{
    width: calc(100% - 28px);
    margin: 0 auto;
  }
}
