
/* =========================================================
   HAMID ATTARAN — SHARED SITE SHELL
   One exact frame / header / navigation system on every page.
   ========================================================= */

/* Cross-document view transitions require both the outgoing and incoming
   pages to opt in. Keep this site-wide: partial opt-in causes Chrome to
   abort transitions on navigation to pages such as Moving Image. */
@view-transition {
  navigation: auto;
}

/* The frame (border + header) stays perfectly still while pages change:
   no fade and no movement; the new page's frame replaces the old instantly
   (so the current menu item updates), and only the content cross-fades.
   The grain needs no name: it is identical on both pages, so the
   cross-fade leaves it unchanged. */
::view-transition-group(site-header),
::view-transition-group(site-frame){animation:none}
::view-transition-old(site-header),
::view-transition-old(site-frame){display:none}
::view-transition-new(site-header),
::view-transition-new(site-frame){animation:none}

/* Default page change: a quiet, quick cross-fade (the circle reveal below is
   kept for "opening" moments only, see page-transitions.js). */
::view-transition-old(root),
::view-transition-new(root){
  animation-duration:300ms;
  animation-timing-function:ease;
}

/* Arriving through a view transition: the page is already uncovered by the
   transition, so skip the separate fade-in each page has on a normal load. */
html.vt-arrived body{animation:none !important}

/* Reveal (page-transitions.js): the new page opens in a circle from the
   point clicked while the old one dims and settles back beneath it. */
@property --vt-r{syntax:"<length>";inherits:true;initial-value:0px}
html.vt-reveal::view-transition-new(root){
  animation:none;
  /* Feathered edge, like the marble reveal on the homepage. */
  -webkit-mask-image:radial-gradient(circle at var(--vt-x,50%) var(--vt-y,50%),#000 calc(var(--vt-r) - 140px),transparent var(--vt-r));
  mask-image:radial-gradient(circle at var(--vt-x,50%) var(--vt-y,50%),#000 calc(var(--vt-r) - 140px),transparent var(--vt-r));
}
html.vt-reveal::view-transition-old(root){
  animation:ha-vt-settle 900ms cubic-bezier(.4,0,.2,1) both;
}
@keyframes ha-vt-settle{
  to{opacity:.18;transform:scale(.985)}
}

@media (prefers-reduced-motion: reduce){
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*){animation:none !important}
}

/* Leaving a page (set by each page's link handler as body.is-leaving):
   where view transitions are supported, fade only the content and keep the
   frame, grain, header and privacy links visible. */
html.vt-nav body.is-leaving{
  opacity:1 !important;
  transition:none !important;
}
html.vt-nav body.is-leaving *:not(.site-header,.site-header *,.site-border,.site-grain,.privacy-controls,.privacy-controls *):not(:has(.site-header,.site-border,.site-grain,.privacy-controls)){
  opacity:0 !important;
  transition:opacity 200ms ease !important;
}

:root{
  --site-bg: #d8d8d8;
  --site-frame-inset: 9px;
  --site-frame-line: rgba(17,17,17,.20);
  --site-header-x: 24px;
  --site-header-top: 23px;
  --site-name-size: 12px;
  --site-nav-size: 12px;
  --site-nav-gap: 32px;

  /* Keep legacy page variables synced to the master background. */
  --bg: var(--site-bg) !important;
}

/* One exact base background across the whole site. */
html,
body,
.page,
.shell{
  background-color:var(--site-bg) !important;
}

/* Prevent old page-specific background colors from showing around the frame. */
html,
body{
  background:var(--site-bg) !important;
}

/* The border is always in precisely the same viewport position. */
.site-border{
  position:fixed !important;
  inset:var(--site-frame-inset) !important;
  width:auto !important;
  height:auto !important;
  margin:0 !important;
  padding:0 !important;
  border:1px solid var(--site-frame-line) !important;
  border-radius:0 !important;
  pointer-events:none !important;
  z-index:1000 !important;
  background:transparent !important;
  view-transition-name:site-frame;
}

/* One exact grain treatment across the whole site.
   It begins INSIDE the 1px frame and is independent of page-specific CSS. */
.site-grain{
  position:fixed !important;
  top:calc(var(--site-frame-inset) + 1px) !important;
  right:calc(var(--site-frame-inset) + 1px) !important;
  bottom:calc(var(--site-frame-inset) + 1px) !important;
  left:calc(var(--site-frame-inset) + 1px) !important;
  width:auto !important;
  height:auto !important;
  margin:0 !important;
  padding:0 !important;
  pointer-events:none !important;
  overflow:hidden !important;
  z-index:900 !important;

  background-image:url("/assets/v/e9bf885c7d9c4c38/grain.webp") !important;
  background-repeat:repeat !important;
  background-position:0 0 !important;
  background-size:180px 180px !important;
  background-color:transparent !important;

  opacity:.14 !important;
  mix-blend-mode:multiply !important;
  filter:none !important;
}

/* Exactly the same header geometry everywhere. */
.site-header{
  position:fixed !important;
  left:var(--site-header-x) !important;
  right:var(--site-header-x) !important;
  top:var(--site-header-top) !important;
  bottom:auto !important;
  width:auto !important;
  height:auto !important;
  margin:0 !important;
  padding:0 !important;
  display:flex !important;
  justify-content:space-between !important;
  align-items:flex-start !important;
  z-index:1100 !important;
  line-height:1 !important;
  view-transition-name:site-header;
}

.site-name{
  display:block !important;
  margin:0 !important;
  padding:0 !important;
  color:inherit !important;
  text-decoration:none !important;
  font-family:var(--font-sans) !important;
  font-size:var(--site-name-size) !important;
  font-weight:500 !important;
  line-height:1 !important;
  letter-spacing:.06em !important;
  text-transform:uppercase !important;
  white-space:nowrap !important;
}

.site-nav{
  display:flex !important;
  align-items:flex-start !important;
  justify-content:flex-end !important;
  gap:var(--site-nav-gap) !important;
  margin:0 !important;
  padding:0 !important;
  line-height:1 !important;
  white-space:nowrap !important;
}

.site-nav a{
  display:block !important;
  margin:0 !important;
  padding:0 !important;
  color:inherit !important;
  text-decoration:none !important;
  font-family:var(--font-sans) !important;
  font-size:var(--site-nav-size) !important;
  font-weight:400 !important;
  line-height:1 !important;
  letter-spacing:0 !important;
  text-transform:uppercase !important;
  opacity:.88;
  transition:opacity .18s ease;
}

.site-nav a:hover{opacity:.48}
.site-nav a.is-current{opacity:1}

/* Hide old secondary identity labels that used to make headers shift. */
.site-header .mode-name,
.site-header .mode,
.site-header .section-name{
  display:none !important;
}


/* Shared UI arrows — CSS drawn so iOS never substitutes emoji glyphs. */
.ui-arrow{
  position:relative;
  display:inline-block;
  width:11px;
  height:11px;
  flex:0 0 auto;
  vertical-align:-1px;
  color:inherit;
  line-height:1;
  pointer-events:none;
}

.ui-arrow::before,
.ui-arrow::after{
  content:"";
  position:absolute;
  box-sizing:border-box;
}

.ui-arrow-right::before,
.ui-arrow-left::before{
  left:1px;
  top:5px;
  width:9px;
  height:1px;
  background:currentColor;
}

.ui-arrow-right::after,
.ui-arrow-left::after,
.ui-arrow-up::after,
.ui-arrow-down::after{
  width:5px;
  height:5px;
  border-top:1px solid currentColor;
  border-right:1px solid currentColor;
}

.ui-arrow-right::after{
  right:1px;
  top:3px;
  transform:rotate(45deg);
}

.ui-arrow-left::after{
  left:1px;
  top:3px;
  transform:rotate(-135deg);
}

.ui-arrow-up::before,
.ui-arrow-down::before{
  left:5px;
  top:1px;
  width:1px;
  height:9px;
  background:currentColor;
}

.ui-arrow-up::after{
  left:3px;
  top:1px;
  transform:rotate(-45deg);
}

.ui-arrow-down::after{
  left:3px;
  bottom:1px;
  transform:rotate(135deg);
}

.ui-arrow-external::before{
  left:1px;
  top:5px;
  width:10px;
  height:1px;
  background:currentColor;
  transform:rotate(-45deg);
  transform-origin:center;
}

.ui-arrow-external::after{
  right:1px;
  top:1px;
  width:5px;
  height:5px;
  border-top:1px solid currentColor;
  border-right:1px solid currentColor;
}


/* Respect the user's reduced-motion preference without changing normal visuals. */
@media (prefers-reduced-motion: reduce){
  *,
  *::before,
  *::after{
    scroll-behavior:auto !important;
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.01ms !important;
    transition-delay:0s !important;
  }
}


/* =========================================================
   PRIVACY / COOKIE CONSENT
   Minimal shared controls for the public site.
   ========================================================= */
.cookie-consent{
  position:fixed;
  left:auto;
  right:24px;
  bottom:24px;
  z-index:5000;
  width:min(420px,calc(100vw - 48px));
  padding:16px 17px 15px;
  border:1px solid rgba(17,17,17,.22);
  background:rgba(216,216,216,.96);
  color:#111;
  font-family:var(--font-sans);
  box-shadow:0 10px 28px rgba(0,0,0,.06);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}
.cookie-consent[hidden]{display:none !important}
.cookie-consent p{
  margin:0;
  max-width:370px;
  font-size:11px;
  line-height:1.42;
}
.cookie-consent p a{
  color:inherit;
  text-decoration:underline;
  text-underline-offset:2px;
}
.cookie-consent-actions{
  display:flex;
  gap:15px;
  align-items:center;
  margin-top:13px;
}
.cookie-consent button{
  appearance:none;
  -webkit-appearance:none;
  border:0;
  border-bottom:1px solid rgba(17,17,17,.34);
  border-radius:0;
  padding:0 0 2px;
  background:transparent;
  color:inherit;
  font:inherit;
  font-size:10px;
  line-height:1.2;
  text-transform:uppercase;
  cursor:pointer;
}
.cookie-consent button:hover{opacity:.55}

.privacy-controls{
  position:fixed;
  right:24px;
  bottom:21px;
  z-index:1200;
  display:flex;
  align-items:center;
  gap:12px;
  font-family:var(--font-sans);
  font-size:9px;
  line-height:1;
  text-transform:uppercase;
}
.privacy-controls a,
.privacy-controls button{
  appearance:none;
  -webkit-appearance:none;
  border:0;
  padding:0;
  background:transparent;
  color:inherit;
  font:inherit;
  text-decoration:none;
  opacity:.46;
  cursor:pointer;
  transition:opacity .18s ease;
}
.privacy-controls a:hover,
.privacy-controls button:hover{opacity:1}

@media(max-width:900px){
  /* Mobile: restrained text strip, not an overlay card. */
  .cookie-consent{
    left:0;
    right:0;
    top:auto;
    bottom:0;
    transform:none;
    width:100%;
    max-height:45dvh;
    overflow-y:auto;
    padding:12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
    border:0;
    border-top:1px solid rgba(17,17,17,.22);
    border-radius:0;
    background:#d8d8d8;
    box-shadow:none;
    backdrop-filter:none;
    -webkit-backdrop-filter:none;
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:7px 18px;
  }
  .cookie-consent p{flex:1 1 185px;font-size:10px;line-height:1.35}
  .cookie-consent-actions{flex:0 0 auto;margin-top:0;gap:17px}
  .cookie-consent button{font-size:10px}
  /* Make room above the strip instead of obscuring the introduction. */
  html.cookie-banner-visible body.page-home .home-intro{
    bottom:calc(64px + env(safe-area-inset-bottom, 0px)) !important;
  }
  html.cookie-banner-visible .privacy-controls{
    visibility:hidden;
  }
  .privacy-controls{
    right:18px;
    bottom:17px;
    gap:10px;
    font-size:8px;
  }
}


/* Keyboard-only skip navigation; never alters the visible editorial composition. */
.skip-to-content{
  position:fixed;
  left:24px;
  top:14px;
  z-index:10000;
  display:block;
  width:max-content;
  max-width:calc(100vw - 48px);
  padding:11px 14px;
  background:#111;
  color:#fff;
  font:12px/1.3 var(--font-sans);
  text-decoration:none;
  transform:translateY(calc(-100% - 25px));
  pointer-events:none;
}
.skip-to-content:focus,
.skip-to-content:focus-visible{
  transform:none;
  pointer-events:auto;
  outline:2px solid #fff;
  outline-offset:2px;
}

/* Accessibility enhancements: no appearance changes for pointer users. */
.site-header a:focus-visible,
.site-nav a:focus-visible,
.site-menu-toggle:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible{
  outline:2px solid currentColor;
  outline-offset:4px;
}
@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto!important}
  *,*::before,*::after{
    animation-duration:0.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:0.01ms!important;
    scroll-behavior:auto!important;
  }
}

/* Semantic headings for minimalist pages, accessible without affecting layout. */
.visually-hidden{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  padding:0 !important;
  margin:-1px !important;
  overflow:hidden !important;
  clip:rect(0,0,0,0) !important;
  white-space:nowrap !important;
  border:0 !important;
}
