/* home.css — landing page. Two halves cut by a slanted line; hovering one half pushes the line
   across the other one (clip-path), the content of the hidden side slides away. */
.home { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: #1c1a17; color: #fff; overflow: hidden; }

/* top: only logo, theme, account */
.home__top { position: absolute; inset: 0 0 auto 0; z-index: 20; }
.home__top .bar__in { color: #fff; }
.home__top .brand { animation: rise .8s var(--ease) backwards; }
.home__top .iconbtn { background: rgba(255,255,255,.16); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: pop .6s var(--ease) backwards; transition: background-color .2s, transform .3s var(--ease); }
.home__top .iconbtn:nth-of-type(2) { animation-delay: .08s; }
.home__top .iconbtn:hover { background: rgba(255,255,255,.3); transform: translateY(-2px); }
.home__top .iconbtn.is-in { background: #fff; color: #1c1a17; }
.home__tools { display: flex; gap: 10px; margin-left: auto; }

/* the two halves are full-size layers; clip-path draws the slanted cut */
.split { position: relative; flex: 1; min-height: 100vh; min-height: 100dvh; background: #1c1a17 url("../assets/backgrounds/hero.jpg") center / cover no-repeat; }
.half { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 130px clamp(24px, 5vw, 72px) clamp(40px, 9vh, 96px); color: #fff; text-decoration: none; overflow: hidden;
  transition: clip-path .9s var(--ease); }
.half--a { clip-path: polygon(0 0, 55% 0, 45% 100%, 0 100%); }
.half--b { clip-path: polygon(55% 0, 100% 0, 100% 100%, 45% 100%); justify-content: flex-start; padding-left: calc(53% + clamp(24px, 4vw, 64px)); }
.seam { position: absolute; inset: 0; z-index: 5; pointer-events: none; background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.15));
  clip-path: polygon(55% 0, calc(55% + 2px) 0, calc(45% + 2px) 100%, 45% 100%); transition: clip-path .9s var(--ease); animation: seamIn 1.2s var(--ease) .2s backwards; }
@keyframes seamIn { from { clip-path: polygon(55% 0, calc(55% + 2px) 0, calc(55% + 2px) 0, 55% 0); } }

/* content moves with the line: the covered side slides out and fades */
.half__in { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 12px; max-width: 480px; transition: transform .9s var(--ease), opacity .6s; }
/* the left text must stay left of the slanted cut (45% of the width at the bottom) */
@media (min-width: 721px) {
  .half--a .half__in { max-width: min(480px, calc(45vw - clamp(24px, 5vw, 72px))); }
}

/* hover / keyboard focus: only on wide screens with a real pointer, so a tap on a phone
   cannot leave a stuck :hover that clips the stacked phone layout. */
@media (hover: hover) and (min-width: 721px) {
  /* the left half: the line slides right, over the other side */
  .split:has(.half--a:hover, .half--a:focus-visible) .half--a { clip-path: polygon(0 0, 74% 0, 62% 100%, 0 100%); }
  .split:has(.half--a:hover, .half--a:focus-visible) .half--b { clip-path: polygon(74% 0, 100% 0, 100% 100%, 62% 100%); }
  .split:has(.half--a:hover, .half--a:focus-visible) .seam { clip-path: polygon(74% 0, calc(74% + 2px) 0, calc(62% + 2px) 100%, 62% 100%); }
  /* …and the opposite on the right */
  .split:has(.half--b:hover, .half--b:focus-visible) .half--a { clip-path: polygon(0 0, 38% 0, 26% 100%, 0 100%); }
  .split:has(.half--b:hover, .half--b:focus-visible) .half--b { clip-path: polygon(38% 0, 100% 0, 100% 100%, 26% 100%); }
  .split:has(.half--b:hover, .half--b:focus-visible) .seam { clip-path: polygon(38% 0, calc(38% + 2px) 0, calc(26% + 2px) 100%, 26% 100%); }
  .split:has(.half--a:hover, .half--a:focus-visible) .half--a .half__in { transform: translateX(2vw); }
  .split:has(.half--a:hover, .half--a:focus-visible) .half--b .half__in { transform: translateX(16vw) skewX(-4deg); opacity: .25; }
  .split:has(.half--b:hover, .half--b:focus-visible) .half--b .half__in { transform: translateX(-16vw); }
  .split:has(.half--b:hover, .half--b:focus-visible) .half--a .half__in { transform: translateX(-12vw) skewX(4deg); opacity: .25; }
}

/* colour layers, slowly moving light */
.half__bg { position: absolute; inset: -20%; z-index: 0; transition: transform 1.2s var(--ease); }
.half--a .half__bg { background: radial-gradient(35% 45% at 25% 70%, rgba(111,165,135,.55), transparent 70%), rgba(30, 56, 41, .86); animation: drift 16s ease-in-out infinite alternate; }
.half--b .half__bg { background: radial-gradient(35% 45% at 80% 35%, rgba(216,154,43,.32), transparent 70%), rgba(20, 19, 15, .88); animation: drift 19s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(6%, -5%) rotate(4deg); } }

.half__eyebrow { font-size: .8rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; opacity: .85; animation: rise .8s var(--ease) .1s backwards; }
.half h1 { font-size: clamp(2.4rem, 5.4vw, 4.3rem); }
.half p { font-size: 1.15rem; opacity: .88; animation: rise .8s var(--ease) .45s backwards; }
.half--b .half__eyebrow { animation-delay: .25s; } .half--b p { animation-delay: .6s; }
/* "backwards" (not "both"): after the intro the hover transform is free to apply — no jumpy button */
.half__go { display: grid; place-items: center; width: 58px; height: 58px; margin-top: 14px; border-radius: 50%; background: #fff; color: #1c1a17; font-size: 1.5rem; animation: pop .7s var(--ease) .7s backwards; transition: transform .45s var(--ease), box-shadow .45s; }
.half:focus-visible { outline: none; }
.half:focus-visible .half__go { box-shadow: 0 0 0 4px #1c1a17, 0 0 0 7px #fff; }
@media (hover: hover) {
  .half:hover .half__bg { transform: scale(1.08); }
  .half:hover .half__go { transform: translateX(10px) scale(1.08); box-shadow: 0 0 0 10px rgba(255,255,255,.14); }
}

/* each word slides up out of a mask */
.split-words .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .08em; }
.split-words .w > span { display: inline-block; animation: wordUp .9s var(--ease) backwards; animation-delay: calc(.15s + var(--i) * .09s); }
.half--b .split-words .w > span { animation-delay: calc(.3s + var(--i) * .09s); }
@keyframes wordUp { from { transform: translateY(110%); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }

/* first load: the two halves slide in from their sides */
.half--a { animation: inA 1s var(--ease) backwards; }
.half--b { animation: inB 1s var(--ease) .1s backwards; }
@keyframes inA { from { clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); } }
@keyframes inB { from { clip-path: polygon(100% 0, 100% 0, 100% 100%, 100% 100%); } }

/* phones: stacked, slanted edge between them, no hover effect */
@media (max-width: 720px) {
  .split { display: flex; flex-direction: column; }
  .half { position: relative; flex: 1; min-height: 50vh; padding: 28px 24px 36px; align-items: center; }
  /* the top half must paint above the bottom one, otherwise the bottom background
     covers the slanted cut and leaves a straight seam */
  .half--a { padding-top: 110px; clip-path: polygon(0 0, 100% 0, 100% 94%, 0 100%); animation: none; z-index: 2; }
  .half--b { padding-left: 24px; margin-top: -6vh; padding-top: calc(6vh + 28px); clip-path: none; animation: none; }
  .seam { display: none; }
  .half__in { transform: none !important; opacity: 1 !important; }
}
@media (hover: none) { .half__in { transform: none !important; opacity: 1 !important; } }
@media (prefers-reduced-motion: reduce) { .half, .seam, .half__in { transition: none; } }
