/* ============================================================================
   giovannicarosso.com — design system
   Same language as the CV and resume: Helvetica Neue, black, hairline rules.
   Edit the variables below to retune the whole site at once.
   ========================================================================== */

:root {
  --ink:   #000;        /* body text                */
  --mute:  #6b6b6b;     /* secondary text, captions */
  --faint: #9b9b9b;     /* tertiary                 */
  --rule:  #dcdcdc;     /* hairlines                */
  --bg:    #fff;
  --panel: #f7f7f7;     /* card / figure background */
  --accent:#000;        /* set a colour here if you ever want one */
  --max:   680px;       /* text measure             */
  --wide:  1040px;      /* galleries and wide media */
}

@media (prefers-color-scheme: dark) {
  :root { --ink:#f1f1f1; --mute:#9d9d9d; --faint:#777; --rule:#2e2e2e;
          --bg:#0c0c0c; --panel:#161616; --accent:#f1f1f1; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0 24px 110px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.62;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.wrap      { max-width: var(--max);  margin: 0 auto; }
.wrap-wide { max-width: var(--wide); margin: 0 auto; }

/* ---------------------------------------------------------------- header */
header { padding: 74px 0 0; }

.sitename {
  font-size: 19px; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; margin: 0 0 14px; display: inline-block;
  border: 0;
}

nav { margin: 0 0 34px; padding-bottom: 22px; border-bottom: 1.5px solid var(--ink); }
nav a {
  font-size: 13px; letter-spacing: .04em; margin-right: 20px;
  color: var(--mute); border: 0; display: inline-block; padding: 3px 0;
}
nav a:hover, nav a[aria-current="page"] { color: var(--ink); }
nav a[aria-current="page"] { border-bottom: 1px solid var(--ink); }

/* ---------------------------------------------------------------- type */
h1 { font-size: 27px; line-height: 1.25; font-weight: 700; margin: 0 0 12px; letter-spacing: -.01em; }
h2 {
  font-size: 12px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase;
  margin: 56px 0 18px; padding-bottom: 7px; border-bottom: 1px solid var(--rule);
}
h3 { font-size: 17px; font-weight: 700; margin: 30px 0 6px; }
h4 { font-size: 15px; font-weight: 700; margin: 22px 0 4px; }

p { margin: 0 0 18px; }
.lede { font-size: 19px; line-height: 1.5; margin-bottom: 26px; }
.small { font-size: 13.5px; }
.muted { color: var(--mute); }

a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
a:hover { border-bottom-color: var(--ink); }

hr { border: 0; border-top: 1px solid var(--rule); margin: 46px 0; }

/* ---------------------------------------------------------------- lists */
ul.dash { margin: 0 0 18px; padding: 0; list-style: none; }
ul.dash li { position: relative; padding-left: 18px; margin-bottom: 10px; }
ul.dash li::before { content: "–"; position: absolute; left: 0; }

/* ---------------------------------------------------------------- home cards */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
         background: var(--rule); border: 1px solid var(--rule); margin: 6px 0 0; }
.card { background: var(--bg); padding: 22px 20px 20px; display: block; border: 0; }
.card:hover { background: var(--panel); }
.card .k { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.card .t { font-size: 17px; font-weight: 700; margin: 5px 0 4px; }
.card .d { font-size: 13.5px; color: var(--mute); line-height: 1.5; }

/* ---------------------------------------------------------------- index rows */
.entry { padding: 17px 0; border-bottom: 1px solid var(--rule); }
.entry:first-of-type { border-top: 1px solid var(--rule); }
.entry .date  { font-size: 12.5px; color: var(--faint); letter-spacing: .04em; }
.entry .title { font-weight: 700; display: block; font-size: 16.5px; margin: 2px 0 3px; border: 0; }
.entry a.title:hover { border-bottom: 1px solid var(--ink); display: inline-block; }
.entry .dek   { font-size: 14px; color: var(--mute); line-height: 1.5; }

/* ---------------------------------------------------------------- figures */
figure { margin: 34px 0; }
figure img, figure svg, figure .plot { width: 100%; height: auto; display: block;
  background: var(--panel); border: 1px solid var(--rule); }
figcaption { font-size: 13px; color: var(--mute); margin-top: 9px; line-height: 1.5; }
figcaption b { color: var(--ink); font-weight: 700; }

/* pull a figure wider than the text column on big screens */
@media (min-width: 900px) {
  .figure-wide { width: var(--wide); margin-left: calc((var(--max) - var(--wide)) / 2); }
}

/* ---------------------------------------------------------------- photo grid */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); margin: 8px 0 30px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.grid figure { margin: 0; }
.grid img { aspect-ratio: 4/3; object-fit: cover; }
.grid figcaption { font-size: 12.5px; margin-top: 6px; }

@media (max-width: 720px) { .grid, .grid.two { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .grid, .grid.two { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- reading list */
.item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.item:first-of-type { border-top: 1px solid var(--rule); }
.item .cover { flex: 0 0 46px; height: 66px; background: var(--panel);
               border: 1px solid var(--rule); object-fit: cover; }
.item .body { flex: 1; }
.item .t { font-weight: 700; font-size: 15.5px; }
.item .a { font-size: 13px; color: var(--mute); }
.item .n { font-size: 13.5px; color: var(--mute); margin-top: 5px; line-height: 1.5; }

/* ---------------------------------------------------------------- CV blocks */
.role { margin-bottom: 26px; }
.role-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.role-head .org { font-weight: 700; }
.role-head .when { font-size: 13px; color: var(--mute); white-space: nowrap; }
.role .sub { font-size: 13.5px; color: var(--mute); margin-bottom: 8px; }
@media (max-width: 560px) {
  .role-head { display: block; }
  .role-head .when { display: block; }
}

/* ---------------------------------------------------------------- footer */
footer { margin-top: 70px; padding-top: 20px; border-top: 1px solid var(--rule);
         font-size: 13px; color: var(--mute); }
footer a { color: var(--mute); }

.back { font-size: 13px; color: var(--mute); display: inline-block; margin-bottom: 30px; border: 0; }
.back:hover { color: var(--ink); }

/* ============================================================================
   DRAFT MODE
   <body class="draft"> turns on the scaffolding: placeholder outlines, a banner,
   and TODO chips. Delete the class from a page to preview it as it will ship.
   ========================================================================== */

.draftbar {
  position: sticky; top: 0; z-index: 50; margin: 0 -24px 0; padding: 7px 24px;
  background: #ffd400; color: #000; font-size: 12px; letter-spacing: .04em;
  display: none;
}
.draft .draftbar { display: block; }
.draftbar b { font-weight: 700; }

/* placeholder text */
.ph { color: var(--mute); }
.draft .ph {
  outline: 1px dashed #c9a400; outline-offset: 3px; background: rgba(255,212,0,.07);
}
.draft .ph::before {
  content: "DRAFT"; font-size: 9.5px; letter-spacing: .14em; font-weight: 700;
  color: #8a7200; background: #ffe98a; padding: 1px 5px; margin-right: 7px;
  border-radius: 2px; vertical-align: 2px;
}

/* a whole section still to be built */
.todo { display: none; }
.draft .todo {
  display: block; border: 1px dashed #c9a400; background: rgba(255,212,0,.07);
  padding: 14px 16px; font-size: 13.5px; color: #6b5900; margin: 18px 0;
}
.draft .todo b { color: #000; }

/* placeholder media keeps layout honest before real assets land */
.draft figure img[src*="placeholder"], .draft .grid img[src*="placeholder"] {
  outline: 1px dashed #c9a400; outline-offset: -1px;
}

@media print { .draftbar, .todo { display: none !important; } .ph { outline: 0; background: none; } }
