/* ============================================================
   italosannino.com — main.css
   Design system tokens + layout + animazioni
   ============================================================ */

/* ------------------------------------------------------------
   FONT FACES — self-hosted
   ------------------------------------------------------------ */

@font-face {
  font-family: 'Geist';
  src: url('fonts/Geist-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist';
  src: url('fonts/Geist-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'GT Flexa Mono';
  src: url('fonts/GT-Flexa-Mono-Regular.woff2') format('woff2'),
       url('fonts/GT-Flexa-Mono-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Source Serif 4';
  src: url('fonts/SourceSerif418pt-Regular.woff2') format('woff2'),
       url('fonts/SourceSerif418pt-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Source Serif 4';
  src: url('fonts/SourceSerif418pt-Italic.woff2') format('woff2'),
       url('fonts/SourceSerif418pt-Italic.woff') format('woff');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ------------------------------------------------------------
   TOKENS — Dark mode (default)
   ------------------------------------------------------------ */

:root {
  /* Color — surface */
  --color-surface-default:   #0f0f0d;
  --color-surface-primary:   #efefed;
  --color-surface-secondary: #a8a8a4;
  --color-surface-tertiary:  #828280;

  /* Color — text */
  --color-text-primary:   #efefed;
  --color-text-secondary: #a8a8a4;
  --color-text-tertiary:  #828280;

  /* Color — border */
  --color-border-default: #2a2a28;

  /* Font — family */
  --font-family-display: 'Geist', sans-serif;
  --font-family-body:    'Source Serif 4', serif;
  --font-family-mono:    'GT Flexa Mono', 'Courier New', monospace;

  /* Font — size */
  --font-size-body:         15px;
  --font-size-ui-body:      13px;
  --font-size-ui-label:     12px;
  --font-size-mono-default: 11.5px;
  --font-size-mono-small:   10.5px;
  --font-size-mono-link:    13.5px;

  /* Font — line height */
  --font-lineheight-double: 21px;

  /* Font — tracking */
  --font-tracking-mono: 0.03em;

  /* Spacing */
  --spacing-xs:  8px;
  --spacing-sm:  16px;
  --spacing-md:  24px;
  --spacing-lg:  40px;
  --spacing-xl:  64px;
  --spacing-2xl: 96px;

  /* Layout */
  --margin-lateral: 404px;
  --col-width:      198px;
  --col-gap:        20px;
  --content-width:  634px; /* 198×3 + 20×2 */
}

/* ------------------------------------------------------------
   TOKENS — Light mode override
   ------------------------------------------------------------ */

@media (prefers-color-scheme: light) {
  :root {
    --color-surface-default:   #fafaf8;
    --color-surface-primary:   #111111;
    --color-surface-secondary: #4a4a4a;
    --color-surface-tertiary:  #909090;

    --color-text-primary:   #111111;
    --color-text-secondary: #4a4a4a;
    --color-text-tertiary:  #737373;

    --color-border-default: #d8d8d4;
  }
}

/* ------------------------------------------------------------
   RESET & BASE
   ------------------------------------------------------------ */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--color-surface-default);
  color: var(--color-text-primary);
  font-family: var(--font-family-display);
  font-size: var(--font-size-body);
  min-height: 100vh;
}

ul {
  list-style: none;
}

/* ------------------------------------------------------------
   LINK
   ------------------------------------------------------------ */

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2.5px;
  transition: color 150ms ease;
}

a:hover {
  color: var(--color-text-tertiary);
}

a.esterno {
  text-decoration: underline dashed;
}

/* ------------------------------------------------------------
   LAYOUT — pagina
   ------------------------------------------------------------ */

.page {
  width: 1440px;
  margin: 0 auto;
  padding: 0 var(--margin-lateral);
}

/* ------------------------------------------------------------
   ANIMAZIONI
   ------------------------------------------------------------ */

@keyframes nome-in {
  0%   { opacity: 0; transform: translateY(8px); font-variation-settings: 'wght' 100; }
  100% { opacity: 1; transform: translateY(0);   font-variation-settings: 'wght' 600; }
}

@keyframes fade-up {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------
   HEADER
   ------------------------------------------------------------ */

.header {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  padding-top: 80px;
}

.nome {
  font-family: var(--font-family-display);
  font-size: var(--font-size-body);
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: normal;
  font-variation-settings: 'wght' 100;
  opacity: 0;
  transform: translateY(8px);
  animation: nome-in 700ms cubic-bezier(0.16, 1, 0.3, 1) 0ms forwards;
}

/* ------------------------------------------------------------
   FUNZIONE-FORMA
   ------------------------------------------------------------ */

.funzione-forma {
  display: flex;
  gap: 1px;
  align-items: center;
  opacity: 0;
  transform: translateY(8px);
  animation: fade-up 500ms cubic-bezier(0.16, 1, 0.3, 1) 100ms forwards;
}

.funzione,
.forma {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.funzione { width: 208px; }
.forma    { width: 207px; }

.funzione-label,
.forma-label {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-mono-small);
  letter-spacing: var(--font-tracking-mono);
  color: var(--color-text-primary);
  line-height: normal;
}

.funzione-bar {
  height: 4px;
  background-color: var(--color-surface-primary);
}

.forma-bar {
  height: 4px;
  background-color: var(--color-surface-tertiary);
}

/* ------------------------------------------------------------
   HERO
   ------------------------------------------------------------ */

.hero {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-top: 32px;
}

.bio {
  font-family: var(--font-family-body);
  font-size: var(--font-size-body);
  font-weight: 400;
  color: var(--color-text-secondary);
  line-height: var(--font-lineheight-double);
  width: var(--content-width);
  opacity: 0;
  transform: translateY(8px);
  animation: fade-up 500ms cubic-bezier(0.16, 1, 0.3, 1) 200ms forwards;
}

.bio em {
  font-style: italic;
}

.credentials {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-mono-default);
  letter-spacing: var(--font-tracking-mono);
  color: var(--color-text-tertiary);
  line-height: normal;
  min-height: 1.2em;
  opacity: 0;
  animation: fade-up 400ms cubic-bezier(0.16, 1, 0.3, 1) 300ms forwards;
}

/* ------------------------------------------------------------
   3 COLONNE
   ------------------------------------------------------------ */

.tre-colonne {
  display: flex;
  gap: var(--col-gap);
  align-items: flex-start;
  margin-top: 64px;
  padding-bottom: var(--spacing-xl);
}

.colonna {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  width: var(--col-width);
  flex-shrink: 0;
  opacity: 0;
  transform: translateY(8px);
  animation: fade-up 500ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#col-1 { animation-delay: 450ms; }
#col-2 { animation-delay: 530ms; }
#col-3 { animation-delay: 610ms; }

.colonna-label {
  font-family: var(--font-family-display);
  font-size: var(--font-size-ui-label);
  font-weight: 400;
  color: var(--color-text-tertiary);
  line-height: normal;
}

.colonna-lista {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

/* ------------------------------------------------------------
   MODULO-LINK
   ------------------------------------------------------------ */

.modulo-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modulo-link-titolo {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-mono-link);
  letter-spacing: var(--font-tracking-mono);
  color: var(--color-text-primary);
  text-decoration: underline;
  text-underline-offset: 2.5px;
  line-height: normal;
  transition: color 150ms ease;
  display: block;
}

.modulo-link-titolo:hover {
  color: var(--color-text-tertiary);
}

.modulo-link-titolo.esterno {
  text-decoration: underline dashed;
}

.modulo-link-desc {
  font-family: var(--font-family-display);
  font-size: var(--font-size-ui-body);
  font-weight: 400;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.modulo-link-meta {
  color: var(--color-text-secondary);
  display: block;
}

/* ------------------------------------------------------------
   CONTATTO
   ------------------------------------------------------------ */

.contatto {
  margin-top: var(--spacing-xl);
  padding-bottom: var(--spacing-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.contatto-mail,
.contatto-colophon {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-mono-default);
  letter-spacing: var(--font-tracking-mono);
  color: var(--color-text-tertiary);
  text-decoration: none;
  transition: color 150ms ease;
}

.contatto-mail:hover,
.contatto-colophon:hover {
  color: var(--color-text-primary);
}

/* ============================================================
   RESPONSIVE — 1024px (tablet landscape)
   ============================================================ */

@media (max-width: 1024px) {
  :root {
    --margin-lateral: 48px;
    --col-width:      auto;
    --col-gap:        24px;
    --content-width:  100%;
  }

  .page {
    width: 100%;
    max-width: 900px;
    padding: 0 var(--margin-lateral);
  }

  .funzione-forma {
    width: 100%;
  }

  .funzione { width: 51%; }
  .forma    { width: 49%; }

  .bio {
    width: var(--content-width);
  }

  .tre-colonne {
    gap: var(--col-gap);
  }

  .colonna {
    flex: 1;
    min-width: 0;
  }
}

/* ============================================================
   RESPONSIVE — 480px (mobile / iPhone fascia alta)
   ============================================================ */

@media (max-width: 480px) {
  :root {
    --margin-lateral: 24px;
    --content-width:  100%;
    --col-gap:        var(--spacing-xl);
  }

  .page {
    width: 100%;
    padding: 0 var(--margin-lateral);
  }

  .header {
    padding-top: 48px;
    gap: var(--spacing-md);
  }

  .funzione-forma {
    width: 100%;
  }

  .funzione { width: 51%; }
  .forma    { width: 49%; }

  .hero {
    margin-top: var(--spacing-md);
  }

  .bio {
    width: 100%;
  }

  .tre-colonne {
    flex-direction: column;
    margin-top: var(--spacing-xl);
  }

  .colonna {
    width: 100%;
  }

  .contatto {
    margin-top: var(--spacing-lg);
    padding-bottom: var(--spacing-xl);
  }
}
