/* ==========================================================================
   GIANI.IO
   Static portfolio shell
   12-column Swiss grid / 8px baseline / fixed sidebar
   ========================================================================== */


/* ==========================================================================
   Fonts
   ========================================================================== */

@font-face {
  font-family: "Inter Light";
  src: url("../fonts/inter-light-subset.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-subset.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}


/* ==========================================================================
   Design Tokens
   ========================================================================== */

:root {
  --bg: #fafafa;
  --ink: #141414;
  --muted: #6f6f6f;
  --rule: #dedede;
  --swiss-red: #d00000;

  --unit: 8px;

  --page-max: 1440px;

  --page-pad-top: 100px;
  --page-pad-bottom: 136px;
  --page-pad-left: clamp(96px, 9vw, 160px);
  --page-pad-right: clamp(24px, 6vw, 72px);

  --grid-gap: 32px;

  --lh-micro: 16px;
  --lh-body: 24px;
  --lh-large: 32px;
}


/* ==========================================================================
   Base
   ========================================================================== */

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter Light", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: var(--lh-body);

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  text-rendering: optimizeLegibility;
  font-kerning: normal;
  font-synthesis: none;
  font-optical-sizing: auto;
}

body {
  margin: 0;
  background: var(--bg);

  opacity: 0;
  animation: page-fade-in 1s ease forwards;

  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  font-variant-ligatures: common-ligatures contextual;
}

@keyframes page-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  body {
    opacity: 1;
    animation: none;
  }
}

::selection {
  background: var(--swiss-red);
  color: #ffffff;
  text-shadow: none;
}

::-moz-selection {
  background: var(--swiss-red);
  color: #ffffff;
  text-shadow: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

a:hover {
  text-decoration: underline;
}

p,
h1,
h2,
h3 {
  margin: 0;
  font-weight: 300;
}


/* ==========================================================================
   Accessibility
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}


/* ==========================================================================
   Layout
   ========================================================================== */

.site {
  position: relative;

  width: 100%;
  max-width: var(--page-max);
  min-height: auto;
  margin: 0 auto;
  padding:
    0
    var(--page-pad-right)
    var(--page-pad-bottom)
    var(--page-pad-left);

  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--grid-gap);
}

.sidebar {
  grid-column: 1 / span 2;

  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: var(--lh-body);
  text-transform: uppercase;
}

.sidebar-inner {
  position: fixed;
  top: var(--page-pad-top);
  left: calc(((100vw - min(100vw, var(--page-max))) / 2) + var(--page-pad-left));

  width: calc(
    (
      (min(100vw, var(--page-max)) - var(--page-pad-left) - var(--page-pad-right) - (11 * var(--grid-gap))) / 12 * 2
    ) + var(--grid-gap)
  );

  max-height: calc(100vh - var(--page-pad-top) - 32px);
  overflow: auto;
  scrollbar-width: none;
}

.sidebar-inner::-webkit-scrollbar {
  display: none;
}

.main {
  grid-column: 3 / span 10;
  min-width: 0;
  padding-top: var(--page-pad-top);
}

.content {
  width: 100%;
  max-width: none;
}


/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */

.brand {
  margin-bottom: 32px;
}

.brand a {
  color: var(--swiss-red);
}

.brand a:hover {
  color: var(--swiss-red);
  text-decoration: none;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 32px;
}

.nav a {
  width: fit-content;
}

.sidebar a:hover {
  text-decoration: none;
}

.project-nav {
  margin-bottom: 32px;
}

.project-nav a {
  color: var(--muted);
}

.project-nav a.is-active,
.project-nav a.is-active:hover {
  color: var(--muted);
  text-decoration: underline;
}

.utility-nav {
  display: flex;
  flex-direction: column;
  margin-top: 32px;

  color: var(--muted);
}

.utility-row {
  display: flex;
  gap: 8px;
}

.utility-row span {
  color: var(--muted);
}

.utility-nav a.is-active,
.utility-nav a.is-active:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Mobile Navigation
   ========================================================================== */

.mobile-nav {
  display: none;
}


/* ==========================================================================
   Project Page
   ========================================================================== */

.project-meta {
  margin-bottom: 32px;

  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: var(--lh-body);
  text-transform: uppercase;
}

.project-intro {
  width: 100%;
  max-width: 1120px;
  margin-bottom: 64px;
}

.project-intro h1 {
  margin-bottom: 32px;
}

.project-intro p {
  margin-bottom: 32px;
  padding-right: 10px;

  color: var(--muted);
  font-size: 24px;
  line-height: var(--lh-large);

  text-wrap: pretty;
  hyphens: auto;
  overflow-wrap: normal;
  word-break: normal;

  text-shadow: 0 0 2px #ffffff;
}

.project-intro p:last-child {
  margin-bottom: 0;
}

.project-images {
  display: grid;
  gap: 32px;
}

.project-images img {
  width: 100%;
  height: auto;
}


/* ==========================================================================
   Project Metadata Typewriter
   ========================================================================== */

.project-meta.is-typing {
  white-space: pre-line;
}

.project-meta.is-typing::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 1em;
  margin-left: 4px;

  background: var(--swiss-red);
  vertical-align: -0.12em;

  animation: cursor-blink 900ms steps(1) infinite;
}

.project-meta.is-typed::after {
  animation: cursor-fade-out 700ms ease forwards;
}

@keyframes cursor-blink {
  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

@keyframes cursor-fade-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}


/* ==========================================================================
   Poster Reveal
   Fade only. First poster is skipped in JS and appears on page load.
   ========================================================================== */

.project-images img.reveal-item {
  opacity: 0;
  transition: opacity 1400ms ease;
  will-change: opacity;
}

.project-images img.reveal-item.is-visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .project-images img.reveal-item {
    opacity: 1;
    transition: none;
  }
}


/* ==========================================================================
   CV
   ========================================================================== */

.cv-experience {
  margin-top: 0;
}

.cv-item {
  display: block;
  padding-bottom: 32px;
}

.cv-role {
  margin-bottom: 0;

  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: var(--lh-body);
  text-transform: uppercase;
}

.cv-meta-line {
  margin-bottom: 24px;

  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: var(--lh-body);
  text-transform: uppercase;
}

.cv-meta-line a:hover {
  cursor: pointer;
  text-decoration: none;
}

.cv-copy {
  width: 100%;
  max-width: 1120px;
  padding-right: 25px;

  color: var(--muted);
  font-size: 24px;
  line-height: var(--lh-large);

  text-wrap: pretty;
  hyphens: auto;
  overflow-wrap: normal;
  word-break: normal;

  text-shadow: 0 0 2px #ffffff;
}

.cv-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;

  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: var(--lh-body);
  text-transform: uppercase;
}

.cv-actions a {
  color: var(--muted);
}

.cv-actions a:hover {
  color: var(--ink);
  text-decoration: none;
}


/* ==========================================================================
   Contact
   ========================================================================== */

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 64px;

  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: var(--lh-body);
}

.contact-list .email {
  color: var(--swiss-red);
}

.contact-list a {
  width: fit-content;
}

.contact-list a:hover {
  color: var(--ink);
  text-decoration: none;
}

.contact-list span {
  color: var(--muted);
}


/* ==========================================================================
   Transmissions
   ========================================================================== */

.transmission-list {
  display: grid;
  row-gap: 48px;
  margin-top: 0;
}

.transmission-item {
  display: block;
}

.transmission-title {
  margin-bottom: 0;

  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: var(--lh-body);
  text-transform: uppercase;
}

.transmission-meta-line {

  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: var(--lh-body);
  text-transform: uppercase;
}

.transmission-excerpt {
  width: 100%;
  max-width: 1120px;
  margin-bottom: 0;

  color: var(--muted);
  font-size: 24px;
  line-height: var(--lh-large);

  text-wrap: pretty;
  hyphens: auto;
  overflow-wrap: normal;
  word-break: normal;

  text-shadow: 0 0 2px #ffffff;
}

.transmission-link {
  display: block;
  width: fit-content;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.transmission-link:hover {
  color: var(--ink);
  text-decoration: none;
}


/* ==========================================================================
   Transmission Pagination
   ========================================================================== */

.transmission-pagination {
  display: flex;
  gap: 16px;
  margin-top: 48px;

  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: var(--lh-body);
  text-transform: uppercase;
}

.transmission-pagination a {
  color: var(--muted);
}

.transmission-pagination a:hover,
.transmission-pagination a.is-active {
  color: var(--ink);
  text-decoration: none;
}

.transmission-pagination a[aria-disabled="true"] {
  opacity: 0.35;
  pointer-events: none;
}


/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  margin-top: 64px;

  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  line-height: var(--lh-micro);
}


/* ==========================================================================
   Mono Rendering
   Archive/index type should stay crisp and mechanical.
   ========================================================================== */

.sidebar,
.project-meta,
.footer,
.cv-role,
.cv-meta-line,
.cv-actions,
.contact-list,
.transmission-title,
.transmission-meta-line,
.transmission-link,
.transmission-pagination {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  text-rendering: geometricPrecision;
  font-kerning: normal;
  font-synthesis: none;

  font-variant-ligatures: none;
  font-feature-settings:
    "kern" 1,
    "liga" 0,
    "calt" 0,
    "tnum" 1,
    "case" 1;
}


/* ==========================================================================
   Dev Helpers
   Press G to reveal the baseline + column grid.
   ========================================================================== */

body.show-columns .site::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--page-pad-left);
  right: var(--page-pad-right);
  z-index: 9998;
  pointer-events: none;

  background-image: repeating-linear-gradient(
    to right,
    rgba(20, 20, 20, 0.06) 0,
    rgba(20, 20, 20, 0.06) calc((100% - (11 * var(--grid-gap))) / 12),
    transparent calc((100% - (11 * var(--grid-gap))) / 12),
    transparent calc(((100% - (11 * var(--grid-gap))) / 12) + var(--grid-gap))
  );
}

body.show-baseline .site::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 9999;
  pointer-events: none;

  background-image: linear-gradient(
    to bottom,
    rgba(20, 20, 20, 0.08) 1px,
    transparent 1px
  );

  background-size: 100% 8px;
  background-position-y: var(--page-pad-top);
}


/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  body.nav-open {
    overflow: hidden;
  }

.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10002;

  display: flex;
  align-items: center;
  justify-content: space-between;

  height: 64px;
  padding: 0 24px;

  background: var(--ink);
  color: var(--bg);

  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: var(--lh-body);
  text-transform: uppercase;
}

  .mobile-brand {
    color: var(--bg);
  }

  .mobile-brand:hover {
    text-decoration: none;
  }

  .mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;
    padding: 0;

    appearance: none;
    background: transparent;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
  }

  .mobile-toggle-dot {
    display: block;

    width: 14px;
    height: 14px;

    background: var(--bg);
    border: 1px solid var(--bg);
    border-radius: 999px;

    transition:
      background-color 180ms ease,
      border-color 180ms ease,
      transform 180ms ease;
  }

  .mobile-toggle.is-open .mobile-toggle-dot {
    background: transparent;
    border-color: var(--bg);
    transform: scale(1.08);
  }

  .site {
    display: block;
    padding: 96px 24px 64px;
  }
  
  .sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;

    display: block;
    margin: 0;
    padding: 32px 24px 64px;

    background: var(--ink);
    color: var(--bg);

    overflow: auto;

    opacity: 0;
    pointer-events: none;
    transform: translateY(-16px);

    transition:
      opacity 220ms ease,
      transform 220ms ease;
  }

  body.nav-open .sidebar {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .sidebar-inner {
    position: static;
    width: auto;
    max-height: none;
    overflow: visible;
  }

  .sidebar .brand {
    display: none;
  }

  .sidebar a:hover {
    text-decoration: none;
  }

  .project-nav {
    margin-bottom: 32px;
  }

  .project-nav a,
  .utility-nav,
  .utility-row span {
    color: rgba(250, 250, 250, 0.62);
  }

  .project-nav a.is-active,
  .project-nav a.is-active:hover,
  .utility-nav a.is-active,
  .utility-nav a.is-active:hover {
    color: var(--bg);
    text-decoration: underline;
  }

  .main {
    padding-top: 0;
  }

  .content {
    max-width: none;
  }

  .project-meta {
    margin-bottom: 24px;
  }

  .project-intro,
  .cv-copy,
  .transmission-excerpt {
    max-width: none;
  }

  .project-intro p,
  .cv-copy,
  .transmission-excerpt {
    padding-right: 0;
    font-size: 22px;
    line-height: 32px;
  }

  .project-images {
    gap: 24px;
  }

  .cv-item {
    padding-bottom: 56px;
  }

  .transmission-list {
    row-gap: 48px;
  }

  .transmission-pagination,
  .cv-actions {
    flex-wrap: wrap;
  }
}

/* ==========================================================================
   CMS Login
   ========================================================================== */

.login-record {
  display: block;
}

.login-copy {
  max-width: 760px;
  margin-bottom: 32px;
}

.login-form {
  display: grid;
  gap: 24px;
  max-width: 420px;
  margin-top: 32px;

  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: var(--lh-body);
  text-transform: uppercase;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  padding: 10px 0;

  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  outline: none;

  background: transparent;
  color: var(--ink);

  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: var(--lh-body);
}

.login-form input::placeholder {
  color: var(--muted);
  opacity: 0.65;
}

.login-form input:focus {
  border-bottom-color: var(--swiss-red);
}

.login-options {
  margin-top: -8px;
}

.login-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;

  width: fit-content;

  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: var(--lh-body);
  text-transform: uppercase;

  cursor: pointer;
}

.login-checkbox input[type="checkbox"] {
  display: inline-block;

  width: 12px;
  min-width: 12px;
  height: 12px;
  min-height: 12px;
  padding: 0;
  margin: 0;

  appearance: none;
  -webkit-appearance: none;

  border: 1px solid var(--muted);
  border-radius: 999px;
  background: transparent;

  cursor: pointer;
}

.login-checkbox input[type="checkbox"]:checked {
  background: var(--muted);
  border-color: var(--muted);
}

.login-checkbox input[type="checkbox"]:focus {
  outline: none;
  border-color: var(--swiss-red);
}

.login-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 16px;

  margin-top: 8px;

  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: var(--lh-body);
  text-transform: uppercase;
}

.login-actions a,
.login-actions button {
  display: inline-flex;
  align-items: center;

  padding: 0;
  border: 0;

  background: transparent;
  color: var(--muted);

  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: var(--lh-body);
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;

  cursor: pointer;
}

.login-actions a:hover,
.login-actions button:hover {
  color: var(--ink);
  text-decoration: none;
}

.login-error {
  margin: 0 0 24px;

  color: var(--swiss-red);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: var(--lh-body);
  text-transform: uppercase;
}


/* Kill Safari/Chrome autofill field background on CMS login */

.login-form input:-webkit-autofill,
.login-form input:-webkit-autofill:hover,
.login-form input:-webkit-autofill:focus,
.login-form input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset;
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  transition: background-color 9999s ease-in-out 0s;
}

.login-form input {
  background-color: transparent;
}


/* CMS login title */

.login-title {
  margin-bottom: 24px;

  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: var(--lh-body);
  text-transform: uppercase;
}


/* ==========================================================================
   CMS Login — Baseline Alignment Pass
   Keep login form controls locked to the 8px / 24px public grid rhythm.
   ========================================================================== */

.login-form input[type="text"],
.login-form input[type="password"] {
  height: var(--lh-body);
  padding: 0;

  line-height: var(--lh-body);
}

.login-options,
.login-actions {
  min-height: var(--lh-body);
}

.login-options {
  margin-top: 0;
}

.login-checkbox {
  height: var(--lh-body);
  align-items: center;
}

.login-actions {
  margin-top: 0;
}


/* CMS Login — Username / Password Breathing Room */

.login-form input[name="username"] {
  margin-bottom: 16px;
}

/* ==========================================================================
   Public Media
   ========================================================================== */

.public-media {
  margin: 48px 0;
}

.public-media-image img {
  display: block;
  width: 100%;
  height: auto;
}

.project-intro .public-media:first-child {
  margin-top: 0;
}

.project-intro .public-media:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Public Media Shortcodes
   ========================================================================== */

.public-media {
  margin: 48px 0;
}

.public-media-image img {
  display: block;
  width: 100%;
  height: auto;
}

.public-media-image figcaption {
  margin-top: 12px;
  max-width: 720px;

  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
