/* ==========================================================
   Arkitype369 — shared stylesheet
   1. Tokens and base      4. Archetype pages
   2. Shared sections      5. Artwork lightbox
      (incl. contact button)
   3. Home page            6. Carousel
                           7. Reduced motion
   ========================================================== */

/* 1. Tokens and base */
:root{
  --marble:#0c0c0d; --slab:#1a1a1c; --ink:#f2f2f0; --soft:#a3a3a0; --soft-light:#d1d1d0; --night:#000;
    --gold:#d68a38;
  --gold-hover:#e0cfaa;
  --carve:'Archivo Black','Arial Black',Impact,sans-serif;
  --body:'Spectral',Georgia,'Times New Roman',serif;
  /* Gold corner brackets, shared by the lightbox buttons and the carousel focus frame */
  --brackets:
    linear-gradient(var(--gold),var(--gold)) left top/20px 2px no-repeat,
    linear-gradient(var(--gold),var(--gold)) left top/2px 20px no-repeat,
    linear-gradient(var(--gold),var(--gold)) right top/20px 2px no-repeat,
    linear-gradient(var(--gold),var(--gold)) right top/2px 20px no-repeat,
    linear-gradient(var(--gold),var(--gold)) left bottom/20px 2px no-repeat,
    linear-gradient(var(--gold),var(--gold)) left bottom/2px 20px no-repeat,
    linear-gradient(var(--gold),var(--gold)) right bottom/20px 2px no-repeat,
    linear-gradient(var(--gold),var(--gold)) right bottom/2px 20px no-repeat;
  color-scheme:dark;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--marble);color:var(--ink);font:400 1.125rem/1.7 var(--body);-webkit-font-smoothing:antialiased}
a{color:var(--gold)}
:focus-visible{outline:2px solid var(--gold);outline-offset:3px}

/* 2. Shared sections */
section{max-width:1100px;margin:0 auto;padding:4rem 1.5rem}
h2{font-family:var(--carve);font-weight:400;font-size:clamp(1.5rem,4vw,2.3rem);letter-spacing:.02em;margin:0 0 .5rem}
.note{max-width:38rem;color:var(--soft);margin:0 0 2.5rem}
footer{max-width:1100px;margin:0 auto;padding:3rem 1.5rem 5rem;border-top:1px solid var(--slab);color:var(--soft);font-size:1rem}

/* Contact button: white with corner brackets, turns gold on hover */
.contact{position:relative;display:inline-block;padding:.385rem .77rem;font-family:var(--carve);font-size:.9rem;letter-spacing:.08em;line-height:1.2;text-decoration:none;color:#fff;--line:#fff}
.contact::after{content:"";position:absolute;inset:0;pointer-events:none;opacity:.7;
  background:
    linear-gradient(var(--line),var(--line)) left top/10px 2px no-repeat,
    linear-gradient(var(--line),var(--line)) left top/2px 10px no-repeat,
    linear-gradient(var(--line),var(--line)) right top/10px 2px no-repeat,
    linear-gradient(var(--line),var(--line)) right top/2px 10px no-repeat,
    linear-gradient(var(--line),var(--line)) left bottom/10px 2px no-repeat,
    linear-gradient(var(--line),var(--line)) left bottom/2px 10px no-repeat,
    linear-gradient(var(--line),var(--line)) right bottom/10px 2px no-repeat,
    linear-gradient(var(--line),var(--line)) right bottom/2px 10px no-repeat}
.contact:hover{color:var(--gold);--line:var(--gold)}
.contact:hover::after{opacity:1}
.contact:focus-visible{outline:2px solid var(--gold);outline-offset:3px}

/* 3. Home page */
.hero{min-height:88vh;display:flex;flex-direction:column;justify-content:center;padding:6rem 1.5rem 4rem;max-width:1100px;margin:0 auto}
/* Slides the button 60% of the way down to the top of the A (the A sits about 11.5% of the logo width below the image top) */
.hero .contact{align-self:flex-start;margin:0 0 2.5rem;top:calc(.6 * (2.5rem + .1154 * min(100vw - 3rem, 900px)))}
.hero h1{margin:0}
.hero h1 img{display:block;width:min(100%,900px);height:auto}
.hero .lede{margin-top:2rem}
.hero .lede p{margin:0 0 1rem;font-size:1.3rem;font-style:italic;color:var(--soft)}
.hero .lede p:last-child{margin-bottom:0}
.hero .enter{align-self:flex-start;margin-top:2.5rem;font-family:var(--carve);letter-spacing:.08em;font-size:.95rem;text-decoration:none}
.hero .enter:hover{text-decoration:underline;text-underline-offset:.3em}

.story p{margin:0 0 1.2rem;color:var(--soft-light)}
.story p strong{color:var(--ink)}
.story{border-top:1px solid var(--slab)}
.story-copy p:last-child{margin-bottom:0}
#exhibits .note,#garments .note{max-width:none}
.story-toggle{margin:.75rem 0 1.5rem;padding:0;border:0;background:none;color:var(--gold);font:400 .95rem var(--carve);letter-spacing:.04em;cursor:pointer}
.story-toggle:hover{text-decoration:underline;text-underline-offset:.3em}
.story-toggle:focus-visible{outline:2px solid var(--gold);outline-offset:3px}

.triad{margin:0 0 4rem}
.triad h3{font-family:var(--carve);font-weight:400;font-size:1.1rem;letter-spacing:.06em;margin:0 0 1rem;color:var(--gold)}
.triad:nth-child(2) h3{color:#4767E1}
.triad:nth-child(3) h3{color:#A3DD61}
.row{display:grid;gap:1rem;grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
.exhibit{all:unset;box-sizing:border-box;display:flex;flex-direction:column;cursor:pointer;background:var(--slab);border:1px solid color-mix(in srgb,var(--ink) 14%,transparent)}
.exhibit:focus-visible{outline:2px solid var(--gold);outline-offset:3px}
.frame{position:relative;aspect-ratio:16/9;background:var(--night);overflow:hidden}
.frame .thumb{width:100%;height:100%;object-fit:cover;display:block}
/* Hover (mouse only): thumbnail brightens and zooms; play icon glows gold when the pointer is on it */
@media (hover:hover){
  .frame .thumb{filter:brightness(.85);transition:transform .6s ease,filter .4s ease}
  .exhibit:hover .thumb,.exhibit:focus-visible .thumb{transform:scale(1.06);filter:brightness(1.1)}
  .play i:hover{border-color:#ffd24a;box-shadow:0 0 6px 1px rgba(255,210,74,.9),0 0 16px 3px rgba(255,210,74,.5)}
}

.play{
    position:absolute;
    inset:0;
    display:flex;
    justify-content:flex-end;
    align-items:flex-start;
    padding:19px;
    pointer-events:none;
}

.play i{
    width:2rem;
    height:2rem;
    border-radius:500%;
    background:rgba(232,154,58,0.35);
    border:1px solid #F5C16C;
    color:#111;
    display:grid;
    place-items:center;
    pointer-events:auto;
    transition:border-color .25s ease,box-shadow .25s ease;
}
.play i::before{
    content:"";
    width:0;
    height:0;
    border-top:0.65rem solid transparent;
    border-bottom:0.65rem solid transparent;
    border-left:1rem solid #111;
    margin-left:4px;
}

.plaque{padding:.9rem 1rem 1.1rem}
.plaque b{display:block;font-family:var(--carve);font-weight:400;letter-spacing:.03em;font-size:1.05rem}
.plaque span{display:block;font-size:.98rem;color:var(--soft);line-height:1.45;margin-top:.2rem}

/* Garments (hidden until the GARMENTS list on the home page has entries) */
.garments{display:grid;gap:1rem;grid-template-columns:repeat(auto-fill,minmax(240px,1fr))}
.garments figure{margin:0}
.garments img{width:100%;display:block;background:var(--slab)}
.garments figcaption{font-size:.98rem;color:var(--soft);padding-top:.4rem}

/* 4. Archetype pages */
.top{display:flex;justify-content:space-between;align-items:center;gap:1rem;max-width:1100px;margin:0 auto;padding:1rem 1.5rem}
.top img{height:2.6rem;width:auto;display:block}
/* All three navigation links share one consistent text treatment and equal space. */
.top>a:not(:first-child){flex:1 1 0;text-align:center;white-space:nowrap}
.top a.back,
.top a.gallery-link{display:inline-block;margin:0;color:var(--ink);font-family:var(--carve);font-size:.9rem;font-weight:400;text-decoration:none}
.top a.back:hover,
.top a.gallery-link:hover{color:var(--gold);text-decoration:none}
/* Phone screens: logo on its own row, with all navigation links evenly spaced below */
@media (max-width:480px){
  .top{flex-wrap:wrap;row-gap:.9rem;column-gap:.65rem}
  .top>a:first-child{flex:0 0 100%}
  .top a.back,
  .top a.gallery-link{font-size:.8rem}
  .top .contact{margin:0;padding-left:.5rem;padding-right:.5rem;font-size:.8rem}
}
.page{max-width:1100px;margin:0 auto;padding:1rem 1.5rem 3rem}
.page h1{font-family:var(--carve);font-weight:400;font-size:clamp(2.4rem,8vw,5rem);line-height:1;margin:1rem 0 .6rem}
.page .trait{font-style:italic;color:var(--soft);font-size:1.25rem;max-width:36rem;margin:0 0 2rem}
.film-wrap{position:relative;width:100%;aspect-ratio:16/9;background:#000}
.film{width:100%;height:100%;display:block;background:#000}

/* Small portrait phones: make the video block exactly the viewport width */
@media screen and (max-width:430px) and (orientation:portrait){
  .film-wrap{
    width:100vw;
    max-width:100vw;
    margin-left:calc(50% - 50vw);
  }
  .film{
    width:100%;
    height:100%;
  }
}
.film-wrap:focus-within::after{content:"";position:absolute;inset:0;pointer-events:none;opacity:.7;background:var(--brackets)}
.stages{margin-top:3.5rem}
.animal-description{display:block;width:100%;max-width:none;color:#fff;margin:0 0 2.5rem}
.walk{display:flex;justify-content:space-between;gap:1rem;max-width:1100px;margin:0 auto;padding:2rem 1.5rem 4rem;border-top:1px solid var(--slab)}
.walk a{color:var(--ink);font-family:var(--carve);text-decoration:none}
.walk a:hover{color:var(--gold)}
.walk small{display:block;font:400 .9rem var(--body);color:var(--soft)}
.walk .next{text-align:right;margin-left:auto}

/* 5. Artwork lightbox */
dialog#lb{border:0;padding:0;background:var(--marble);color:#fff;width:100vw;height:100vh;max-width:none;max-height:none}
dialog#lb::backdrop{background:var(--marble)}
.lbstage{height:100%;display:grid;grid-template-rows:auto 1fr auto;padding:.8rem 1rem;gap:.6rem}
.lbview{min-height:0;overflow:auto;display:flex;overscroll-behavior:contain}
.lbview img{max-width:100%;max-height:100%;margin:auto;display:block;object-fit:contain;flex:none}
.lbview.zoomable:not(.zoomed) img{cursor:zoom-in}
.lbview.zoomed{cursor:grab}
.lbview.zoomed img{max-width:none;max-height:none;cursor:zoom-out}
.lbstage .bar{display:flex;justify-content:space-between;align-items:center;gap:1rem;font-family:var(--carve)}
.lbstage .nav{display:flex;justify-content:center;gap:1rem}
.lbstage button{font:inherit;background:none;color:#fff;border:1px solid rgba(255,255,255,.5);padding:.4rem 1rem;cursor:pointer}
.lbstage .bar button{position:relative;border:0;color:var(--gold);background:transparent;padding:.55rem 1rem}
.lbstage .bar button::after{content:"";position:absolute;inset:0;pointer-events:none;opacity:.7;background:var(--brackets)}
.lbstage .bar button:hover{color:var(--gold-hover)}
.lbstage .bar button:hover::after{opacity:1}
.lbstage .bar button:focus-visible{outline:2px solid var(--gold);outline-offset:3px}

/* Close control: a quiet, floating mark above the artwork */
#lbclose{
  position:fixed;
  top:1rem;
  right:1.25rem;
  z-index:10;
  width:2.75rem;
  height:2.75rem;
  display:grid;
  place-items:center;
  padding:0;
  border:0;
  background:transparent;
  color:var(--gold);
  font-size:0;
  line-height:1;
  cursor:pointer;
  opacity:.85;
}

#lbclose::before{content:"×";font-family:var(--body);font-size:2.5rem;font-weight:400}
#lbclose:hover{color:var(--gold-hover);opacity:1}
#lbclose:focus-visible{outline:2px solid var(--gold);outline-offset:3px}
@media(max-width:640px){#lbclose{top:.55rem;right:.65rem}}

/* 6. Carousel (markup is built by animal.js) */
.carousel{position:relative;overflow:hidden;outline:none;touch-action:pan-y}
.carousel:focus-visible{outline:none}
.carousel:focus-visible::after{content:"";position:absolute;inset:0;pointer-events:none;opacity:.7;background:var(--brackets)}
.track{display:flex;gap:16px;transition:transform .45s ease;will-change:transform}
.slide{flex:0 0 min(56%,560px);height:min(68vh,620px);margin:0;display:flex;align-items:center;justify-content:center;overflow:hidden;background:none;opacity:.3;transform:scale(.88);transition:opacity .45s ease,transform .45s ease;cursor:pointer}
.slide.on{opacity:1;transform:none;cursor:zoom-in}
.slide img{width:100%;height:100%;display:block;object-fit:contain}
.cbtn{position:absolute;top:50%;translate:0 -50%;z-index:2;width:3rem;height:3rem;border-radius:50%;border:1px solid rgba(214,138,56,.7);background:rgba(0,0,0,.55);color:var(--gold);font-size:1.6rem;line-height:1;cursor:pointer;display:grid;place-items:center;padding:0 0 .2rem;transition:border-color .25s ease,box-shadow .25s ease,color .25s ease}
.cbtn:hover,.cbtn:focus-visible{color:#ffd24a;border-color:#ffd24a;box-shadow:0 0 6px 1px rgba(255,210,74,.9),0 0 16px 3px rgba(255,210,74,.5)}
.cbtn:focus-visible{outline:none}
.cbtn:disabled{opacity:.25;cursor:default}
.cprev{left:.6rem}.cnext{right:.6rem}
.ccap{text-align:center;font-family:var(--carve);font-size:1.05rem;margin:1rem 0 .4rem;color:var(--ink)}
.dots{display:flex;justify-content:center;gap:.6rem}
.dots button{width:.7rem;height:.7rem;border-radius:50%;border:1px solid var(--soft);background:none;padding:0;cursor:pointer}
.dots button.on{background:var(--gold);border-color:var(--gold)}
.dots button:hover{border-color:var(--gold)}
.dots button:focus-visible{outline:2px solid var(--gold);outline-offset:3px}
@media (max-width:640px){.slide{flex-basis:78%;height:min(60vh,460px)}}
/* Portrait phones: bring carousel controls close to the screen edges without
   changing slide size. Landscape and larger screens retain the standard layout. */
@media (max-width:640px) and (orientation:portrait){
  .carousel{width:calc(100% + 72px);margin-left:-36px}
  .carousel .slide{flex-basis:calc(78% - 56.16px)}
  .cprev{left:0}
  .cnext{right:0}
}

/* 7. Reduced motion (last, so it beats the transitions above) */
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .frame .thumb,.play i,.track,.slide{transition:none}
}

/* Animal-page editorial text revealed by the Read more control */
.animal-copy h3{font-family:var(--carve);font-weight:400;font-size:1.05rem;letter-spacing:.04em;color:var(--ink);margin:1.5rem 0 .35rem}
.animal-copy p{max-width:48rem;color:var(--soft-light);margin:0 0 1.1rem}
.animal-copy p:last-child{margin-bottom:0}
.animal-toggle{display:inline-block}

/* Transcripts (collapsed by default) */
.transcript{max-width:48rem;margin:2rem 0 0}
.transcript summary{font-family:var(--carve);font-size:.95rem;letter-spacing:.04em;color:var(--gold);cursor:pointer;margin-bottom:1rem}
.transcript summary:focus-visible{outline:2px solid var(--gold);outline-offset:3px}
.transcript p{color:var(--soft-light);margin:0 0 1rem}

/* Slightly larger action/button text site-wide; keep the inline top navigation unchanged. */
.contact:not(.top .contact){font-size:1rem}
.hero .enter{font-size:1.05rem}
.story-toggle{font-size:1.05rem}
.animal-toggle{font-size:1.225rem}
.transcript summary{font-size:1.05rem}
.walk a{font-size:1.225rem}
.lbstage button{font-size:1.225rem}
