/* Sebastian Viskanic — "fuori dalle righe" */
@font-face {
  font-family: "Archivo"; font-style: normal; font-display: swap;
  font-weight: 100 900; font-stretch: 62% 125%;
  src: url("fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2-variations");
  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;
}
@font-face {
  font-family: "Archivo"; font-style: normal; font-display: swap;
  font-weight: 100 900; font-stretch: 62% 125%;
  src: url("fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations");
  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;
}

:root {
  --blue: #2b44ff;
  --yellow: #ffd400;
  --pink: #ff4fa3;
  --green: #00a95c;
  --ink: #000000;
  --paper: #ffffff;
  --rule: #b9c9f2;
  --margin-red: #ff5a5a;
  --grey: #5c5c66;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.375rem;
  --step-2: clamp(1.6rem, 3vw, 2.25rem);
  --step-3: clamp(2.2rem, 5vw, 4rem);
  --pad: clamp(1.25rem, 4vw, 3.5rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif; font-size: var(--step-0); line-height: 1.5;
  font-variation-settings: "wdth" 100; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--yellow); padding: .5rem 1rem; z-index: 100; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 90;
  display: flex; justify-content: space-between; align-items: center;
  padding: .9rem var(--pad); background: var(--paper); border-bottom: 2px solid var(--ink);
}
.mark { font-weight: 900; font-size: 1.25rem; text-decoration: none; font-variation-settings: "wdth" 125; }
.top nav { display: flex; gap: clamp(1rem, 3vw, 2rem); align-items: center; }
.top nav a { text-decoration: none; font-weight: 600; }
.top nav a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.nav-cta { background: var(--ink); color: var(--paper); padding: .45rem .95rem; border-radius: 999px; }
.nav-cta:hover { background: var(--blue); text-decoration: none !important; }

/* Language menu: a small dropdown made of plain links (search engines follow them) */
.lang { position: relative; }
.lang summary {
  list-style: none; cursor: pointer; font-weight: 700; font-size: .9rem; letter-spacing: .02em;
  display: flex; align-items: center; gap: .3rem; padding: .35rem .6rem; border: 2px solid var(--ink); border-radius: 999px;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary::after { content: ""; width: .4rem; height: .4rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }
.lang[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.lang summary:hover { background: var(--yellow); }
.lang summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.lang ul {
  position: absolute; right: 0; top: calc(100% + .5rem); margin: 0; padding: .35rem; list-style: none; min-width: 9.5rem;
  background: var(--paper); border: 2px solid var(--ink); border-radius: .75rem; box-shadow: 0 10px 24px rgba(0,0,0,.18); z-index: 60;
}
.top nav .lang a { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem .7rem; border-radius: .5rem; font-weight: 600; }
.top nav .lang a:hover { background: var(--yellow); text-decoration: none; }
.lang a[aria-current="true"] { background: var(--ink); color: var(--paper); }
.lang a[aria-current="true"]:hover { background: var(--ink) !important; }
.lang a small { font-weight: 700; opacity: .6; }

/* =========================================================
   The ruled sheet
   ========================================================= */
.sheet {
  --line: 2;      /* rem between rules */
  --margin: 3.5;  /* rem to the red margin line */
  position: relative; overflow: hidden;
  height: calc(100svh - 3.6rem); min-height: 640px;
  background:
    linear-gradient(to right, transparent calc(var(--margin) * 1rem), var(--margin-red) calc(var(--margin) * 1rem), var(--margin-red) calc(var(--margin) * 1rem + 2px), transparent calc(var(--margin) * 1rem + 2px)),
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--line) * 1rem - 1px), var(--rule) calc(var(--line) * 1rem - 1px), var(--rule) calc(var(--line) * 1rem));
  border-bottom: 2px solid var(--ink);
}
.piece {
  position: absolute; left: 0; top: 0;
  transform: rotate(var(--r, 0deg)) scale(var(--s, 1));
  transform-origin: 50% 50%;
  cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none;
  text-decoration: none; opacity: 0;
}
.sheet.animating .piece { transition: left .7s cubic-bezier(.3,.8,.2,1), top .7s cubic-bezier(.3,.8,.2,1), transform .7s cubic-bezier(.3,.8,.2,1); }
.piece.dragging { cursor: grabbing; transform: rotate(var(--r, 0deg)) scale(calc(var(--s, 1) * 1.04)); }

/* The name */
.p-name {
  font-weight: 900; font-stretch: 125%;
  font-size: clamp(2.6rem, 5.6vw, 6.2rem); line-height: .84; letter-spacing: -0.025em;
  text-transform: uppercase; white-space: nowrap;
  text-shadow: .045em .04em 0 var(--pink);
  z-index: 3;
}

/* The note: sits exactly on the ruled lines */
.p-note {
  width: min(24rem, 80vw);
  font-size: 1.25rem; line-height: calc(var(--line) * 1rem); font-weight: 500;
  padding-top: .35rem;
  z-index: 6;
}

/* Stickers: die-cut look (white edge + shadow) says "peel me off and move me" */
.sticker {
  --c: var(--ink); --on: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .55rem;
  background: var(--c); color: var(--on);
  border: 5px solid var(--paper);
  box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 10px 22px rgba(0,0,0,.18);
  font-weight: 800; font-stretch: 112%; line-height: 1.05; text-align: center;
  font-size: clamp(.85rem, 1.05vw, 1rem);
  padding: 1rem;
  z-index: 4;
  transition: box-shadow .2s ease;
}
.sticker .ico { width: clamp(2.6rem, 4vw, 3.6rem); height: auto; flex: none; }
.sticker:hover { box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 16px 30px rgba(0,0,0,.24); }
.piece.dragging.sticker { box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 26px 44px rgba(0,0,0,.3); }

.s-layout     { --c: var(--blue);   --on: var(--paper); width: clamp(150px, 15vw, 210px); aspect-ratio: 1.3; border-radius: 22px; }
.s-social     { --c: var(--yellow); --on: var(--ink);   width: clamp(112px, 10.5vw, 150px); aspect-ratio: .72; border-radius: 26px; }
.s-journalism { --c: var(--ink);    --on: var(--paper); width: clamp(150px, 14vw, 196px); aspect-ratio: 1.25; border-radius: 10px; }
.s-video      { --c: var(--pink);   --on: var(--ink);   width: clamp(118px, 11vw, 158px); aspect-ratio: 1; border-radius: 50%; }
.s-personal   { --c: var(--green);  --on: var(--paper); width: clamp(140px, 13vw, 180px); aspect-ratio: 1.15; border-radius: 48% 52% 44% 56% / 55% 45% 55% 45%; }
.soon {
  position: absolute; top: -.7rem; right: -.6rem;
  background: var(--yellow); color: var(--ink); font-size: .75rem; font-weight: 800;
  padding: .15rem .55rem; border-radius: 999px; border: 3px solid var(--paper);
  transform: rotate(12deg);
}

/* The controls are a piece too */
.p-ui {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem;
  background: var(--paper); padding: .6rem .7rem .6rem 1rem; border-radius: 999px;
  border: 2px dashed var(--ink);
  z-index: 8;
}
.hint { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.1rem; line-height: 1.2; }
.hint .ico { width: 2rem; height: 2rem; flex: none; }
.hint small { display: block; font-weight: 500; font-size: .8rem; color: var(--grey); margin-top: .15rem; }
#tidy {
  font: inherit; font-weight: 700; cursor: pointer;
  background: var(--ink); color: var(--paper); border: 0; border-radius: 999px; padding: .6rem 1.1rem;
}
#tidy:hover { background: var(--blue); }

/* Resize handle */
.rz {
  position: absolute; right: -13px; bottom: -13px; z-index: 2;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7l10 10M7 12V7h5M17 12v5h-5'/%3E%3C/svg%3E") center / 16px no-repeat;
  border: 2px solid var(--ink);
  cursor: nwse-resize; touch-action: none;
  transform: rotate(calc(var(--r, 0deg) * -1)) scale(calc(1 / var(--s, 1)));
  opacity: 0; transition: opacity .2s ease;
}
.piece:hover > .rz, .piece:focus-within > .rz, .piece.resizing > .rz, .sheet.show-handles .rz { opacity: 1; }
@media (hover: none) { .rz { opacity: .9; } }
.piece.resizing { cursor: nwse-resize; }

/* Intro: pieces drop onto the sheet one after another */
.sheet.is-tidy { max-height: none; }

/* Alternative surfaces (set data-bg on .sheet) */
.sheet[data-bg="grid"] {
  background:
    linear-gradient(to right, transparent calc(var(--margin) * 1rem), #ff3ea5 calc(var(--margin) * 1rem), #ff3ea5 calc(var(--margin) * 1rem + 1px), transparent calc(var(--margin) * 1rem + 1px), transparent calc(100% - var(--margin) * 1rem - 1px), #ff3ea5 calc(100% - var(--margin) * 1rem - 1px), #ff3ea5 calc(100% - var(--margin) * 1rem), transparent calc(100% - var(--margin) * 1rem)),
    repeating-linear-gradient(to right, transparent 0 calc(100% / 12 - 1px), rgba(140, 90, 255, .35) calc(100% / 12 - 1px) calc(100% / 12)),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--line) * 1rem - 1px), rgba(0, 170, 240, .3) calc(var(--line) * 1rem - 1px) calc(var(--line) * 1rem)),
    #ffffff;
}
.sheet[data-bg="mat"] {
  --sheet-ink: #ffffff;
  background:
    repeating-linear-gradient(to right, transparent 0 calc(10rem - 2px), rgba(255,255,255,.3) calc(10rem - 2px) 10rem),
    repeating-linear-gradient(to bottom, transparent 0 calc(10rem - 2px), rgba(255,255,255,.3) calc(10rem - 2px) 10rem),
    repeating-linear-gradient(to right, transparent 0 calc(2rem - 1px), rgba(255,255,255,.13) calc(2rem - 1px) 2rem),
    repeating-linear-gradient(to bottom, transparent 0 calc(2rem - 1px), rgba(255,255,255,.13) calc(2rem - 1px) 2rem),
    #17694f;
}
.sheet[data-bg="kraft"] {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .22 0 0 0 0 .1 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E"),
    #c9a170;
}
.sheet[data-bg="mat"] .p-name, .sheet[data-bg="mat"] .p-note { color: var(--sheet-ink); }
.sheet[data-bg="mat"] { border-bottom-color: #0d4a37; }
/* 45° and 60° cutting guides, very faint */
.sheet[data-bg="mat"]::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(45deg, transparent calc(50% - 1px), rgba(255,255,255,.16) calc(50% - 1px), rgba(255,255,255,.16) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(-30deg, transparent calc(50% - 1px), rgba(255,255,255,.1) calc(50% - 1px), rgba(255,255,255,.1) calc(50% + 1px), transparent calc(50% + 1px));
}
/* Measuring edges */
.ruler { position: absolute; pointer-events: none; color: rgba(255,255,255,.75); font-size: .7rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.ruler-top {
  left: 0; right: 0; top: 0; height: 1.4rem;
  background:
    repeating-linear-gradient(to right, rgba(255,255,255,.8) 0 2px, transparent 2px 10rem) 0 0 / 100% 1.1rem no-repeat,
    repeating-linear-gradient(to right, rgba(255,255,255,.55) 0 1px, transparent 1px 2rem) 0 0 / 100% .7rem no-repeat,
    repeating-linear-gradient(to right, rgba(255,255,255,.35) 0 1px, transparent 1px .4rem) 0 0 / 100% .35rem no-repeat;
}
.ruler-left {
  top: 0; bottom: 0; left: 0; width: 1.4rem;
  background:
    repeating-linear-gradient(to bottom, rgba(255,255,255,.8) 0 2px, transparent 2px 10rem) 0 0 / 1.1rem 100% no-repeat,
    repeating-linear-gradient(to bottom, rgba(255,255,255,.55) 0 1px, transparent 1px 2rem) 0 0 / .7rem 100% no-repeat,
    repeating-linear-gradient(to bottom, rgba(255,255,255,.35) 0 1px, transparent 1px .4rem) 0 0 / .35rem 100% no-repeat;
}
.ruler span { position: absolute; }
.ruler-top span { top: 1.1rem; transform: translateX(4px); }
.ruler-left span { left: 1.25rem; transform: translateY(2px); }
.sheet.ready .piece { animation: drop .7s cubic-bezier(.2,.9,.25,1.15) both; animation-delay: calc(var(--i, 0) * 80ms); }
.p-name { --i: 0; } .p-note { --i: 1; } .s-layout { --i: 2; } .s-social { --i: 3; }
.s-journalism { --i: 4; } .s-video { --i: 5; } .s-personal { --i: 6; } .p-ui { --i: 7; }
@keyframes drop {
  from { translate: 0 -40px; scale: 1.15; opacity: 0; }
  60%  { opacity: 1; }
  to   { translate: 0 0; scale: 1; opacity: 1; }
}

/* The demo hand */
.ghost-hand {
  position: absolute; z-index: 60; width: 3.2rem; height: 3.2rem; pointer-events: none;
  color: var(--ink); opacity: 0; translate: -20% -10%;
  filter: drop-shadow(0 3px 0 var(--paper)) drop-shadow(0 -2px 0 var(--paper)) drop-shadow(2px 0 0 var(--paper)) drop-shadow(-2px 0 0 var(--paper));
  transition: opacity .25s ease, scale .2s ease;
}
.ghost-hand .ico { width: 100%; height: 100%; fill: var(--paper); }
.ghost-hand.show { opacity: 1; }
.ghost-hand.grab { scale: .85; }
.sheet.demo-move .demo-target, .sheet.demo-move .ghost-hand {
  transition: left .8s cubic-bezier(.45,0,.2,1), top .8s cubic-bezier(.45,0,.2,1), opacity .25s, scale .2s;
}
.sheet.demo-move .demo-target { transform: rotate(var(--r)) scale(calc(var(--s, 1) * 1.05)); }
/* Click demo: the hand travels to a sticker and taps it */
.sheet.demo-click .ghost-hand {
  transition: left .7s cubic-bezier(.45,0,.2,1), top .7s cubic-bezier(.45,0,.2,1), opacity .25s, scale .15s;
}
.sticker.demo-press { transition: transform .15s ease; transform: rotate(var(--r, 0deg)) scale(calc(var(--s, 1) * .93)); }

/* =========================================================
   Work groups
   ========================================================= */
.work { padding: clamp(3rem, 7vw, 6rem) var(--pad) clamp(2rem, 4vw, 3rem); }
.group { --c: var(--ink); --on: var(--paper); margin-bottom: clamp(3rem, 6vw, 5rem); }
.group.t-layout { --c: var(--blue); --on: var(--paper); }
.group.t-social { --c: var(--yellow); --on: var(--ink); }
.group.t-journalism { --c: var(--ink); --on: var(--paper); }
.group.t-video { --c: var(--pink); --on: var(--ink); }
.group.t-personal { --c: var(--green); --on: var(--paper); }

.group-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .3rem 1rem;
  border-bottom: 3px solid var(--ink); padding-bottom: .6rem;
}
.group-head h3 {
  font-size: var(--step-3); font-weight: 900; line-height: .95; letter-spacing: -0.02em;
  font-variation-settings: "wdth" 125;
  display: flex; align-items: center; gap: .9rem;
}
.badge {
  flex: none; width: .95em; height: .95em; display: grid; place-items: center;
  background: var(--c); color: var(--on); border-radius: .22em; transform: rotate(-8deg);
}
.badge .ico { width: 68%; height: 68%; }
.group-head .n { color: var(--grey); font-size: var(--step--1); font-weight: 600; white-space: nowrap; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li { border-bottom: 1px solid var(--rule); }
.row {
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem; align-items: baseline; padding: 1rem .75rem; text-decoration: none;
  transition: transform .18s ease, background-color .18s ease;
  position: relative;
}
a.row:hover, a.row:focus-visible {
  background: var(--c); color: var(--on);
  transform: rotate(-1.2deg) translateX(.5rem);
  z-index: 1;
}
.r-title { font-size: var(--step-1); font-weight: 800; line-height: 1.15; font-variation-settings: "wdth" 112; }
.r-meta, .r-role { font-size: var(--step--1); }
.r-meta { font-weight: 600; }
.r-role { color: var(--grey); }
a.row:hover .r-role, a.row:focus-visible .r-role { color: inherit; }
.empty {
  padding: 1.25rem .75rem; color: var(--grey); max-width: 40rem;
  border-bottom: 1px dashed var(--rule);
}

/* ---------- About ---------- */
.about {
  padding: clamp(3rem, 7vw, 6rem) var(--pad);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 2rem 4rem;
  border-top: 3px solid var(--ink);
}
.about h2, .contact h2 { font-size: var(--step-3); font-weight: 900; line-height: .95; letter-spacing: -0.02em; font-variation-settings: "wdth" 125; }
.about-body { max-width: 46rem; display: grid; gap: 1.5rem; }
.about-big { font-size: var(--step-2); line-height: 1.22; font-weight: 500; }
.about-body > p:not(.about-big) { max-width: 38rem; }

/* ---------- Contact ---------- */
.contact { background: var(--blue); color: var(--paper); padding: clamp(4rem, 9vw, 8rem) var(--pad); }
.contact h2 { color: var(--yellow); max-width: 16ch; }
.contact p { margin-top: 1.25rem; font-size: var(--step-1); max-width: 34rem; }
.email {
  display: inline-block; margin-top: clamp(2rem, 5vw, 3.5rem);
  font-size: clamp(1.6rem, 6.4vw, 5.5rem); font-weight: 900; line-height: 1; letter-spacing: -0.02em;
  text-decoration: underline; text-decoration-thickness: .08em; text-underline-offset: .14em;
  text-decoration-color: var(--pink); overflow-wrap: anywhere;
}
.email:hover { color: var(--yellow); }
.contact :focus-visible { outline-color: var(--yellow); }
.copy-row { margin-top: 1.5rem; display: flex; align-items: center; gap: 1rem; }
.copy {
  font: inherit; font-weight: 600; cursor: pointer; background: transparent; color: var(--paper);
  border: 2px solid var(--paper); border-radius: 999px; padding: .45rem 1rem;
}
.copy:hover { background: var(--paper); color: var(--blue); }
.copied { font-weight: 600; }

.bottom { display: flex; justify-content: space-between; gap: 1rem; padding: 1.5rem var(--pad); font-size: var(--step--1); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .row { grid-template-columns: 1fr; gap: .2rem; }
  .about { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sheet { --margin: 1.5; height: calc(100svh - 3.6rem); min-height: 700px; max-height: 900px; }
  .p-note { width: min(19rem, 78vw); }
  .s-layout { width: 128px; } .s-social { width: 94px; } .s-journalism { width: 126px; }
  .s-video { width: 102px; } .s-personal { width: 120px; }
  .sticker { font-size: .75rem; padding: .6rem; border-width: 4px; gap: .4rem; }
  .sticker .ico { width: 2.1rem; }
  .p-ui { flex-direction: column; align-items: flex-start; gap: .45rem; border-radius: 18px; padding: .6rem .75rem; max-width: 300px; }
  .hint { font-size: .95rem; }
  .hint .ico { width: 1.6rem; height: 1.6rem; }
  .p-note { font-size: 1.05rem; }
  #tidy { padding: .5rem 1rem; }
  .p-name { font-size: clamp(2.2rem, 10.5vw, 4.2rem); }
  .p-note { font-size: 1.125rem; }
  .top nav > a:not(.nav-cta) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sheet.animating .piece, .row { transition: none; }
  .sheet.ready .piece { animation: none; opacity: 1; }
  .ghost-hand { display: none; }
  a.row:hover, a.row:focus-visible { transform: none; }
}

/* =========================================================
   Layout game (desktop): a page on the mat with dashed frames
   ========================================================= */
.page {
  position: absolute; z-index: 1; display: none; pointer-events: none;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 18px 40px rgba(0,0,0,.35);
}
.sheet.is-wide .page { display: block; }
/* crop marks */
.page::before, .page::after {
  content: ""; position: absolute; inset: -18px; pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,.85), rgba(255,255,255,.85)) 0 18px / 12px 1px no-repeat,
    linear-gradient(rgba(255,255,255,.85), rgba(255,255,255,.85)) 18px 0 / 1px 12px no-repeat,
    linear-gradient(rgba(255,255,255,.85), rgba(255,255,255,.85)) 100% 18px / 12px 1px no-repeat,
    linear-gradient(rgba(255,255,255,.85), rgba(255,255,255,.85)) calc(100% - 18px) 0 / 1px 12px no-repeat,
    linear-gradient(rgba(255,255,255,.85), rgba(255,255,255,.85)) 0 calc(100% - 18px) / 12px 1px no-repeat,
    linear-gradient(rgba(255,255,255,.85), rgba(255,255,255,.85)) 18px 100% / 1px 12px no-repeat,
    linear-gradient(rgba(255,255,255,.85), rgba(255,255,255,.85)) 100% calc(100% - 18px) / 12px 1px no-repeat,
    linear-gradient(rgba(255,255,255,.85), rgba(255,255,255,.85)) calc(100% - 18px) 100% / 1px 12px no-repeat;
}
.page::after { display: none; }

.frame {
  position: absolute; z-index: 2; pointer-events: none; display: none;
  border: 2px dashed rgba(0, 0, 0, .38); border-radius: 4px;
  display: none; place-items: center; color: rgba(0, 0, 0, .16); overflow: hidden;
  transition: opacity .35s ease, border-color .2s ease, background-color .2s ease;
}
.sheet.is-wide .frame { display: grid; }
.f-layout     { border-radius: calc(27px * var(--fs, 1)); }
.f-social     { border-radius: calc(31px * var(--fs, 1)); }
.f-journalism { border-radius: calc(15px * var(--fs, 1)); }
.f-video      { border-radius: 50%; }
.f-personal   { border-radius: 48% 52% 44% 56% / 55% 45% 55% 45%; }
.frame.active { border-color: var(--blue); border-width: 2px; background-color: rgba(43, 68, 255, .05); }
.frame.near   { border-style: solid; border-color: var(--blue); background-color: rgba(43, 68, 255, .12); }
.frame.filled { opacity: 0; }

/* On the page, type turns back to ink */
.sheet[data-bg="mat"] .p-name.placed, .sheet[data-bg="mat"] .p-note.placed,
.sheet[data-bg="mat"].is-wide .p-name.on-page, .sheet[data-bg="mat"].is-wide .p-note.on-page { color: var(--ink); }
.p-name, .p-note { transition: color .3s ease; }
.piece.placed .rz { display: none; }
.piece.placed:hover .rz { display: block; }

.sheet.is-wide .p-ui {
  flex-direction: column; align-items: flex-start; gap: .6rem; max-width: 360px;
  border: 0; border-radius: 14px; padding: .9rem 1.1rem;
  cursor: default; touch-action: auto;
  box-shadow: 0 10px 26px rgba(0,0,0,.28);
}
.sheet.is-wide .p-ui .rz { display: none; }
.hint-main { font-weight: 700; }
.win { font-size: .9rem; line-height: 1.35; max-width: 19rem; }
.win[hidden] { display: none; }
.win a { color: var(--blue); }

/* ---------- Scroll cue ---------- */
.scroll-cue {
  position: absolute; z-index: 70; bottom: 1.1rem; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--paper); color: var(--ink); text-decoration: none;
  font-weight: 700; font-size: .95rem; white-space: nowrap;
  padding: .55rem .7rem .55rem 1.1rem; border-radius: 999px;
  box-shadow: 0 8px 20px rgba(0,0,0,.28);
  transition: background-color .3s ease, padding .3s ease, font-size .3s ease;
}
.scroll-cue svg { width: 1.6rem; height: 1.6rem; background: var(--ink); color: var(--paper); border-radius: 50%; padding: .25rem; animation: bob 1.6s ease-in-out infinite; }
.scroll-cue:hover { background: var(--yellow); }
@keyframes bob { 0%, 100% { translate: 0 -2px; } 50% { translate: 0 4px; } }
.sheet.complete .scroll-cue { background: var(--yellow); font-size: 1.1rem; padding: .75rem .8rem .75rem 1.4rem; }
.sheet.complete .scroll-cue svg { width: 2rem; height: 2rem; }

/* ---------- When the page is complete: stickers say what's behind them ---------- */
.sticker::after {
  content: attr(data-cta);
  position: absolute; left: 50%; bottom: -.85rem; transform: translateX(-50%) scale(.6);
  background: var(--ink); color: var(--paper); border: 2px solid var(--paper);
  font-size: .72rem; font-weight: 700; font-stretch: 100%; white-space: nowrap;
  padding: .2rem .6rem; border-radius: 999px;
  opacity: 0; transition: opacity .3s ease .4s, transform .3s ease .4s;
  pointer-events: none;
}
.sheet.complete .sticker::after { opacity: 1; transform: translateX(-50%) scale(calc(1 / var(--s, 1))); }
.sheet.complete .sticker:hover::after { background: var(--blue); }
.sheet.complete .sticker { cursor: pointer; }
.win strong { display: block; font-size: 1.05rem; }
.win { font-weight: 500; }

#work, .group, #about, #contact { scroll-margin-top: 4.5rem; }
@media (prefers-reduced-motion: reduce) { .scroll-cue svg { animation: none; } }
.sheet.complete .hint { display: none; }

/* ---------- Guidance on the page ---------- */
.frame > .ico { width: min(42%, 72px); height: auto; }
.frame.active > .ico, .frame.near > .ico { color: rgba(43, 68, 255, .45); }
.ph { width: 82%; height: 62%; display: block; }
.ph-name { background:
  linear-gradient(currentColor, currentColor) 0 8% / 92% 38% no-repeat,
  linear-gradient(currentColor, currentColor) 0 92% / 64% 38% no-repeat; }
.ph-note { height: 70%; background: repeating-linear-gradient(to bottom, currentColor 0 5px, transparent 5px 16px); }
.page-hint {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%) rotate(-4deg);
  text-align: center; z-index: 3; pointer-events: none;
  font-weight: 900; font-stretch: 125%; font-size: clamp(1.4rem, 2.6vw, 2.3rem); line-height: 1;
  color: var(--blue); opacity: 1; transition: opacity .4s ease;
}
.page-hint small { display: block; margin-top: .5rem; font-size: .9rem; font-weight: 600; font-stretch: 100%; color: var(--grey); }
.page-hint { text-shadow: 0 0 12px #fff, 0 0 4px #fff; }

/* hand-drawn arrow from the text (a movable piece) to the page;
   it goes once the text has been picked up, placed or dropped on the page */
.to-page { display: none; position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; transform: rotate(calc(var(--r, 0deg) * -1)); pointer-events: none; }
.sheet.is-wide .p-note:not(.was-moved):not(.placed):not(.on-page):not(.no-arrow) .to-page { display: block; }
.sheet.complete .to-page { display: none !important; }

.rz { display: none !important; }
.hint small[hidden] { display: none; }

/* Award badge */
.award, .status {
  display: inline-block; vertical-align: .2em; margin-left: .6rem;
  background: var(--yellow); color: var(--ink); border-radius: 999px;
  font-size: .75rem; font-weight: 800; font-stretch: 100%; line-height: 1;
  padding: .35rem .65rem; transform: rotate(-2deg);
}
.rows li { position: relative; }
.award-link { display: inline-block; margin: 0 0 .9rem .75rem; font-size: var(--step--1); font-weight: 600; }

/* Featured project with its published pieces */
.rows li.feature { background: #fffbe0; border-bottom: 3px solid var(--ink); padding-bottom: .4rem; }
.rows li.feature > .row .r-title { font-size: var(--step-2); }
.pieces { list-style: none; margin: .2rem 0 .6rem; padding: 0 .75rem; display: grid; gap: .1rem; }
.pieces a {
  display: grid; grid-template-columns: 9rem minmax(0, 1fr) 5.5rem; gap: 1rem; align-items: baseline;
  padding: .45rem .5rem; text-decoration: none; border-radius: 6px; font-size: var(--step--1);
}
.pieces a:hover, .pieces a:focus-visible { background: var(--yellow); }
.pieces b { font-weight: 800; }
.pieces span { text-decoration: underline; text-decoration-color: rgba(0,0,0,.25); text-underline-offset: 3px; }
.pieces time { color: var(--grey); text-align: right; }
@media (max-width: 760px) {
  .pieces a { grid-template-columns: 1fr auto; gap: .1rem .8rem; }
  .pieces span { grid-column: 1 / -1; grid-row: 2; }
}
.status { background: transparent; border: 2px solid currentColor; transform: none; padding: .25rem .6rem; }
.rows li.feature + li.feature { border-top: 0; }

/* =========================================================
   Cards (projects with images) and the page viewer
   ========================================================= */
.cards {
  list-style: none; margin: 1.25rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 2rem 1.5rem;
}
.card {
  display: flex; flex-direction: column; gap: .3rem; width: 100%; height: 100%;
  font: inherit; color: inherit; text-align: left; text-decoration: none;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.c-img {
  display: grid; place-items: center; aspect-ratio: 4 / 5; margin-bottom: .6rem;
  background: #eceee9; border-radius: 6px; padding: 8%; overflow: hidden;
  transition: background-color .2s ease;
}
.c-img img {
  max-width: 100%; max-height: 100%; width: auto; height: auto; display: block;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  transition: transform .25s ease;
}
.card:hover .c-img, .card:focus-visible .c-img { background: var(--c); }
.card:hover .c-img img, .card:focus-visible .c-img img { transform: rotate(-2deg) scale(1.03); }
.c-title { font-weight: 800; font-size: 1.05rem; line-height: 1.2; font-stretch: 108%; }
.c-meta { font-size: var(--step--1); font-weight: 600; }
.c-role { font-size: var(--step--1); color: var(--grey); }
.c-count { margin-top: .3rem; font-size: .8rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.cards + .rows { margin-top: 2rem; border-top: 1px solid var(--rule); }

.viewer {
  width: min(1100px, 100vw); max-width: 100vw; height: 100vh; max-height: 100dvh;
  margin: 0 auto; padding: 0; border: 0; background: #2b2d2a; color: var(--paper);
}
.viewer::backdrop { background: rgba(0,0,0,.75); }
.v-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 1rem;
  padding: .9rem 1.2rem; background: #1f201e;
}
.v-head > div { flex: 1; min-width: 0; }
.v-title { font-weight: 800; font-size: 1.05rem; }
.v-meta { font-size: .85rem; opacity: .75; }
.v-link { color: var(--yellow); font-weight: 700; font-size: .9rem; white-space: nowrap; }
.v-link[hidden] { display: none; }
.v-close {
  font: inherit; font-weight: 700; cursor: pointer; background: var(--paper); color: var(--ink);
  border: 0; border-radius: 999px; padding: .5rem 1rem;
}
.v-pages {
  height: calc(100% - 4.2rem); overflow-y: auto; padding: 1.5rem;
  display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
}
.v-pages img { max-width: 100%; height: auto; box-shadow: 0 10px 30px rgba(0,0,0,.4); background: #fff; }
html.viewing { overflow: hidden; }
@media (max-width: 760px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 1rem; }
  .c-title { font-size: .95rem; }
  .v-head { flex-wrap: wrap; }
  .v-pages { padding: .75rem; gap: .75rem; }
}

.c-img { position: relative; }
.c-img .award { position: absolute; left: .6rem; top: .6rem; margin: 0; z-index: 1; }
.card[href*="youtube"] .c-img { padding: 0; aspect-ratio: 16 / 9; }
.card[href*="youtube"] .c-img img { width: 100%; height: 100%; max-height: none; object-fit: cover; box-shadow: none; }
.card[href*="youtube"]:hover .c-img img { transform: scale(1.03); }
.card.collage .c-img { padding: 0; }
.card.collage .c-img img { width: 100%; height: 100%; object-fit: cover; box-shadow: none; max-height: none; }
.card.collage:hover .c-img img { transform: scale(1.03); }
.card.static { cursor: default; }
.card.static:hover .c-img { background: #eceee9; }
.card.static:hover .c-img img { transform: none; }

/* Closing line of the work section */
.more {
  margin-top: clamp(1rem, 3vw, 2rem); padding-top: 1.5rem; border-top: 3px solid var(--ink);
  font-size: var(--step-2); font-weight: 800; font-stretch: 112%; line-height: 1.15; max-width: 30ch;
}
.more a { color: var(--blue); text-decoration-thickness: .08em; text-underline-offset: .12em; }
.more a:hover { color: var(--ink); background: var(--yellow); }
