/*
 * alyssatarry.com
 *
 * One warm neutral background, a five-colour palette, and a handful of
 * geometric shapes (circle, square, arch, leaf, quarter) reused everywhere:
 * the name tiles, the menu icons, the section headings and the colour cards.
 */

@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/rubik-normal-300-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/rubik-normal-300-700-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #f6f4ef;
  --ink: #111;
  --muted: #8a857c;
  --hot: #ff5a36;
  --lime: #d9f25c;
  --teal: #2f6f6b;
  --peri: #6d6ff0;
  --mustard: #f4c24f;
  --pad: clamp(1rem, 3vw, 2.5rem);
  --gap: clamp(.75rem, 1.5vw, 1.25rem);
  --spring: cubic-bezier(.3, 1.6, .5, 1);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Rubik", system-ui, sans-serif; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
figure { margin: 0; }
:focus-visible { outline: 3px solid var(--peri); outline-offset: 3px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: var(--pad); top: -4rem; z-index: 100; padding: .6rem 1rem; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; }
.skip-link:focus { top: .75rem; }

/* shapes, shared by menu icons and section headings */
.ico { flex: none; display: block; background: var(--c); }
.ico.dot { border-radius: 50%; }
.ico.sq { border-radius: 2px; }
.ico.arch { border-radius: 999px 999px 2px 2px; }
.ico.leaf { border-radius: 0 999px 0 999px; }
.ico.quarter { border-radius: 100% 0 0 0; }

/* ------------------------------------------------------------------ header */

.bar { position: relative; z-index: 50; display: flex; justify-content: space-between; align-items: center; padding: 1.1rem var(--pad); font-weight: 500; font-size: .9rem; }
.bar nav { display: flex; gap: 1.5rem; align-items: center; }
.bar nav > a:hover, .bar nav > a[aria-current] { color: var(--hot); }

/* the name tiles, shrunk to a logo */
.mini { display: grid; grid-template-columns: repeat(6, 26px); grid-auto-rows: 26px; gap: 2px; font: 700 13px/1 "Rubik", sans-serif; }
.t { display: grid; place-items: center; aspect-ratio: 1; background: var(--c); color: #fff; transition: transform .5s var(--spring), color .3s; }
.t.circle { border-radius: 50%; }
.t.square { border-radius: 3px; }
.t.quarter { border-radius: 100% 0 0 0; }
.home-link:hover .t:nth-child(odd), .tiles:hover .t:nth-child(odd) { transform: rotate(-90deg); }
.home-link:hover .t:nth-child(even), .tiles:hover .t:nth-child(even) { transform: rotate(90deg); }
.home-link:hover .t, .tiles:hover .t { color: transparent; }

/* Works dropdown: opens on hover or keyboard focus, and on tap via site.js */
.works { position: relative; }
.works__toggle { display: inline-flex; align-items: center; gap: .35rem; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.works__toggle svg { transition: transform .3s; }
.works__toggle:hover { color: var(--hot); }
.works__menu {
  position: absolute; right: -1rem; top: calc(100% + .6rem); z-index: 60; min-width: 13rem;
  list-style: none; margin: 0; padding: .5rem; background: var(--bg); border: 2px solid var(--ink); border-radius: 18px;
  box-shadow: 5px 5px 0 var(--ink);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s, transform .25s cubic-bezier(.3, 1.5, .5, 1), visibility .2s;
}
.works__menu::before { content: ""; position: absolute; left: 0; right: 0; top: -.8rem; height: .8rem; }
.works:hover .works__menu, .works:focus-within .works__menu, .works.open .works__menu { opacity: 1; visibility: visible; transform: none; }
.works:hover .works__toggle svg, .works.open .works__toggle svg { transform: rotate(180deg); }
.works__menu a { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border-radius: 10px; font-weight: 600; font-size: 1rem; }
.works__menu a:hover, .works__menu a:focus-visible { background: var(--ink); color: var(--bg); }
.works__menu a[aria-current] { background: var(--c); color: var(--fc); }
.works__menu .ico { width: 14px; height: 14px; transition: transform .4s var(--spring); }
.works__menu a[aria-current] .ico { background: var(--fc); }
.works__menu a:hover .ico { transform: rotate(90deg) scale(1.15); }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; padding: 3rem var(--pad) 2rem; color: var(--muted); font-size: .85rem; }
.foot a:hover { color: var(--ink); }

/* -------------------------------------------------------------------- home */

main.home { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: clamp(1rem, 2.5vw, 2.5rem); align-items: start; padding: clamp(.5rem, 2vw, 1.5rem) var(--pad) 0; }

.tiles-name { margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; max-width: 420px; font: 700 clamp(1.3rem, 2.3vw, 2.4rem)/1 "Rubik", sans-serif; }
.tiles .t.square { border-radius: 4px; }

.intro { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 3px solid var(--ink); max-width: 420px; text-align: center; }
.me { display: block; width: min(100%, 240px); margin: 0 auto .6rem; }
.me img { width: 82%; height: auto; aspect-ratio: 1; margin: 0 auto; object-fit: cover; border-radius: 999px 999px 18px 18px; background: var(--mustard); }
.bio { margin: 0 0 1.25rem; font-weight: 600; font-size: clamp(1rem, 1.3vw, 1.2rem); line-height: 1.3; letter-spacing: -.01em; }

/* 2x2 colour cards, each staging a little spread of that collection's work */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.card a { position: relative; display: block; aspect-ratio: 5/4; overflow: hidden; isolation: isolate; border-radius: 26px; background: var(--c); color: var(--fc); }
.card h2 { position: absolute; z-index: 5; left: clamp(1rem, 2vw, 1.6rem); top: clamp(.9rem, 1.8vw, 1.4rem); margin: 0; font: 700 clamp(1.5rem, 3.1vw, 3.1rem)/.9 "Rubik", sans-serif; letter-spacing: -.055em; text-transform: uppercase; }
.go { display: grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: 50%; background: var(--bg); color: var(--ink); font-size: 1.2rem; font-style: normal; transition: transform .45s cubic-bezier(.6, 0, .2, 1); }
.card .go { position: absolute; z-index: 5; right: clamp(1rem, 2vw, 1.6rem); top: clamp(1rem, 2vw, 1.6rem); }
.card .p { position: absolute; overflow: hidden; border-radius: 12px; box-shadow: 0 18px 36px -14px rgba(0, 0, 0, .45); transition: transform .6s cubic-bezier(.3, 1.3, .5, 1), border-radius .55s; }
.card .p img, .stage .p img { width: 100%; height: 100%; object-fit: cover; }
.card .main { z-index: 3; left: 50%; top: 57%; width: var(--w, 58%); aspect-ratio: var(--ar, 4/3); transform: translate(-50%, -50%); }
.card .l { z-index: 2; left: 5%; bottom: 8%; width: 29%; aspect-ratio: 3/4; transform: rotate(-7deg); }
.card .r { z-index: 2; right: 5%; bottom: 11%; width: 29%; aspect-ratio: 3/4; transform: rotate(6deg); }
.card a:hover .main, .card a:focus-visible .main { transform: translate(-50%, -54%) scale(1.04); border-radius: 999px; }
.card a:hover .l, .card a:focus-visible .l { transform: translate(-14%, -4%) rotate(-13deg); }
.card a:hover .r, .card a:focus-visible .r { transform: translate(14%, -6%) rotate(12deg); }
.card a:hover .go, .card a:focus-visible .go { transform: rotate(-45deg); }

@media (max-width: 860px) {
  main.home { grid-template-columns: 1fr; }
  .tiles-name, .intro { margin-inline: auto; max-width: 420px; }
}
@media (max-width: 760px) { .cards { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ inner pages */

main.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(3rem, 7vw, 6rem); padding: 0 var(--pad); }

/* hero: the homepage colour card, opened up */
.hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 2rem; align-items: center;
  min-height: min(76vh, 680px); padding: clamp(1.5rem, 4vw, 3.5rem); border-radius: 28px; background: var(--c); color: var(--fc);
}
.hero h1 { margin: 0; font: 700 clamp(2.8rem, 6.4vw, 6.6rem)/.85 "Rubik", sans-serif; letter-spacing: -.06em; text-transform: uppercase; overflow-wrap: anywhere; }
.hero h1.long { font-size: clamp(2.3rem, 4.5vw, 4.8rem); }
.hero p { margin: 1.25rem 0 0; max-width: 30ch; font-size: clamp(1.05rem, 1.5vw, 1.3rem); line-height: 1.35; font-weight: 500; }
.tag { display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1.25rem; padding: .45rem .9rem; border-radius: 999px; background: var(--bg); color: var(--ink); font-weight: 600; font-size: .85rem; }
.tag i { width: 10px; height: 10px; border-radius: 50%; }

.stage { position: relative; aspect-ratio: 5/4; }
.stage .p { position: absolute; overflow: hidden; border-radius: 14px; box-shadow: 0 22px 44px -16px rgba(0, 0, 0, .45); transition: transform .6s cubic-bezier(.3, 1.3, .5, 1); }
.stage .main { z-index: 3; left: 50%; top: 52%; width: 74%; aspect-ratio: 16/9; transform: translate(-50%, -50%); }
.stage .l { z-index: 2; left: 0; bottom: 2%; width: 34%; aspect-ratio: 4/5; transform: rotate(-8deg); }
.stage .r { z-index: 2; right: 0; top: 2%; width: 34%; aspect-ratio: 4/5; transform: rotate(7deg); }
.hero:hover .stage .l { transform: translate(-6%, 2%) rotate(-13deg); }
.hero:hover .stage .r { transform: translate(6%, -2%) rotate(12deg); }
.hero:hover .stage .main { transform: translate(-50%, -54%) scale(1.03); }

/* section headings carry one of the shapes */
.sec h2 { display: flex; align-items: center; gap: .7rem; margin: 0 0 1.25rem; font: 700 clamp(1.6rem, 3.4vw, 3rem)/1 "Rubik", sans-serif; letter-spacing: -.045em; text-transform: uppercase; }
.sec h2 .ico { width: .7em; height: .7em; }
.sec h2 small { margin-left: auto; font-size: .9rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); }

/* artwork: a soft lift and a slow zoom on hover */
.art { display: block; overflow: hidden; border-radius: 18px; background: #e7e3da; transition: transform .4s var(--ease), box-shadow .4s; }
.art img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.art:hover { transform: translateY(-4px); box-shadow: 0 18px 34px -18px rgba(0, 0, 0, .35); }
.art:hover img { transform: scale(1.025); }

.g { display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); gap: var(--gap); }
.g + .g { margin-top: var(--gap); }
.g1 { --cols: 1; } .g2 { --cols: 2; } .g3 { --cols: 3; }
.g .art { aspect-ratio: var(--ar); }
.g.shadow .art { box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .4); }
.panel { padding: clamp(1rem, 2.5vw, 2rem); border-radius: 28px; background: var(--c); }
.panel .art { background: transparent; }

/* next project */
.next { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: clamp(1.25rem, 3vw, 2.25rem); border-radius: 28px; background: var(--c); color: var(--fc); }
.next small { display: block; margin-bottom: .4rem; font-weight: 500; font-size: .9rem; opacity: .85; }
.next b { font: 700 clamp(2rem, 5vw, 4.5rem)/.9 "Rubik", sans-serif; letter-spacing: -.055em; text-transform: uppercase; }
.next .go { flex: none; width: 3.4rem; height: 3.4rem; font-size: 1.4rem; }
.next:hover .go { transform: rotate(-45deg); }

.round { flex: none; display: grid; place-items: center; width: 3rem; height: 3rem; padding: 0; border: 0; border-radius: 50%; background: var(--bg); color: var(--ink); font: 500 1.2rem/1 "Rubik", sans-serif; cursor: pointer; transition: transform .35s var(--spring), opacity .2s; }
.round:hover { transform: scale(1.08); }
.round:disabled { opacity: .35; cursor: default; transform: none; }

.pill { display: inline-flex; align-items: center; gap: .6rem; margin-top: 1.75rem; padding: .7rem .8rem .7rem 1.1rem; border-radius: 999px; background: var(--bg); color: var(--ink); font-weight: 600; transition: background .3s, color .3s; }
.pill i { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--ink); color: var(--bg); font-style: normal; transition: transform .45s cubic-bezier(.6, 0, .2, 1); }
.pill:hover i { transform: rotate(-45deg); }

.blurb { margin: 0; max-width: 46ch; font-size: clamp(1rem, 1.3vw, 1.15rem); line-height: 1.45; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .g3 { --cols: 2; }
  .g2 { --cols: 1; }
}

/* ------------------------------------------------------------------ comics */

/* the shelf of covers in the hero */
.hero--shelf { grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); }
.shelf { display: flex; align-items: flex-end; justify-content: center; gap: clamp(.6rem, 1.6vw, 1.4rem); padding-bottom: 1.4rem; border-bottom: 6px solid rgba(255, 255, 255, .9); }
.shelf__item { flex: 1 1 0; max-width: 190px; display: grid; gap: .7rem; justify-items: center; color: #fff; text-align: center; font-weight: 600; font-size: .85rem; }
.cov { display: block; width: 100%; aspect-ratio: .63; overflow: hidden; border-radius: 10px; box-shadow: 0 18px 30px -16px rgba(0, 0, 0, .6); transition: transform .45s cubic-bezier(.3, 1.5, .5, 1); }
.cov img { width: 100%; height: 100%; object-fit: cover; }
.shelf__item:nth-child(odd) .cov { transform: rotate(-2deg); }
.shelf__item:nth-child(even) .cov { transform: rotate(2deg); }
.shelf__item:hover .cov, .shelf__item:focus-visible .cov { transform: translateY(-10px) rotate(0); }
.shelf__label { display: inline-flex; align-items: center; gap: .4rem; }
.shelf__label i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }

/* one open book per story */
.book { scroll-margin-top: 1.5rem; }
.book__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem 3rem; align-items: end; margin-bottom: 1.25rem; }
.book__head h2 { margin: 0; }
.desk { display: grid; justify-items: center; gap: 1.25rem; padding: clamp(1.25rem, 3vw, 2.5rem); border-radius: 28px; background: var(--c); color: var(--fc); }
.spread { list-style: none; margin: 0; padding: 0; }
.pg a { display: block; height: 100%; }
.pg img { width: 100%; height: 100%; object-fit: contain; }

/* without the script: every page in a sideways-scrolling strip */
html:not(.js) .spread { display: flex; gap: var(--gap); width: 100%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .5rem; }
html:not(.js) .pg { flex: none; height: min(78vh, 900px); aspect-ratio: .63; scroll-snap-align: start; overflow: hidden; border-radius: 12px; background: #fff; }
html:not(.js) .deskbar .round, html:not(.js) .pips, html:not(.js) .deskbar output { display: none; }

/* with it: a two-page spread with a spine down the middle */
.js .spread { position: relative; display: grid; grid-template-columns: 1fr 1fr; width: min(100%, calc(80vh * 1.26), 1140px); aspect-ratio: 1.26; }
.js .spread::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: linear-gradient(rgba(0, 0, 0, .25), rgba(0, 0, 0, .08), rgba(0, 0, 0, .25)); }
.js .spread.solo { grid-template-columns: 1fr; width: min(100%, calc(80vh * .63), 570px); aspect-ratio: .63; }
.js .spread.solo::after, .js .spread.half::after { display: none; }
.js .pg { position: relative; overflow: hidden; background: #fff; box-shadow: 0 24px 40px -22px rgba(0, 0, 0, .55); border-radius: 2px 12px 12px 2px; }
.js .pg.left { border-radius: 12px 2px 2px 12px; }
.js .spread.solo .pg { border-radius: 12px; }
.js .pg.blank { background: transparent; box-shadow: none; }
.js .pg[hidden] { display: none; }
.spread.turn .pg { animation: flip-r .5s var(--ease) both; }
.spread.turn.back .pg { animation-name: flip-l; }
.spread.turn .pg:not(.left) { animation-delay: .06s; }
@keyframes flip-r { from { opacity: 0; transform: perspective(1200px) rotateY(-14deg) translateX(14px); } }
@keyframes flip-l { from { opacity: 0; transform: perspective(1200px) rotateY(14deg) translateX(-14px); } }

.deskbar { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.deskbar output { min-width: 8.5rem; text-align: center; }
.pips { display: flex; gap: .4rem; }
.pips i { width: 10px; height: 10px; border-radius: 50%; background: currentColor; opacity: .3; transition: opacity .3s, transform .3s; }
.pips i.on { opacity: 1; transform: scale(1.3); }
.nextstory { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1rem; border-radius: 999px; background: var(--bg); color: var(--ink); font-weight: 600; font-size: .85rem; }
.js .nextstory { display: none; }
.js .nextstory.show { display: inline-flex; }

@media (max-width: 820px) {
  .hero--shelf { grid-template-columns: 1fr; }
  .shelf__label b { display: none; }
  .book__head { grid-template-columns: 1fr; }
  .js .spread, .js .spread.solo { grid-template-columns: 1fr; width: 100%; aspect-ratio: .63; }
  .js .spread::after { display: none; }
  .js .pg.blank { display: none; }
  .js .pg, .js .pg.left { border-radius: 12px; }
  .deskbar { gap: .6rem; }
  .deskbar output { min-width: 0; }
}

/* ------------------------------------------------------------ illustration */

/* masonry; site.js deals pieces into columns so rows read left to right */
.wall { columns: 3 280px; column-gap: var(--gap); }
.wall .art { position: relative; break-inside: avoid; margin-bottom: var(--gap); background: var(--c); }
.wall .art img { height: auto; }
.wall .art i { position: absolute; right: .8rem; bottom: .8rem; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--bg); font-style: normal; font-weight: 600;
  opacity: 0; transform: scale(.6) rotate(-45deg); transition: opacity .25s, transform .4s var(--spring); }
.wall .art:hover i, .wall .art:focus-visible i { opacity: 1; transform: none; }
.wall.cols { columns: auto; display: flex; align-items: flex-start; gap: var(--gap); }
.wall.cols .col { flex: 1 1 0; min-width: 0; }

.video { padding: clamp(1rem, 2.5vw, 2rem); border-radius: 28px; background: var(--c); }
.video video { width: 100%; height: auto; border-radius: 16px; background: #000; }

/* ------------------------------------------------------------------- about */

.hero--about { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.hero--about p { max-width: 42ch; }
.me--big { width: min(100%, 360px); margin: 0 auto; }
.me--big img { width: 100%; }
.hero--plain { grid-template-columns: 1fr; min-height: 50vh; }

@media (max-width: 820px) { .hero--about { grid-template-columns: 1fr; } .hero--about .me--big { order: -1; width: min(70%, 300px); } }

/* ------------------------------------------------------------------ viewer */

.viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--c, var(--ink)); color: var(--fc, #fff); transition: background .4s; }
.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); animation: pop .3s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(.98); } }
.viewer__top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem var(--pad); font-weight: 600; font-variant-numeric: tabular-nums; }
.viewer__mid { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem; height: 100%; min-height: 0; padding: 0 var(--pad) 1.5rem; }
.viewer figure { position: relative; height: 100%; min-height: 0; }
.viewer figure img { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6); }
.viewer figure img.turn { animation: slide .35s var(--ease); }
@keyframes slide { from { opacity: 0; transform: translateX(calc(var(--d, 1) * 18px)); } }
.viewer__mid .round { width: 3.6rem; height: 3.6rem; font-size: 1.4rem; }
[data-lb] { cursor: zoom-in; }

@media (max-width: 820px) {
  .viewer__mid { grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .viewer figure { grid-column: 1 / -1; grid-row: 1; }
  .viewer__mid .round { justify-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
