@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --paper: #ffffff;
  --white: #ffffff;
  --ink: #29231f;
  --muted: #65584f;
  --orange: #d89555;
  --orange-deep: #995a2e;
  --orange-soft: #f4e1ce;
  --orange-pale: #fff6ef;
  --line: rgba(75, 49, 31, .16);
  --page-width: 1240px;
  --gutter: clamp(22px, 5.2vw, 82px);
  --ease: cubic-bezier(.2,.75,.25,1);
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 16px; line-height: 1.65; }
body.menu-open { overflow: hidden; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }
img.image-missing { display: none; }
.media-fallback { background: var(--orange-soft); }
.hero-photo::before, .story-image::before { content: 'Фото техникума'; position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; color: var(--orange-deep); font-size: 16px; font-weight: 700; text-align: center; }
.has-image::before { display: none; }
.media-fallback::before { content: 'Добавьте фотографию техникума'; }
button, a { color: inherit; font: inherit; }
a { text-decoration: none; }
button { cursor: pointer; }
::selection { background: var(--orange); color: var(--white); }
:focus-visible { outline: 3px solid var(--orange-deep); outline-offset: 4px; }

.skip-link { position: fixed; z-index: 30; top: 10px; left: 10px; padding: 10px 16px; background: var(--ink); color: white; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.reading-progress { position: fixed; z-index: 20; inset: 0 0 auto; height: 3px; pointer-events: none; }
.reading-progress span { display: block; width: 100%; height: 100%; background: var(--orange); transform: scaleX(0); transform-origin: left; }
.site-header { position: relative; z-index: 15; width: min(100%, 1440px); min-height: 92px; margin: auto; padding: 16px var(--gutter); display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 12px; position: relative; z-index: 2; }
.brand-mark { width: 58px; height: 58px; object-fit: contain; flex: none; }
.brand-copy { display: grid; line-height: 1.3; font-size: 12px; color: var(--muted); }
.brand-copy strong { color: var(--ink); font-size: 14px; font-weight: 700; }
.site-nav { display: flex; align-items: center; gap: clamp(18px, 2.5vw, 38px); font-size: 13px; font-weight: 600; }
.site-nav a { transition: color .2s ease; }
.site-nav a:hover, .site-nav a[aria-current="location"] { color: var(--orange-deep); }
.site-nav .nav-action { padding: 12px 18px; color: white; background: var(--ink); transition: background .2s ease, transform .2s ease; }
.site-nav .nav-action:hover { background: var(--orange-deep); color: white; transform: translateY(-2px); }
.menu-toggle { display: none; }

.hero { position: relative; min-height: min(790px, calc(100svh - 92px)); width: min(100%, 1440px); margin: auto; padding: 60px var(--gutter) 116px; display: grid; grid-template-columns: .88fr 1.12fr; gap: 5vw; align-items: center; overflow: hidden; }
.hero-copy { position: relative; z-index: 2; max-width: 570px; padding: 16px 0; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 640px; margin-bottom: 24px; font-size: clamp(46px, 6.3vw, 88px); line-height: .99; letter-spacing: -.065em; font-weight: 600; }
h1 span { color: var(--orange-deep); }
.hero-lede { max-width: 460px; margin-bottom: 30px; color: var(--muted); font-size: clamp(16px, 1.4vw, 19px); line-height: 1.65; }
.button { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 22px; padding: 13px 20px; border: 0; font-size: 14px; font-weight: 700; transition: background .22s ease, color .22s ease, transform .22s ease; }
.button:hover { transform: translateY(-3px); }
.button-dark { color: white; background: var(--ink); }
.button-dark:hover { background: var(--orange-deep); }
.hero-note { margin: 22px 0 0; font-size: 12px; color: var(--muted); }
.hero-visual { position: relative; min-height: 520px; display: grid; place-items: center; }
.hero-photo { position: relative; z-index: 1; width: min(100%, 610px); height: clamp(390px, 44vw, 590px); margin: 0 0 0 4%; overflow: hidden; background: var(--orange-soft); }
.hero-photo img { transition: transform 1.1s var(--ease); animation: photo-settle 1.2s var(--ease) both; }
.hero-photo:hover img { transform: scale(1.035); }
.scroll-cue { position: absolute; bottom: 32px; left: var(--gutter); display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--muted); }
.scroll-cue span { width: 34px; height: 1px; background: var(--orange); }

.section-pad { padding: clamp(78px, 10vw, 145px) var(--gutter); }
.intro { position: relative; width: min(100%, 1440px); margin: auto; display: grid; grid-template-columns: 1fr .8fr; gap: 7vw; align-items: start; overflow: hidden; }
.intro-heading { max-width: 560px; }
.intro h2, .section-heading h2, .closing h2 { margin-bottom: 0; font-size: clamp(36px, 4.7vw, 64px); line-height: 1.08; letter-spacing: -.055em; font-weight: 600; }
.intro-body { max-width: 510px; padding-top: 34px; color: var(--muted); }
.intro-body p { margin-bottom: 18px; }
.text-link { display: inline-flex; gap: 16px; align-items: center; padding-bottom: 5px; border-bottom: 1px solid var(--orange); color: var(--ink); font-size: 13px; font-weight: 700; transition: color .2s ease, gap .2s ease; }
.text-link:hover { color: var(--orange-deep); gap: 22px; }

.traditions { background: var(--orange-pale); }
.section-heading { width: min(100%, var(--page-width)); margin: 0 auto 44px; display: flex; justify-content: space-between; align-items: end; gap: 32px; }
.section-heading h2 { max-width: 640px; }
.section-heading > p { max-width: 300px; margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.tradition-selector { width: min(100%, var(--page-width)); margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.tradition-tab { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 18px 8px 19px 0; border: 0; background: transparent; text-align: left; color: var(--muted); transition: color .2s ease; }
.tradition-tab::after { content: ''; position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; background: var(--orange); transform: scaleX(0); transform-origin: left; transition: transform .28s var(--ease); }
.tradition-tab span { font-size: 15px; font-weight: 700; }
.tradition-tab small { font-size: 11px; }
.tradition-tab:hover, .tradition-tab.is-active { color: var(--ink); }
.tradition-tab.is-active::after { transform: scaleX(1); }
.tradition-story { width: min(100%, var(--page-width)); min-height: 570px; margin: 0 auto; padding: 76px 0; display: grid; grid-template-columns: 1fr .82fr; align-items: center; gap: clamp(44px, 8vw, 112px); scroll-margin-top: 80px; }
.tradition-story + .tradition-story { border-top: 1px solid var(--line); }
.story-second { grid-template-columns: .82fr 1fr; }
.story-image { position: relative; min-height: 400px; height: min(42vw, 500px); overflow: hidden; background: #e8d3c1; }
.story-media { min-width: 0; }
.story-image { touch-action: pan-y; }
.story-image img { transition: opacity .25s ease, transform .8s var(--ease); }
.story-image img.is-changing { opacity: .25; }
.radio-image { background: #ffffff; }
.radio-image img { object-fit: contain; }
.story-third .story-image { background: #1d1d1d; }
.story-third .story-image img { object-fit: contain; }
.story-image:hover img { transform: scale(1.035); }
.photo-controls { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 13px; }
.story-media.is-single-photo .photo-controls { display: none; }
.photo-control { min-width: 92px; min-height: 44px; padding: 0 10px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 12px; font-weight: 700; transition: color .2s ease, background .2s ease, opacity .2s ease; }
.photo-control:hover:not(:disabled) { color: white; background: var(--ink); }
.photo-control:disabled { cursor: default; opacity: .38; }
.photo-count { min-width: 54px; color: var(--muted); font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
.story-copy { max-width: 500px; }
.story-copy h3 { max-width: 480px; margin-bottom: 20px; font-size: clamp(34px, 4vw, 54px); line-height: 1.06; letter-spacing: -.055em; font-weight: 600; }
.story-copy > p { color: var(--muted); }
.story-detail { margin: 26px 0; padding-left: 17px; border-left: 2px solid var(--orange); font-size: 14px; }
.story-detail strong { display: block; margin-bottom: 5px; color: var(--ink); font-size: 13px; }
.closing { position: relative; min-height: 500px; display: flex; align-items: center; background: var(--orange-soft); }
.closing-copy { position: relative; z-index: 1; max-width: 720px; }
.closing-copy h2 { margin-bottom: 20px; }
.closing-copy > p { max-width: 460px; color: var(--muted); }
.closing-copy .button { margin-top: 8px; }
.back-top { position: absolute; right: var(--gutter); bottom: 32px; display: flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 700; }
.back-top span { color: var(--orange-deep); font-size: 19px; }
.site-footer { padding: 30px var(--gutter) 34px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; background: var(--ink); color: white; font-size: 11px; }
.footer-brand { font-weight: 700; }
.site-footer p { margin: 0; color: rgba(255,255,255,.75); }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.story-image.reveal { transition-delay: .08s; }
.story-copy.reveal { transition-delay: .16s; }
@keyframes photo-settle { from { transform: scale(1.045); } to { transform: scale(1); } }

@media (max-width: 900px) {
  .site-header { min-height: 78px; }
  .menu-toggle { position: relative; z-index: 3; display: flex; align-items: center; gap: 13px; padding: 10px 0 10px 10px; border: 0; background: transparent; font-size: 13px; font-weight: 700; }
  .menu-toggle-icon { width: 23px; display: grid; gap: 6px; }
  .menu-toggle-icon i { display: block; height: 2px; background: var(--ink); transition: transform .22s ease; }
  .menu-toggle[aria-expanded="true"] .menu-toggle-icon i:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-toggle-icon i:last-child { transform: translateY(-4px) rotate(-45deg); }
  .site-nav { position: fixed; z-index: 2; inset: 0; display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 0; padding: 100px var(--gutter) 50px; background: var(--paper); visibility: hidden; opacity: 0; transform: translateY(-10px); transition: opacity .25s ease, transform .25s ease, visibility .25s; }
  .site-nav.is-open { visibility: visible; opacity: 1; transform: translateY(0); }
  .site-nav a { padding: 17px 0; border-bottom: 1px solid var(--line); font-size: clamp(22px, 5vw, 34px); }
  .site-nav .nav-action { margin-top: 25px; padding: 15px 20px; border: 0; font-size: 16px; text-align: center; }
  .hero { min-height: auto; grid-template-columns: .95fr 1.05fr; gap: 3vw; padding-top: 40px; padding-bottom: 100px; }
  .hero-visual { min-height: 440px; }
  .hero-photo { height: 440px; }
  .intro { gap: 5vw; }
  .tradition-selector { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tradition-story { gap: 5vw; min-height: 480px; }
  .story-image { min-height: 340px; }
  .site-footer { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .brand-mark { width: 48px; height: 48px; }
  .brand-copy { font-size: 10px; }
  .brand-copy strong { font-size: 12px; }
  .hero { display: flex; flex-direction: column; align-items: stretch; gap: 24px; padding-top: 34px; padding-bottom: 82px; }
  .hero-copy { padding: 0; }
  h1 { max-width: 520px; margin-bottom: 18px; font-size: clamp(45px, 13vw, 68px); }
  .hero-lede { font-size: 15px; }
  .hero-note { margin-top: 16px; }
  .hero-visual { min-height: 330px; }
  .hero-photo { width: calc(100% - 25px); height: 330px; margin-left: 18px; }
  .scroll-cue { bottom: 28px; }
  .section-pad { padding-top: 76px; padding-bottom: 76px; }
  .intro { display: block; }
  .intro h2, .section-heading h2, .closing h2 { font-size: clamp(36px, 10vw, 50px); }
  .intro-body { padding-top: 23px; }
  .section-heading { display: block; margin-bottom: 28px; }
  .section-heading > p { margin-top: 18px; }
  .tradition-selector { grid-template-columns: 1fr; border-bottom: 0; }
  .tradition-tab { padding: 13px 0; border-bottom: 1px solid var(--line); }
  .tradition-tab::after { bottom: -1px; }
  .tradition-tab small { font-size: 10px; }
  .tradition-story, .story-second { min-height: 0; padding: 42px 0; display: flex; flex-direction: column; align-items: stretch; gap: 27px; }
  .story-second .story-copy { order: 2; }
  .story-second .story-media { order: 1; }
  .story-image { height: 300px; min-height: 0; }
  .photo-controls { justify-content: space-between; gap: 6px; }
  .photo-control { min-width: 78px; padding: 0 7px; font-size: 11px; }
  .photo-count { min-width: 78px; font-size: 12px; }
  .story-copy h3 { font-size: 39px; }
  .story-detail { margin: 20px 0; }
  .closing { min-height: 520px; align-items: flex-start; padding-top: 85px; padding-bottom: 95px; }
  .closing-copy { max-width: 520px; }
  .back-top { bottom: 24px; }
  .site-footer { display: block; padding-top: 26px; }
  .site-footer p { margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
