/* Rune Nissen – Hjemmeside (/hjemmeside, hjemmeside/index.html): Shortform's page (css/shortform.css, which this
   builds on) with four sites, each shown in films recorded on the site itself – the canvas board "Hjemmeside –
   Bookbart, Semvac og Tobyne som film … (C, valgt)". At the top the name and the line, and beside them a browser window
   with Andreas & Rune standing in it. Each site: its name big on top, the case in a column to the left, then the
   films: the front page wide in a browser frame, under it one more place on the site and the front page on a phone.
   Under 1000px the case goes over the films; on phones the films are swiped, the phone first, with a dot per film
   under them as on Shortform. After the four, Flere sider points on to aahstudio.com, where the rest stand. */

/* ---------- The top: the name and the line, the window beside them ---------- */
.hj-top { grid-template-columns: minmax(0, 1fr) minmax(0, 600px); align-items: center; }
/* The name fills its column at most (HJEMMESIDE is 4.03em wide), up to Shortform's 160px */
.hj-say { container-type: inline-size; }
.hj .hj-top h1 { font-size: min(160px, 24.8cqw); }
.hj-top .sf-lede { max-width: 430px; margin-top: 30px; }

/* A browser's frame: the bar with the three dots, the address and a live dot; under it the window */
.hj-card, .hj-win { position: relative; display: block; overflow: hidden; border-radius: 14px; background: #0E1718; color: var(--creme); container-type: inline-size; box-shadow: 0 34px 60px -38px rgba(13,26,28,.6); }
.hj-card::after, .hj-win::after { content: ''; position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(243,239,228,.1), inset 0 1px 0 rgba(255,255,255,.18); }
.hj-chrome { position: relative; z-index: 2; display: flex; align-items: center; gap: clamp(8px, 1.6cqw, 16px); height: clamp(26px, 3.8cqw, 40px); padding: 0 clamp(10px, 2.2cqw, 22px); background: #121C1D; border-bottom: 1px solid rgba(243,239,228,.08); }
.hj-dots { display: flex; gap: clamp(4px, .6cqw, 7px); }
.hj-dots i { width: clamp(6px, .8cqw, 9px); height: clamp(6px, .8cqw, 9px); border-radius: 50%; background: rgba(243,239,228,.22); }
.hj-url { flex: 1; max-width: 52%; margin: 0 auto; padding: clamp(4px, .55cqw, 6px) 12px; overflow: hidden; border-radius: 99px; background: rgba(243,239,228,.07); font-size: clamp(9px, 1.15cqw, 12px); letter-spacing: .04em; line-height: 1; text-align: center; white-space: nowrap; text-overflow: ellipsis; color: rgba(243,239,228,.7); }
.hj-live { display: inline-flex; align-items: center; gap: 6px; font-size: clamp(8px, .95cqw, 10px); font-weight: 500; letter-spacing: .18em; line-height: 1; text-transform: uppercase; color: rgba(243,239,228,.6); }
.hj-live::before { content: ''; width: clamp(5px, .7cqw, 7px); height: clamp(5px, .7cqw, 7px); border-radius: 50%; background: var(--lime); }

/* The window at the top: a site drawn in line (a bar, the headline, three lines, a button, the floor), and Andreas &
   Rune standing on its floor at the left. Their film's box (690 × 876) stands with its left edge – where Andreas's arm
   leaves the picture – .03 of its width outside the window, so the window's edge cuts the arm; their soles stand .9 %
   over the box's bottom */
.hj-win .hj-url { color: rgba(243,239,228,.5); }
.hj-mock { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #FBF9F3; }
.hj-wf { position: absolute; inset: 0; }
.hj-wf i { position: absolute; display: block; border-radius: 99px; background: rgba(13,26,28,.1); }
.hj-wf .hj-wf-nav { top: 6%; left: 5%; right: 5%; height: 2.4%; border-radius: 0; background: none; }
.hj-wf-nav::before, .hj-wf-nav::after { content: ''; position: absolute; top: 0; height: 100%; border-radius: 99px; background: rgba(13,26,28,.14); }
.hj-wf-nav::before { left: 0; width: 12%; }
.hj-wf-nav::after { right: 0; width: 28%; background: repeating-linear-gradient(90deg, rgba(13,26,28,.1) 0 22%, transparent 22% 26%); }
.hj-wf .hj-wf-h1 { top: 26%; left: 50%; width: 42%; height: 7.5%; border-radius: 6px; background: rgba(13,26,28,.16); }
.hj-wf .hj-wf-h2 { top: 36%; left: 50%; width: 30%; height: 7.5%; border-radius: 6px; background: rgba(13,26,28,.16); }
.hj-wf .hj-wf-p1 { top: 50%; left: 50%; width: 40%; height: 2.2%; }
.hj-wf .hj-wf-p2 { top: 55%; left: 50%; width: 36%; height: 2.2%; }
.hj-wf .hj-wf-p3 { top: 60%; left: 50%; width: 26%; height: 2.2%; }
.hj-wf .hj-wf-btn { top: 69%; left: 50%; width: 17%; height: 6.5%; background: var(--lime); }
.hj-wf .hj-wf-floor { left: 0; right: 0; bottom: 8.5%; height: 1px; border-radius: 0; }
.hj-duo { --w: 38%; position: absolute; left: calc(var(--w) * -.03); bottom: 8.5%; z-index: 1; width: var(--w); aspect-ratio: 690 / 876; margin-bottom: calc(var(--w) * -.0115); pointer-events: none; }
.hj-duo img, .hj-duo video { position: absolute; inset: 0; width: 100%; height: 100%; }
.hj-duo video { opacity: 0; }
.hj-duo.is-playing .hj-start { opacity: 1; }
.hj-duo.is-playing img { opacity: 0; transition: opacity 0s .12s; }
/* Once their hand sign is done, the loop (its first frame the start's next) takes over: they stand looking round */
.hj-duo.is-looping .hj-loop { opacity: 1; }
.hj-duo.is-looping .hj-start { opacity: 0; transition: opacity 0s .1s; }
.hj-duo::after { content: ''; position: absolute; left: 4%; right: 2%; bottom: -.6%; z-index: -1; height: 3.2%; border-radius: 50%; background: radial-gradient(closest-side, rgba(13,26,28,.26), rgba(13,26,28,.1) 55%, rgba(13,26,28,0)); }
/* They walk in from the window's edge once the window is there; then the film starts (js/hjemmeside.js) */
.sf-anim [data-reveal] .hj-duo { opacity: 0; transform: translateX(-26px); transition: opacity .45s ease .75s, transform .6s cubic-bezier(.2,.8,.2,1) .75s; }
.sf-anim [data-reveal].is-in .hj-duo { opacity: 1; transform: none; }

/* ---------- A site: the case's column, then the films ---------- */
.hj-body { --case: clamp(220px, 17.8vw, 256px); display: grid; grid-template-columns: var(--case) minmax(0, 1fr); gap: clamp(32px, 3.9vw, 56px); align-items: start; margin-top: 56px; }
.hj .hj-body > .sf-case { grid-column: 1; max-width: none; margin: 0; }
.hj .sf-case::after { display: none; }
.hj .sf-case .hj-kind { display: flex; align-items: center; gap: 9px; margin: 0 0 14px; font-size: 11px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: rgba(13,26,28,.55); }
.hj .sf-case .hj-kind::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 1px rgba(13,26,28,.28); }
.hj .sf-case p.is-todo { color: rgba(13,26,28,.4); }
.hj-visit { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; padding-bottom: 4px; border-bottom: 2px solid var(--lime); color: var(--petrol-900); font-size: 12px; font-weight: 500; letter-spacing: .16em; text-decoration: none; text-transform: uppercase; }
.hj-visit i { font-style: normal; transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.hj-visit:hover i { transform: translate(2px, -2px); }

/* The films: the front page wide, under it the third film and the phone side by side, about as tall as each other
   (the phone's column is 23.3 % of the row) */
.hj-films { display: grid; grid-template-columns: minmax(0, 1fr) 23.3%; gap: clamp(32px, 3.3vw, 48px) clamp(16px, 2.2vw, 32px); align-items: start; }
.hj-films > .hj-wide { grid-column: 1 / -1; }
.hj-films > .hj-side { grid-column: 1; grid-row: 2; }
.hj-films > .hj-tel { grid-column: 2; grid-row: 2; }
.hj-wide .sf-line { max-width: 620px; }
.hj-screen { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #0E1718; }
.hj-screen video, .hj-scr video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* The same site on a phone: the film in a phone's frame, the island over its top */
.hj-phone { position: relative; display: block; container-type: inline-size; }
.hj-scr { position: relative; display: block; box-sizing: content-box; aspect-ratio: 390 / 844; overflow: hidden; border: 3.2cqw solid #0E1718; border-radius: 15cqw; background: #0E1718; box-shadow: 0 34px 60px -38px rgba(13,26,28,.6), 0 0 0 1px rgba(243,239,228,.06); }
.hj-scr::before { content: ''; position: absolute; z-index: 2; top: 2.6cqw; left: 35%; width: 30%; height: 8cqw; border-radius: 99px; background: #050A0B; }
/* Under the mouse a film lifts, as the clips do on Shortform */
.hj-films a { transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease; }
@media (hover: hover) {
  .hj-films a:hover { transform: translateY(-6px); }
  .hj-films .hj-card:hover { box-shadow: 0 46px 70px -40px rgba(13,26,28,.72); }
}
.hj-films a:focus-visible { outline: 2px solid var(--petrol-900); outline-offset: 4px; }

/* ---------- Flere sider: on to aahstudio.com ----------
   Laid out as a site, but the case ends in a button, and the one window (aahstudio.com's wall of sites) has two more
   peeking out over its top, narrower each, as a stack of sites */
.hj-more .sf-n { text-transform: uppercase; }
.hj-go { display: inline-flex; align-items: center; gap: 14px; margin-top: 24px; padding: 7px 7px 7px 24px; border-radius: 99px; background: var(--petrol-900); color: var(--creme); font-size: 15px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap; transition: background-color .25s ease; -webkit-tap-highlight-color: transparent; }
.hj-go i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--lime); color: var(--petrol-900); font-size: 16px; font-style: normal; transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.hj-go:focus-visible { outline: 2px solid var(--petrol-900); outline-offset: 3px; }
.hj-more .hj-films { grid-template-columns: minmax(0, 1fr); padding-top: 26px; }
.hj-more .hj-wide { --peek: 12px; position: relative; isolation: isolate; }
.hj-more .hj-wide::before, .hj-more .hj-wide::after { content: ''; position: absolute; top: 0; height: 64px; border-radius: 14px 14px 0 0; transition: transform .35s cubic-bezier(.2,.7,.2,1); }
.hj-more .hj-wide::before { z-index: -1; left: 3.5%; right: 3.5%; background: #3B4544; transform: translateY(calc(-1 * var(--peek))); }
.hj-more .hj-wide::after { z-index: -2; left: 7%; right: 7%; background: #8B8F8A; transform: translateY(calc(-2 * var(--peek))); }
@media (hover: hover) {
  .hj-go:hover { background: var(--petrol-700); }
  .hj-go:hover i { transform: rotate(45deg); }
  /* Under the mouse the window lifts, and the two behind it fan out a little more */
  .hj-more .hj-wide:has(.hj-card:hover)::before { transform: translateY(calc(-1 * var(--peek) - 8px)); }
  .hj-more .hj-wide:has(.hj-card:hover)::after { transform: translateY(calc(-2 * var(--peek) - 14px)); }
}

/* ---------- Coming in: the case and the films follow one by one, as on Shortform (the lines under the films come in
   by css/shortform.css) ---------- */
.sf-anim [data-reveal] :is(.hj-body > .sf-case, .hj-films > li) { opacity: 0; transform: translateY(56px) scale(.97); transition: opacity .5s ease calc(.3s + var(--i, 0) * 90ms), transform .75s cubic-bezier(.2,.8,.2,1) calc(.3s + var(--i, 0) * 90ms); }
.sf-anim [data-reveal].is-in :is(.hj-body > .sf-case, .hj-films > li) { opacity: 1; transform: none; }

/* The dots under a site's films are for the swiped row on phones only (below) */
.hj-nav { display: none; }

/* Too narrow for the column: the case goes over the films, the window under the name */
@media (max-width: 1000px) {
  .hj-top { grid-template-columns: minmax(0, 1fr); }
  .hj-win { max-width: 600px; }
  .hj-body { display: block; }
  .hj .hj-body > .sf-case { max-width: 640px; margin-bottom: 36px; }
}
/* The phone: the case over the row, and the films swiped, the phone first, their feet in one line */
@media (max-width: 600px) {
  .hj-top { gap: 28px; }
  .hj-top .sf-lede { margin-top: 20px; }
  .hj-win { border-radius: 11px; }
  .hj-duo { --w: 42%; }
  /* A site's name keeps inside the screen on the narrowest phones too (GRØNNEMARK is 4.4em wide) */
  .hj .sf-head h2 { font-size: min(72px, 19.5vw); }
  .hj-body { margin-top: 24px; }
  .hj .hj-body > .sf-case { margin-bottom: 0; }
  .hj-visit { margin-top: 16px; }
  .hj-card { border-radius: 11px; }
  .hj-films { display: flex; align-items: flex-end; gap: 14px; margin: 28px -20px 0; padding: 0 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 20px; scrollbar-width: none; }
  .hj-films::-webkit-scrollbar { display: none; }
  .hj-films > li { flex: 0 0 84vw; width: 84vw; min-width: 0; scroll-snap-align: start; }
  .hj-films > .hj-tel { order: -1; flex-basis: 50vw; width: 50vw; }
  /* Under the row a dot per film, as on Shortform (js/hjemmeside.js makes them) */
  .hj-nav:not(.is-still) { display: flex; }
  .hj-wide .sf-line { max-width: none; }
  /* Flere sider's one window is not swiped: it stands the column's width, its stack a little lower */
  .hj-more .hj-films { display: block; margin: 32px 0 0; padding: 18px 0 0; overflow: visible; }
  .hj-more .hj-films > li { width: auto; }
  .hj-more .hj-wide { --peek: 9px; }
  .hj-more .hj-wide::before, .hj-more .hj-wide::after { border-radius: 11px 11px 0 0; }
  .hj-go { margin-top: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .hj-films a, .hj-visit i, .hj-go, .hj-go i, .hj-more .hj-wide::before, .hj-more .hj-wide::after { transition: none; }
}
