/* ---------- Font: OT Scholar Regular only (no italic file: where italic is asked, the browser slants the Regular) ---------- */
@font-face {
  font-family: "Scholar";
  /* LICENSED web fonts (Omnitype Web Licence for giuliadomeniconi.com, 20 Nov 2026): self-hosted, @font-face only */
  src: url("fonts/OTScholar-Regular.woff2") format("woff2"),
       url("fonts/OTScholar-Regular.woff") format("woff");
  font-style: normal;
  font-display: swap;
}
/* ---------- Settings ---------- */
:root {
  /* LIGHT (Var1, 17 Nov 2026): white page, black text */
  /* THE FONT of the whole site: Scholar (chosen 18 Nov 2026; Parallel and Herbik are in FONT/) */
  --font: "Scholar";

  --bg: #fff;
  --fg: #000;
  --white: #fff;             /* the cursor stays white (it inverts what is under it) */

  /* the 12-column grid, margin to margin (same as the InDesign guides) */
  --margin: 1.2vw;           /* (doubled 18 Nov) page margin: the grid, the small texts, the large texts and the images all start here */
  --gap: 0.497vw;            /* between columns, and between images (30% less than 0.71vw, 18 Nov) */
  --cap: 11px;               /* height of a capital C in the navigation: set exactly by script.js */
  --cap-top: 4px;            /* from the top of a navigation line to the top of its capitals (script.js) */
  --edge: var(--margin);     /* small texts (navigation, credits): same edge as the grid */

  /* sizes as in Var1 at 1440 px: navigation 20, texts 35, captions 13.4.
     Part fixed (rem: grows with browser zoom), part screen width (vw). */
  /* 18 Nov 2026: everything 20% smaller than Var1 */
  /* 20 Nov 2026: a single size for nav + large texts (25px) was tried and dropped: back to
     navigation 18px and large texts 26px at 1440. */
  --small-size: clamp(0.9rem, 0.486rem + 0.711vw, 1.35rem); /* 18px at 1440 */
  --intro-size: clamp(1.114rem, 0.706rem + 1.021vw, 1.93rem); /* 26px at 1440 (18 Nov) */
  --nav-size: var(--small-size);
  --caption-size: var(--small-size);                       /* captions: the old small size */
  --credit-size: calc(var(--small-size) * 0.78);             /* © / photo credit: smaller (14px at 1440); "Link" stays the normal size */
  --corner: 6px;                                           /* their distance from the image's edges */

  --blur: 5px;               /* how much the other images blur on hover */

  /* timings of the blur language — longer = slower, more ghostly */
  --emerge-time: 1.6s;       /* text + images coming into focus */
  --dissolve-time: 1.3s;     /* the previous section dissolving away */
  --soft: cubic-bezier(0.22, 0.61, 0.36, 1);   /* soft, slow-settling easing */
}
/* small texts in whole pixels (browsers that can round) */
@supports (width: round(nearest, 1px, 1px)) {
  :root {
    --small-size: round(nearest, clamp(0.9rem, 0.486rem + 0.711vw, 1.35rem), 1px);
    --intro-size: round(nearest, clamp(1.114rem, 0.706rem + 1.021vw, 1.93rem), 1px);
    --credit-size: round(nearest, calc(var(--small-size) * 0.78), 1px);
  }
}
/* DARK: the same page with the colours swapped (the half circle bottom-left) */
:root[data-theme="dark"] {
  --bg: #000;
  --fg: #fff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* no single word alone on the last line of a paragraph (browsers that support it) */
p { text-wrap: pretty; }

html {
  overflow-x: clip;             /* nothing may make the page scroll sideways */
  scrollbar-gutter: stable;     /* the scrollbar space is always kept, so nothing shifts between pages */
  background: var(--bg);        /* the whole window, also below a short page (20 Nov 2026) */
}

body {
  background: var(--bg);
  color: var(--fg);
  transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1), color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font), Georgia, serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;           /* the page fills the phone screen even when it is empty (homepage) */
}


a { color: inherit; text-decoration: none; }

/* Navigation: short names. Hovering an item shows its full name (the name becomes
   "About"); clicking keeps it. Everything Regular. */
.nav .long { display: none; }
/* hover = a thin underline, and it stays on the open item (19 Nov 2026; before: the full names leaned) */
.nav a.is-active {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
.nav a.is-active .short { display: none; }
.nav a.is-active .long { display: inline; }
/* the open item keeps its full name, also while hovering the others */

/* the name: "Giulia Domeniconi" and "About" lie on top of each other, so the hover area is
   exactly the name — and doesn't shrink (and flicker) when it turns into the shorter "About" */
.nav a.nav-name { display: inline-grid; justify-items: start; }
.nav a.nav-name .short,
.nav a.nav-name .long { display: inline; grid-area: 1 / 1; }
.nav a.nav-name .long { visibility: hidden; }
.nav a.nav-name.is-active .short { visibility: hidden; }
.nav a.nav-name.is-active .long { visibility: visible; }

/* HOVER effects only on computers (mouse / trackpad). On phones a tap leaves a 'hover' stuck on
   the tapped item, so "About" or a full name stayed after closing (20 Nov 2026). */
@media (hover: hover) and (pointer: fine) {
  .nav a:hover, .contact-lines a:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
  }
  /* not the name: it keeps both words stacked, so its clickable area stays as wide as "Giulia Domeniconi" */
  .nav a:not(.nav-name):hover .short { display: none; }
  .nav a:not(.nav-name):hover .long { display: inline; }
  .nav a.nav-name:hover .short { visibility: hidden; }
  .nav a.nav-name:hover .long { visibility: visible; }
  .nav-contact-wrap:hover .contact-lines { visibility: visible; }
  .intro a[href^="mailto:"]:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
  .contact-lines a:hover .icon-instagram { opacity: 0.55; }
  .mode-toggle:hover { transform: translateX(-50%) rotate(180deg); }
}


/* ---------- Cursor ---------- */
/* A crisp white dot — the standard cursor everywhere, drawn by script.js (mouse/trackpad only).
   The plain white dot below is the fallback in case the script doesn't run. */
@media (hover: hover) and (pointer: fine) {
  html, body, a, * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14'%3E%3Ccircle cx='7' cy='7' r='5' fill='white' stroke='black' stroke-opacity='0.3' stroke-width='1'/%3E%3C/svg%3E") 7 7, auto;
  }
  html.custom-cursor, html.custom-cursor * { cursor: none; }
}

.cursor {
  position: fixed;
  top: 0; left: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;                       /* hidden until the mouse first moves */
  transition: opacity 0.6s ease;
}
.cursor.is-visible { opacity: 1; }

/* the white dot/ring inverts what lies beneath it: white text under the circle reads
   black, the black background stays white-looking, and on photos it shows the
   inverted colours of that spot — so it stays visible on dark and bright images. */
.cursor { mix-blend-mode: difference; }

/* a crisp white dot, as tall as the capital C of the navigation (no blur, no breathing) */
.cursor-shape {
  position: absolute;
  top: 0; left: 0;
  width: var(--cap-small, var(--cap)); height: var(--cap-small, var(--cap));   /* stays the old size */
  border-radius: 50%;
  background: var(--white);
  transform: translate(-50%, -50%);
}

/* ---------- Navigation ---------- */
/* name in column 1, the categories from column 3, Contact on the right */
.nav {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: calc(var(--edge) + 3.3em);   /* three lines tall (the categories) */
  padding: var(--edge) var(--edge) 0;
  font-size: var(--nav-size);
  line-height: 1.1;
}
.nav-name { flex-shrink: 0; }      /* only as wide as the name: hovering beside it does nothing */
/* the categories start at grid column 3 (100% = the page width); each line only as wide as its words */
.nav-categories {
  position: absolute;
  top: var(--edge);
  left: calc(var(--margin) + 2 * ((100% - 2 * var(--margin) - 11 * var(--gap)) / 12 + var(--gap)));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.nav-contact-wrap {
  position: relative;
  margin-left: auto;
}
/* Every navigation link is clickable/hoverable only inside its own line: the letters themselves
   don't catch the mouse (their shapes reach a little into the neighbouring lines, so a click on
   the lower edge of "Contact" used to open the email program); an invisible box exactly the size
   of the link's line does. */
.nav-contact { display: block; height: 1.1em; }
.nav a, .contact-lines a { position: relative; pointer-events: none; }
.nav a::after, .contact-lines a::after { content: ""; position: absolute; inset: 0; pointer-events: auto; }
.contact-lines { pointer-events: none; }

/* 20 Nov 2026: the categories stay fixed in their order (the open one used to slide to the last line) */
/* email and Instagram: the 2nd and 3rd navigation lines under "Contact", right-aligned,
   same size as the navigation. They appear while hovering Contact and stay while Contact is open. */
.contact-lines {
  position: absolute;
  top: 100%;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  white-space: nowrap;
  visibility: hidden;
}
body.contact-open .contact-lines { visibility: visible; }
.contact-lines a { display: block; height: 1.1em; }   /* one navigation line each */

/* the Instagram logo is tiny: a bigger invisible area around it catches the click / tap (20 Nov 2026) */
.contact-lines a[aria-label="Instagram"]::after { inset: 0 -8px -8px; }   /* not upwards: it would cover the email line */

/* contact on phones: email and Instagram in the description's place (hidden on computers) */
.contact-intro { display: none; }
.contact-intro a { display: block; width: max-content; margin-left: auto; }   /* right-aligned (20 Nov 2026) */
.contact-intro .contact-instagram { position: relative; padding: 0 14px 14px; margin: 0 -14px -14px auto; }   /* big tap area, logo stays in place */

/* ---------- Panels: only one at a time ---------- */
.stage { position: relative; }
.panel[hidden] { display: none; }

/* the large texts: from the left margin, always 7 grid columns wide */
.intro {
  margin: 3vw 0 0 var(--margin);     /* gap between navigation and text */
  width: calc(7 * (100% - 2 * var(--margin) - 11 * var(--gap)) / 12 + 6 * var(--gap));   /* every large text: 7 grid columns wide (100% = page width) */
  max-width: calc(100vw - 2 * var(--margin));
  font-size: var(--intro-size);
  line-height: 1.02;                 /* a little more open than Var1's 0.92 (18 Nov) */
}
.intro p + p { margin-top: 0; }
/* About: one grid column wider (8 columns), so "Studio Julian Charrière" stays on one line (22 Nov 2026) */
#about .intro { width: calc(8 * (100% - 2 * var(--margin) - 11 * var(--gap)) / 12 + 7 * var(--gap)); }

/* contact: email and Instagram at the same height as the other texts, on the right */

/* Instagram: a small white outline logo, about the height of a capital letter */
.icon-instagram {
  /* outline logo: 1px lines, like the light/dark circle,
     and as tall as a capital letter, on the capitals of its line */
  --stem: 1px;                      /* thin line, like the light/dark circle (19 Nov) */
  display: block;
  overflow: visible;
  width: calc(var(--cap) - var(--stem));           /* + the line itself = capital height */
  height: calc(var(--cap) - var(--stem));
  margin-top: calc(var(--cap-top) + var(--stem) / 2);
  margin-right: calc(var(--stem) / 2);             /* outer edge on the right text edge */
  stroke-width: var(--stem);
  transition: opacity 0.4s ease;
}

/* credits: small and upright, in the bottom-right corner of the screen while Contact
   is open */
.credits {
  position: fixed;
  right: var(--edge);
  bottom: var(--edge);
  width: 60em;                      /* wide and shallow: one line per paragraph */
  max-width: calc(100vw - 2 * var(--margin));
  font-size: var(--small-size);     /* the old small size (20 Nov 2026) */
  line-height: 1.1;
  text-align: right;
  text-wrap: pretty;                /* browsers that can, avoid a single word on the last line */
  pointer-events: none;
  visibility: hidden;
  color: var(--fg);
  opacity: 0.7;                     /* darker grey than before (0.55), still quieter than the black text */
}
.credits p + p { margin-top: 0; }
body.contact-open .credits { visibility: visible; }

/* ---------- Light / dark switch ---------- */
/* a small half-filled circle on the top line, in the exact centre of the page. It inverts what lies beneath
   (like the cursor), so it shows black on white, white on black, and stays visible on photos.
   The filled half swaps sides with the mode. */
.mode-toggle {
  position: absolute;
  left: 50%;                        /* the exact centre of the page */
  top: calc(var(--edge) + var(--cap-top));   /* on the first navigation line, centred on its capitals */
  transform: translateX(-50%);
  width: var(--cap);                /* as tall as the C */
  height: var(--cap);
  padding: 0;
  font-size: inherit;
  border: 1px solid var(--white);   /* thin line */
  border-radius: 50%;
  background: linear-gradient(90deg, var(--white) 50%, transparent 50%);
  mix-blend-mode: difference;
  transition: transform 0.5s var(--soft);
}
:root[data-theme="dark"] .mode-toggle { background: linear-gradient(270deg, var(--white) 50%, transparent 50%); }
.mode-toggle::after { content: ""; position: absolute; inset: -12px; }   /* easier to hit */

/* ((words)) in the texts = italic (20 Nov 2026). There is no italic font file: the browser
   slants the Regular itself (synthetic oblique), so no extra font licence is needed. */
em { font-style: italic; font-synthesis: style; }


/* ---------- Image area ---------- */
/* Var1: the 12-column grid holds two "stacks" (columns of images, one under the other).
   Each stack says where it starts (--col) and how many columns wide it is (--span).
   Images fill the stack's width and keep their own proportions — nothing is cropped. */
.images {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gap);
  align-items: start;
  padding: 0 var(--margin);
  margin: 4.5vw 0 var(--margin);     /* gap between text and images */
}
.stack {
  grid-column: var(--col) / span var(--span);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.pic { position: relative; }

/* FLIP: images with a back image turn over on click (like a card) and show it.
   The front image sets the size; the back fills exactly the same rectangle. */
.pic.has-back { perspective: 2400px; }
.flip {
  position: relative;
  z-index: 0;
  transform-style: preserve-3d;
  transition: transform 0.9s cubic-bezier(0.45, 0, 0.2, 1);
}
.pic.is-flipped .flip { transform: rotateY(180deg); }
.pic video { pointer-events: none; }   /* a video behaves like a picture: no player, no controls */
.flip img { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip .back {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: cover;               /* same rectangle as the front (trims if the proportions differ) */
  transform: rotateY(180deg);
}
figcaption, .pic-link { z-index: 3; }
.pic.is-hovered { z-index: 2; }   /* the hovered image and its caption come forward */
/* the grid breaks a tiny bit: the image under the cursor grows slightly over the gaps while
   all the others shrink slightly, then everything settles back into the grid (computers only) */
@media (hover: hover) {
  .pic { transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1); }
  .pic.is-hovered { transform: scale(1.03); }    /* 3% bigger */
  .images.has-hover .pic:not(.is-hovered) { transform: scale(0.97); }   /* the others 3% smaller */
}
.pic img, .pic video {
  /* discourage saving: no dragging, no selection, no long-press menu on phones */
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  display: block;
  width: 100%;
  height: auto;        /* each image keeps its own proportions, nothing is cut */
}

/* ---------- Captions: white, over the image, in its bottom-left corner ---------- */
figcaption {
  position: absolute;
  left: 0;
  bottom: 0;
  max-width: 100%;
  padding: var(--corner);
  color: #fff;                      /* always white: it sits on the photo */
  font-size: var(--caption-size);
  line-height: 1.25;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}
figcaption p + p { margin-top: 1.2em; }
figcaption .credit { opacity: 0.7; font-size: var(--credit-size); }   /* the photo credit line: smaller and quieter */
figcaption p + .credit { margin-top: 0.6em; }
.pic.is-hovered figcaption { opacity: 1; }

/* computers: the caption text travels with the cursor and is typed in letter by letter
   (script.js); only the © / photo credit stays in the image's bottom-left corner */
@media (hover: hover) and (pointer: fine) {
  figcaption p:not(.credit) { display: none; }
  figcaption p + .credit { margin-top: 0; }
}
/* the 'Link' button: bottom-right corner of images that have a link (added by script.js).
   Hover: underlined, and the text next to the cursor becomes "Open project link" (script.js). Only this opens the link —
   clicking the image itself does nothing, so nobody leaves the website by accident. */
.pic-link {
  position: absolute;
  right: var(--corner);
  bottom: var(--corner);
  z-index: 3;
  font-size: var(--caption-size);   /* normal small-text size */
  line-height: 1.25;
  color: #fff;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}
.pic.is-hovered .pic-link { opacity: 1; visibility: visible; transition: opacity 0.35s ease; }
/* the link is a thin arrow (20 Nov 2026): as tall as a capital, 1px line like the Instagram logo;
   a few px of invisible padding make it easier to hit */
.pic-link {
  padding: 6px; margin: -6px; line-height: 0;
  bottom: calc(var(--corner) + var(--credit-size) * 0.25);   /* stands on the credit's baseline */
}
.pic-link svg {
  display: block;
  width: var(--cap-small, 0.7em);
  height: var(--cap-small, 0.7em);
  fill: none;
  stroke: currentColor;
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
  overflow: visible;
}

.cursor-caption {
  position: fixed;
  top: 0; left: 0;
  z-index: 999;                     /* just under the cursor dot */
  width: max-content;
  max-width: 26em;
  font-size: var(--caption-size);
  line-height: 1.25;
  color: #fff;
  mix-blend-mode: difference;       /* like the cursor: readable on photos and on the page */
  pointer-events: none;
  visibility: hidden;
}
.cursor-caption.is-visible { visibility: visible; }
.cursor-caption p + p { margin-top: 1.2em; }
.cursor-caption .ch { opacity: 0; }       /* letters wait invisible in place, so the block never jumps */
.cursor-caption .ch.on { opacity: 1; }

/* ---------- Phones ---------- */
@media (max-width: 700px) {
  :root { --column: var(--margin); --margin: 16px; --gap: 6px; }
  .nav { flex-wrap: wrap; gap: 8px 0; padding: var(--margin); }
  .nav { min-height: 0; }
  .nav-name { width: 100%; }
  .nav-categories { position: static; width: 100%; }
  /* 20 Nov 2026: Contact on its own line under Production, left — the same gap (8px) as between
     the name and Space. Opened, the email and Instagram follow directly under it, also left. */
  .nav-contact-wrap { width: 100%; }
  /* 20 Nov 2026: opened, the email and Instagram show where the descriptions go, left-aligned */
  .contact-lines { display: none; }
  .contact-intro { display: block; }
  .contact-intro a { margin-left: 0; }
  .contact-intro .contact-instagram { margin: 0 -14px -14px; }   /* big tap area, logo on the text edge */
  /* light/dark circle in the top-right corner, on the first line */
  .mode-toggle { left: auto; right: var(--margin); top: calc(var(--margin) + var(--cap-top)); transform: none; }
  /* light/dark switches at once on phones: the 0.5s fade drew black stripes on the iPhone (20 Nov 2026) */
  body { transition: none; }
  /* Contact credits: left-aligned, one size smaller than the captions (≈12px) */
  .credits { font-size: calc(var(--caption-size) - 1px); left: var(--margin); right: auto; text-align: left; }
  /* OPTICALLY equal gaps around the description (22 Nov): above = menu baseline → top of the small letters,
     below = bottom of the descenders (g, p) → image; both ≈ 33px at 19px text */
  .intro, #about .intro { width: auto; margin: calc(25px - var(--margin) - var(--cap-top)) var(--margin) 0; max-width: none; line-height: 1.1; }
  :root { --intro-size: 1.1875rem; --nav-size: var(--intro-size); --caption-size: calc(var(--intro-size) * 0.7); --credit-size: calc(var(--caption-size) * 0.78); }   /* phones (20 Nov 2026): one size, 19px (was 20), for nav and texts; captions 30% smaller (13.3px), credits ×0.78 */

  /* images one after another, whole and uncropped, evenly spaced */
  .images { display: block; height: auto !important; margin: 34px var(--margin) var(--margin); padding: 0; }
  .pic {
    position: relative !important;
    left: auto !important; top: auto !important;
    width: 100% !important; height: auto !important;
  }
  .stack { display: block; }
  .pic + .pic, .stack + .stack { margin-top: var(--gap); }
  .pic img, .pic video { height: auto; }

  /* captions: tap an image to show its caption over it (tap again to hide) */
  figcaption { padding: 12px; }
}
