/* Стиль по образцу apple.com: значения сняты с сайта (шрифт SF Pro, #1d1d1f, #f5f5f7, #0066cc,
   меню 44px с пунктами по всей ширине, заголовки 56/40px weight 600, подвал 12px на #f5f5f7). Только светлая тема. */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --tile: #ffffff;
  --fg: #1d1d1f;
  --fg-2: #6e6e73;
  --fg-3: #86868b;
  --line: #d2d2d7;
  --accent: #1d1d1f;
  --accent-hover: #000000;
  --link: #1d1d1f;
  --nav: rgba(250, 250, 252, .8);
  --nav-fg: rgba(0, 0, 0, .8);
  --sel: #e8e8ed;
  --danger: #e30000;
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-text);
  font-size: 17px; line-height: 1.47059; letter-spacing: -.022em; font-weight: 400;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
[hidden] { display: none !important; }
img { max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 980px; margin: 0 auto; padding-left: max(22px, env(safe-area-inset-left, 0px)); padding-right: max(22px, env(safe-area-inset-right, 0px)); }

/* Глобальное меню: 44px, полупрозрачное, пункты распределены по всей ширине */
.nav { position: sticky; top: 0; z-index: 9; background: var(--nav); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); padding-top: env(safe-area-inset-top, 0px); }
.nav .wrap { max-width: 1024px; height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; letter-spacing: -.01em; }
.nav a, .nav .note { color: var(--nav-fg); padding: 0 8px; line-height: 44px; transition: color .32s cubic-bezier(.4, 0, .6, 1); }
.nav a:hover { color: #000; text-decoration: none; }
.brand { font-weight: 600; font-size: 14px; }
.nav a.l.on { color: #000; }
.nav .lang { font-weight: 600; }
.nav .pill { background: none; border: 0; color: var(--nav-fg); font-size: 12px; cursor: pointer; padding: 0 8px; }
.nav .pill:hover { color: #000; }
@media (max-width: 600px) { .brand { font-size: 13px; } .nav .wrap { padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px)); } }
@media (max-width: 360px) { .nav a.l[href$="blog/"] { display: none; } }

/* Кнопки (кабинет) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: #fff; border: 1px solid transparent; border-radius: 980px; padding: 11px 21px; font-size: 17px; line-height: 1.17648; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn.ghost:hover { background: var(--accent); color: #fff; }
.btn.sm { padding: 7px 15px; font-size: 14px; }
.btn[disabled] { opacity: .42; cursor: default; }
.more::after { content: "\00a0›"; }

/* Секции */
.hero { text-align: center; padding-block: 80px 64px; }
.eyebrow { font-family: var(--font-display); font-size: 21px; line-height: 1.19; font-weight: 600; color: var(--fg); letter-spacing: .011em; }
h1, h2, h3 { font-family: var(--font-display); }
h1 { font-size: clamp(40px, 7vw, 56px); line-height: 1.07143; font-weight: 600; letter-spacing: -.005em; margin: 8px 0 10px; text-wrap: balance; }
.sub { font-family: var(--font-display); font-size: clamp(21px, 2.6vw, 28px); line-height: 1.14286; font-weight: 400; letter-spacing: .007em; margin: 0 auto; max-width: 30ch; text-wrap: balance; }
.band { background: var(--bg-alt); padding-block: 80px; }
.band.white { background: var(--bg); }
h2 { font-size: clamp(32px, 5vw, 40px); line-height: 1.1; font-weight: 600; letter-spacing: 0; margin: 0 0 8px; text-align: center; text-wrap: balance; }
.lead { font-family: var(--font-display); text-align: center; color: var(--fg); font-size: 21px; line-height: 1.38; letter-spacing: .011em; margin: 0 auto 40px; max-width: 36ch; text-wrap: balance; }

/* Плитки как в сетке главной apple.com: на всю ширину, зазор 12px, текст по центру сверху */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: none; }
@media (max-width: 734px) { .tiles { grid-template-columns: 1fr; } }
.tiles-band { padding: 12px; }
.tiles-band h2 { padding-top: 68px; }
.tiles-band .facts, .tiles-band .center-link { padding-bottom: 56px; }
.tile { background: var(--bg-alt); padding: 56px 32px 60px; min-width: 0; text-align: center; }
.tile h3 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1; font-weight: 600; margin: 0 0 6px; letter-spacing: 0; }
.tile p { margin: 0 auto; color: var(--fg); font-family: var(--font-display); font-size: 21px; line-height: 1.19; letter-spacing: .011em; max-width: 28ch; }
.tile.link { color: var(--fg); display: block; }
.tile.link:hover { text-decoration: none; }
.tile.link .more { display: inline-block; color: var(--link); margin-top: 14px; font-family: var(--font-text); font-size: 17px; }
.tile.link:hover .more { text-decoration: underline; }
.facts { list-style: none; padding: 0; margin: 32px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; color: var(--fg-2); font-size: 14px; }
.center-link { text-align: center; margin: 20px 0 0; font-size: 17px; }

/* Цифра */
.stat { display: grid; justify-items: center; margin: 28px 0 0; }
.stat .n { font-family: var(--font-display); font-size: clamp(64px, 10vw, 96px); font-weight: 600; line-height: 1; letter-spacing: -.015em; background: linear-gradient(90deg, #0071e3, #8a4dff 60%, #d6308e); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.stat .label { color: var(--fg-2); font-size: 17px; margin-top: 8px; }

/* Аватар */
.avatar { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; margin: 0 auto 20px; display: block; }
.avatar.ph { display: grid; place-items: center; background: var(--bg-alt); color: var(--fg-3); font-family: var(--font-display); font-size: 36px; font-weight: 600; }
.hero.short { padding-block: 64px 40px; }

/* Блог: карточки как в Newsroom */
.posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 1068px) { .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 734px) { .posts { grid-template-columns: 1fr; } }
.post { background: var(--tile); border-radius: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--fg); min-width: 0; overflow: hidden; padding: 24px 24px 28px; box-shadow: 2px 4px 12px rgba(0, 0, 0, .08); transition: transform .3s cubic-bezier(0, 0, .5, 1), box-shadow .3s cubic-bezier(0, 0, .5, 1); }
.post:hover { text-decoration: none; transform: scale(1.01); box-shadow: 2px 4px 16px rgba(0, 0, 0, .16); }
.post img { margin: -24px -24px 14px; width: calc(100% + 48px); max-width: none; aspect-ratio: 16 / 9; object-fit: cover; }
.post .meta { font-size: 12px; color: var(--fg-2); text-transform: uppercase; letter-spacing: .02em; font-weight: 600; }
.post .t { font-family: var(--font-display); font-size: 21px; line-height: 1.19; font-weight: 600; letter-spacing: .011em; overflow-wrap: anywhere; }
.post .d { color: var(--fg-2); font-size: 14px; line-height: 1.43; letter-spacing: -.016em; }
.empty-blog { text-align: center; color: var(--fg-2); background: var(--tile); border-radius: 18px; padding: 48px 24px; margin: 0; font-size: 17px; }

/* Запись */
.article { max-width: 692px; padding-block: 48px 80px; }
.article .back-link { font-size: 14px; }
.article .meta { color: var(--fg-2); font-size: 14px; margin: 32px 0 4px; font-weight: 600; }
.article h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.08; text-align: left; letter-spacing: -.003em; }
.article .sub { text-align: left; margin: 0 0 32px; max-width: none; color: var(--fg-2); font-size: 21px; line-height: 1.38; }
.article .cover { border-radius: 18px; margin-bottom: 32px; width: 100%; }
.prose { font-size: 19px; line-height: 1.53; letter-spacing: .012em; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose figure { margin: 0 0 1em; }
.prose h2 { text-align: left; font-size: 28px; line-height: 1.14; margin: 1.6em 0 .5em; }
.prose h3 { font-size: 21px; margin: 1.4em 0 .4em; }
.prose blockquote { font-family: var(--font-display); font-size: 28px; line-height: 1.25; font-weight: 600; margin: 1.2em 0; }
.prose img { border-radius: 18px; }
.prose figcaption { font-size: 14px; color: var(--fg-2); margin-top: 8px; }

/* Подвал как у apple.com */
footer { background: var(--bg-alt); color: rgba(0, 0, 0, .56); font-size: 12px; line-height: 1.33337; letter-spacing: -.01em; padding-bottom: env(safe-area-inset-bottom, 0px); }
footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 17px 21px; border-top: 1px solid var(--line); }
footer .flinks { display: flex; gap: 0; }
footer a { color: rgba(0, 0, 0, .72); }
footer .flinks a + a { border-left: 1px solid var(--line); margin-left: 8px; padding-left: 8px; }

.note { font-size: 12px; color: var(--fg-2); }
.note.err { color: var(--danger); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .post { transition: none; } }

/* Логотип в меню */
.nav .logo { display: flex; align-items: center; height: 44px; padding: 0; }
.nav .logo img { height: 25px; width: auto; display: block; }

/* Значки справа в меню: язык и кабинет */
.nav-icons { display: flex; align-items: center; gap: 4px; }
.nav .nav-icon { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; height: 44px; color: var(--nav-fg); }
.nav .nav-icon svg { width: 16px; height: 16px; }
.nav .nav-icon span { font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.nav .nav-icon:hover { color: #000; text-decoration: none; }


/* Главная: курсы и новости */
.home { background: var(--bg-alt); }
.desk { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: start;
  padding: 24px max(20px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); }
.panel { background: var(--tile); border-radius: 18px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.panel header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 20px 22px 10px; }
.panel h2 { font-size: 24px; line-height: 1.17; margin: 0; text-align: left; letter-spacing: .009em; }
.panel header span { font-size: 12px; color: var(--fg-2); }
.panel ul { list-style: none; margin: 0; padding: 0 10px 6px; }
.panel li.none { padding: 14px 12px; color: var(--fg-2); font-size: 14px; }
.panel-foot { margin: 0; padding: 12px 22px 16px; font-size: 11px; line-height: 1.4; color: var(--fg-3); border-top: 1px solid #ececf0; }
.panel-foot a { color: var(--fg-3); text-decoration: underline; }
.rates li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; }
.rates li + li { box-shadow: inset 0 1px 0 #f0f0f3; }
.rates li:first-child { background: var(--bg-alt); border-radius: 12px; padding-block: 14px; margin-bottom: 4px; }
.rates li:first-child .val { font-size: 21px; font-weight: 600; }
.rates li:first-child + li { box-shadow: none; }
.rates .cur { display: grid; min-width: 0; }
.rates .cur b { font-size: 15px; font-weight: 600; }
.rates .cur span { font-size: 12px; color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rates .val { font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.news li + li { box-shadow: inset 0 1px 0 #f0f0f3; }
.news a { display: grid; gap: 4px; padding: 12px; border-radius: 10px; color: var(--fg); }
.news a:hover { background: var(--bg-alt); text-decoration: none; }
.news time { font-size: 11px; color: var(--fg-2); text-transform: uppercase; letter-spacing: .02em; font-weight: 600; }
.news a span { font-size: 17px; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.more-toggle { display: none; }
@media (max-width: 760px) {
  .panel ul.collapsed li.extra { display: none; }
  .more-toggle { display: block; margin: 0 12px 12px; padding: 11px; border: 0; border-radius: 12px; background: var(--bg-alt); color: var(--fg); font-size: 15px; font-weight: 500; cursor: pointer; }
  .news .more-toggle { margin-top: 4px; }
  .desk { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px max(12px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
  .panel h2 { font-size: 21px; }
  .panel header { padding: 18px 18px 8px; }
  .panel-foot { padding: 12px 18px 14px; }
  /* Курсы на телефоне — компактная сетка, чтобы новости были ближе */
  .rates ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 12px 12px; }
  .rates li, .rates li:first-child { flex-direction: column; align-items: flex-start; gap: 2px; background: var(--bg-alt); border-radius: 12px; padding: 10px 12px; margin: 0; box-shadow: none !important; }
  .rates li:first-child { grid-column: 1 / -1; flex-direction: row; align-items: center; padding: 14px; }
  .rates .cur span { font-size: 11px; }
  .rates .val { font-size: 17px; }
}
@media (prefers-reduced-motion: no-preference) {
  .panel { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; }
  .panel + .panel { animation-delay: .08s; }
  @keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}
