/* thaxnay.com: the homepage and its galleries. (The game at /ramayana/ has its own page and its own styles.)
   White paper, one typeface, no colour of its own: the colour and the movement on the page are his work's. */

/* Schibsted Grotesk throughout (Thax, 25 Nov 2026), one file holding every weight from 400 to 900. SIL Open Font Licence. */
/* (and one serif, in italic only, for the two small dictionary lines in his introduction: how his name is said, and where it came from. Noto Serif, at Thax's asking; SIL Open Font Licence.) */
@font-face { font-family: 'Noto Serif'; font-style: italic; font-weight: 400; src: url('/fonts/NotoSerif-Italic-latin.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Schibsted Grotesk'; font-weight: 400 900; src: url('/fonts/SchibstedGrotesk-latin.woff2') format('woff2'); font-display: swap; }

:root { --paper: #fff; --ink: #101010; --soft: #707070; --rule: #e4e4e4; --hold: #f3f3f3;
        --plain: 'Schibsted Grotesk', -apple-system, 'Helvetica Neue', Arial, sans-serif;
        --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
        --side: max(clamp(20px, 5vw, 72px), env(safe-area-inset-left, 0px)); }
html { background: var(--paper); scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.5 var(--plain); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--ink); color: var(--paper); }
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 var(--side); }

header { display: flex; justify-content: space-between; align-items: baseline; padding-top: max(28px, env(safe-area-inset-top, 0px)); font: 500 15px/1 var(--plain); letter-spacing: -0.005em; }
header nav { display: flex; gap: clamp(18px, 2.4vw, 30px); }
header nav a { color: var(--soft); transition: color 0.2s ease; }
header nav a:hover, header nav a:focus-visible { color: var(--ink); outline: none; }

/* (his budgie in the top corner: room is kept for him from the start on screens that draw, and his name is not shown there) */
#bird { display: none; }
.draws .home header { align-items: center; padding-top: max(14px, env(safe-area-inset-top, 0px)); }
.draws #home { display: block; margin-left: -8px; }
.draws #home .name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.draws #bird { display: block; width: 60px; height: 56px; opacity: 0; transition: opacity 0.5s ease; }
.birdy #bird { opacity: 1; }
/* (his best flight, in small grey beside Yoshi, once he has flown) */
#best { margin-right: auto; margin-left: 10px; font-size: 12.5px; color: var(--soft); }

/* A link: a hairline under it that darkens when pointed at; one that leaves the site carries a small arrow. */
.go { font-weight: 500; padding-bottom: 3px; background: linear-gradient(var(--ink), var(--ink)) 0 100% / 100% 1px no-repeat; transition: opacity 0.2s ease; }
.go:hover, .go:focus-visible { opacity: 0.5; outline: none; }
.go[hidden] { display: none; }
.go[target="_blank"]::after { content: ''; display: inline-block; width: 0.56em; height: 0.56em; margin-left: 0.32em; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.5 8.5 8.5 1.5M3 1.5h5.5V7' fill='none' stroke='%23000' stroke-width='1.4'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.5 8.5 8.5 1.5M3 1.5h5.5V7' fill='none' stroke='%23000' stroke-width='1.4'/%3E%3C/svg%3E") center / contain no-repeat; }
/* A place to find him: a small outlined badge, which fills when pointed at. */
.tag { display: inline-flex; align-items: center; height: 27px; padding: 0 11px; box-sizing: border-box; border: 1px solid var(--rule); border-radius: 999px;
       font: 500 12.5px/1 var(--plain); letter-spacing: 0; white-space: nowrap; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease; }
.tag:hover, .tag:focus-visible { background: var(--ink); border-color: var(--ink); color: var(--paper); outline: none; }
.tag[hidden] { display: none; }
.away { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.away i { font-style: normal; font-weight: 400; font-size: 12.5px; color: var(--soft); }

/* ---- who he is: words on the left, his picture on the right ---- */
#me { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: clamp(32px, 6vw, 96px); align-items: end; padding: clamp(56px, 12vh, 132px) 0 clamp(52px, 9vh, 104px); }
.none #me { grid-template-columns: minmax(0, 1fr); }
/* (the trial figure: drawn in the photograph's own space, which it takes over once it is ready) */
#me figure { position: relative; }
#stick { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.6s ease; }
#photo { transition: opacity 0.6s ease; }
figure.live #stick { opacity: 1; }
figure.live #photo { opacity: 0; }
.draws #photo { opacity: 0; }
h1 { margin: 0 0 0 -0.03em; font: 500 clamp(40px, 5.4vw, 84px)/0.98 var(--plain); letter-spacing: -0.045em; }
#lede { margin: clamp(20px, 2.4vw, 32px) 0 0; max-width: 24em; font-size: clamp(19px, 1.75vw, 24px); line-height: 1.36; letter-spacing: -0.012em; }
.unseen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* (with no heading shown above it, the sentence about him leads: larger, and tighter) */
.home #lede { margin-top: 0; max-width: 19em; font-size: clamp(22px, 2.6vw, 27px); line-height: 1.28; letter-spacing: -0.025em; }
/* ---- his introduction, as a dictionary entry: the word, how it is said and what kind of word it is, its senses numbered ---- */
#entry h1 { margin: 0; font: 500 clamp(34px, 4.6vw, 46px)/1 var(--plain); letter-spacing: -0.04em; }
#entry .said { margin: 9px 0 0; font: italic 400 16.5px/1.2 'Noto Serif', Georgia, 'Times New Roman', serif; color: var(--soft); }
#entry .said span { margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--rule); }
#entry ol { margin: 18px 0 0; padding: 0; list-style: none; counter-reset: sense; max-width: 24em; }
#entry li { position: relative; padding-left: 26px; counter-increment: sense; font-size: clamp(16px, 1.75vw, 17.5px); line-height: 1.4; letter-spacing: -0.012em; }
#entry li + li { margin-top: 6px; }
#entry li::before { content: counter(sense); position: absolute; left: 0; top: 0.2em; font-size: 12.5px; line-height: 1.38; color: var(--soft); font-variant-numeric: tabular-nums; }
#entry .from { margin: 14px 0 0; padding-left: 26px; font: italic 400 14px/1.4 'Noto Serif', Georgia, 'Times New Roman', serif; color: var(--soft); }
#entry .from span { margin-right: 6px; font: 500 10.5px/1 var(--plain); letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink); }
#entry a { padding-bottom: 1px; background: linear-gradient(var(--ink), var(--ink)) 0 100% / 100% 1px no-repeat; transition: opacity 0.2s ease; }
#entry a:hover, #entry a:focus-visible { opacity: 0.5; outline: none; }
#lede a { padding-bottom: 1px; background: linear-gradient(var(--ink), var(--ink)) 0 100% / 100% 1px no-repeat; transition: opacity 0.2s ease; }
#lede a:hover, #lede a:focus-visible { opacity: 0.5; outline: none; }
#reach { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: clamp(26px, 3.4vw, 40px); }
figure { margin: 0; }
#photo { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--hold); }
.none #me figure { display: none; }

/* ---- a section's own heading: its name on a hairline, a count at the far end ---- */
h2 { display: flex; justify-content: space-between; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--ink); font: 500 15px/1 var(--plain); letter-spacing: -0.005em; }
h2 span { color: var(--soft); font-weight: 400; font-variant-numeric: tabular-nums; }

/* ---- work: one wide moving frame, then a row of four upright ones. Each piece is shown in its own medium: the game
        plays, the photographs turn over as the pointer crosses them. ---- */
#made { padding-bottom: clamp(48px, 9vh, 104px); }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(28px, 4vw, 52px) clamp(14px, 2vw, 28px); padding-top: clamp(20px, 2.6vw, 30px); }
.tile.wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); }
.frame { display: block; position: relative; overflow: hidden; aspect-ratio: 4 / 5; background: var(--hold); }
.wide .frame { aspect-ratio: 16 / 9; max-height: 74vh; width: 100%; }
.frame img, .frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease), opacity 0.35s ease; }
.tile:hover .frame > img:only-child, .tile:hover .frame video { transform: scale(1.025); }
.frame.turn img { opacity: 0; }
.frame.turn img.on { opacity: 1; }
/* (which of its pictures a turning frame is on: a row of hairlines under it) */
.ticks { display: flex; gap: 3px; height: 2px; margin-top: 8px; }
.ticks i { flex: 1; background: var(--rule); transition: background 0.2s ease; }
.ticks i.on { background: var(--ink); }
/* (a frame with no hairlines under it leaves the same room, so every caption in the row starts on one line) */
.cap { padding-top: 22px; }
.ticks + .cap { padding-top: 12px; }
.meta { display: flex; gap: 10px; font-size: 13px; line-height: 1; color: var(--soft); letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.tile h3 { margin: 10px 0 0; font: 500 clamp(20px, 1.7vw, 24px)/1.12 var(--plain); letter-spacing: -0.025em; }
.tile p { margin: 8px 0 0; max-width: 30em; font-size: 15.5px; line-height: 1.45; color: var(--soft); }
.tile .links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 14px; font-size: 15px; }
.wide .cap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(18px, 3vw, 44px); align-items: start; padding-top: 16px; }
.wide h3 { font-size: clamp(26px, 3vw, 40px); letter-spacing: -0.035em; line-height: 1.04; }
.wide p { margin-top: 0; font-size: 17px; }

/* ---- his career: a plain list, years then the job then where ---- */
#work { padding-bottom: clamp(48px, 9vh, 104px); }
.job { display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr); gap: clamp(14px, 2vw, 28px); align-items: baseline; padding: 15px 0; border-bottom: 1px solid var(--rule); }
.job span { color: var(--soft); }
.job span:first-child { font-size: 14px; font-variant-numeric: tabular-nums; }
.job b { font-weight: 500; font-size: clamp(18px, 1.6vw, 21px); letter-spacing: -0.015em; }
.note { margin: 0; padding-top: 18px; color: var(--soft); font-size: 15.5px; }
.note .go { color: var(--ink); margin-left: 6px; white-space: nowrap; }

#contact { padding: clamp(28px, 6vh, 70px) 0 clamp(44px, 8vh, 90px); }
#contact p { margin: 0 0 0 -0.03em; font: 500 clamp(34px, 5.4vw, 84px)/0.98 var(--plain); letter-spacing: -0.045em; }
#contact .links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: clamp(24px, 3vw, 36px); }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 18px 0 max(28px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--rule); color: var(--soft); font-size: 13.5px; }

/* ---- things arrive, once, as they are scrolled to (only when the page's script is running) ---- */
.js .rise { opacity: 0; transform: translateY(14px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js .rise.in { opacity: 1; transform: none; }
.tile { --wait: 0s; }
.tiles .tile:nth-child(3) { --wait: 0.08s; }
.tiles .tile:nth-child(4) { --wait: 0.16s; }
.tiles .tile:nth-child(5) { --wait: 0.24s; }
.js .tile .frame { clip-path: inset(0 0 100% 0); transition: clip-path 1.1s var(--ease) var(--wait); }
.js .tile.in .frame { clip-path: inset(0); }
.js .tile .cap, .js .tile .ticks { opacity: 0; transform: translateY(10px); transition: opacity 0.8s var(--ease) calc(var(--wait) + 0.25s), transform 0.8s var(--ease) calc(var(--wait) + 0.25s); }
.js .tile.in .cap, .js .tile.in .ticks { opacity: 1; transform: none; }

/* ---- a gallery: its name, a line about it, then its pictures in sets ---- */
#about { padding: clamp(48px, 10vh, 110px) 0 clamp(40px, 7vh, 80px); }
#about h1 { font-size: clamp(38px, 4.4vw, 64px); }
#about p { margin: clamp(18px, 2.4vw, 28px) 0 0; max-width: 28em; font-size: clamp(19px, 1.75vw, 23px); line-height: 1.38; letter-spacing: -0.012em; }
.set { padding-bottom: clamp(36px, 6vh, 70px); }
.pics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 22px); align-items: start; padding-top: 18px; }
.pics a { display: block; }
.pics img { display: block; width: 100%; height: auto; background: var(--hold); }
.pics a:hover img, .pics a:focus-visible img { opacity: 0.88; }
.pics figcaption { margin-top: 8px; font-size: 14px; line-height: 1.35; color: var(--soft); }
#back { display: inline-block; margin: 0 0 clamp(40px, 7vh, 80px); }

/* ---- the homepage alone is a slim column down the middle of the screen (Thax, 25 Nov 2026: "for just the home page
        (not the project pages) i like the idea of the width being slimmer. its cute and very tasteful"). Everything in
        it is a size smaller to suit, and the four upright frames go two by two. ---- */
/* (the homepage's four small frames are square, on every screen: two to a row, upright ones stood too tall. Thax, 25 Nov 2026: "all four of these feel too tall now", and of phones, where they had been left upright: "their aspect ratio seems diff than desktop") */
.home .tile:not(.wide) .frame { aspect-ratio: 1 / 1; }
@media (min-width: 761px) {
  .home .wrap { max-width: 800px; }
  .home #me { grid-template-columns: minmax(0, 1fr) 236px; gap: 40px; padding: clamp(48px, 10vh, 104px) 0 clamp(44px, 7vh, 80px); }
  .home h1 { font-size: clamp(36px, 5vw, 50px); letter-spacing: -0.04em; }
  .home #reach { margin-top: 26px; }
  .home .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 22px; padding-top: 22px; }
  .home .wide .cap { gap: 28px; }
  .home .wide h3 { font-size: 27px; letter-spacing: -0.03em; }
  .home .wide p { font-size: 15.5px; }
  .home .job { grid-template-columns: 118px minmax(0, 1fr) minmax(0, 1fr); gap: 18px; padding: 13px 0; }
  .home .job b { font-size: 18px; }
  .home .job span { font-size: 15.5px; }
  .home #contact { padding: clamp(24px, 5vh, 56px) 0 clamp(40px, 7vh, 72px); }
  .home #contact p { font-size: clamp(32px, 5vw, 46px); letter-spacing: -0.04em; }
}

@media (max-width: 980px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  #me { grid-template-columns: minmax(0, 1fr); align-items: start; padding-top: 40px; }
  #me figure { order: -1; width: min(62%, 240px); }
  .wide .cap { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .wide p { margin-top: 8px; font-size: 15.5px; }
  .job { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .job span:first-child { order: 3; }
  .pics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rise, .js .tile .frame, .js .tile .cap, .js .tile .ticks { opacity: 1; transform: none; clip-path: none; transition: none; }
  .frame img, .frame video { transition: none; }
}
