/* ------------------------------------------------------------------
   alese.it — site styles
   Typefaces: display (name) / section (headings) / text (body) / mono
   (logo, dates, labels). The commercial faces are listed first so that
   adding an @font-face for them makes them take over automatically;
   the Google Fonts loaded in index.html are the stand-ins.
   ------------------------------------------------------------------ */

@font-face {
  font-family: "iA Writer Duospace";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/iAWriterDuospace-Regular.woff2") format("woff2"),
       url("../fonts/iAWriterDuospace-Regular.woff") format("woff");
}

:root {
  --font-display: "Heldane Display", "Heldane", "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-section: "Lyon Text", "Lyon", "EB Garamond", Garamond, Georgia, serif;
  --font-text: "Newsam", "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "iA Writer Duospace", Menlo, Consolas, monospace;

  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #444444;
  --frame: #dcdcdc;
  --rule: #e8e8e8;
  --track: #ededed;
  --net: #e4e4e4;
  --field: #fafafa;
  --control: #6b6b6b;
  --focus: #1a5fb4;
  --chip-dark: #2b2b2b;
  --chip-dark-fg: #ffffff;

  --chip-y: #f6b73c; --chip-y-fg: #282828;
  --chip-g: #4cb56f; --chip-g-fg: #0f2a19;
  --chip-r: #f07a8f; --chip-r-fg: #33101a;

  --frame-inset: 12px;
  --gutter: clamp(24px, 6vw, 80px);
  --content-width: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151515; --fg: #ececec; --muted: #b0b0b0; --frame: #3a3a3a; --rule: #2a2a2a;
    --track: #2a2a2a; --net: #242424; --field: #1b1b1b; --control: #9a9a9a; --focus: #8ab4f8; --chip-dark: #ececec; --chip-dark-fg: #151515;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151515; --fg: #ececec; --muted: #b0b0b0; --frame: #3a3a3a; --rule: #2a2a2a;
  --track: #2a2a2a; --net: #242424; --field: #1b1b1b; --control: #9a9a9a; --focus: #8ab4f8; --chip-dark: #ececec; --chip-dark-fg: #151515;
  color-scheme: dark;
}

/* ---- base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: var(--frame-inset);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-text);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
}
.skip-link:focus { top: 16px; text-decoration: none; }
.filetype { font-weight: 400; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }

.backdrop {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.backdrop-lines { stroke: var(--net); stroke-width: 0.7; fill: none; }
.backdrop-dots { fill: var(--net); }

.frame {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 2 * var(--frame-inset));
  border: 1px solid var(--frame);
  padding: 0 var(--gutter);
}
.site-header, main, .site-footer {
  width: 100%;
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
}

/* ---- header ---- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 40px 0 0;
}
.logo { font-family: var(--font-mono); font-size: 22px; }
.site-nav { display: flex; gap: 32px; margin-left: auto; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 16px; font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--control);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}
.icon-button:hover { border-color: var(--fg); }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}
.menu-button { display: none; }

/* ---- hero ---- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  min-height: min(640px, 80vh);
  padding: 40px 0;
  text-align: center;
}
.hero-name {
  font-family: var(--font-display);
  font-size: clamp(64px, 11vw, 160px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.hero-social { display: flex; justify-content: center; gap: 14px; margin-top: -8px; }
.social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.social:hover, .social:focus-visible { transform: translateY(-2px); filter: brightness(0.94); }
.social-y { background: var(--chip-y); color: var(--chip-y-fg); }
.social-g { background: var(--chip-g); color: var(--chip-g-fg); }
.social-r { background: var(--chip-r); color: var(--chip-r-fg); }
.social-d { background: var(--chip-dark); color: var(--chip-dark-fg); }
.hero-intro {
  max-width: 660px;
  font-size: 19px;
  line-height: 1.8;
}
.chip {
  padding: 1px 6px;
  font-weight: 600;
  color: var(--fg);
  background: transparent;
}
.chip-y { background: var(--chip-y); color: var(--chip-y-fg); }
.chip-g { background: var(--chip-g); color: var(--chip-g-fg); }
.chip-r { background: var(--chip-r); color: var(--chip-r-fg); }
.chip-d { background: var(--chip-dark); color: var(--chip-dark-fg); }
a.chip { text-decoration: none; transition: filter 0.15s ease, transform 0.15s ease; }
a.chip:hover, a.chip:focus-visible { text-decoration: none; filter: brightness(0.92); transform: translateY(-1px); }
.section, .timeline-item { scroll-margin-top: 32px; }
.timeline-item:target .timeline-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.hero-links { display: flex; gap: 28px; justify-content: center; }
.ulink {
  display: inline-block;
  padding-top: 8px;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 2px solid var(--fg);
  padding-bottom: 2px;
}
.ulink:hover { text-decoration: none; opacity: 0.7; }

/* ---- sections ---- */
.section {
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding: 96px 0;
}
.section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.section-label { font-family: var(--font-mono); font-size: 15px; color: var(--muted); }
.section-head h2 {
  font-family: var(--font-section);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.lede {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  font-size: 19px;
  line-height: 1.8;
}
.lede strong { font-weight: 600; }
.lede-small { max-width: 620px; font-size: 18px; color: var(--fg); }

/* skills */
.skills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 80px;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}
.skill { display: flex; flex-direction: column; gap: 8px; }
.skill-head { display: flex; justify-content: space-between; font-size: 16px; }
.skill-name { font-weight: 600; }
.skill-pct { color: var(--muted); }
.skill-track { height: 3px; background: var(--track); }
.skill-bar { height: 3px; background: var(--fg); }

/* projects */
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--rule);
  background: var(--bg);
}
.card h3 { font-size: 20px; font-weight: 600; }
.card p { font-size: 17px; line-height: 1.6; color: var(--fg); }

/* experience */
.timeline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 80px;
}
.timeline-col { display: flex; flex-direction: column; }
.timeline-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 0 18px 24px;
  border-left: 1px solid var(--rule);
}
.timeline-date { font-family: var(--font-mono); font-size: 15px; color: var(--muted); }
.timeline-title { font-size: 21px; font-weight: 600; line-height: 1.3; }
.timeline-text { font-size: 17px; line-height: 1.65; color: var(--fg); }

/* music */
.platforms { display: flex; justify-content: center; gap: 16px; margin-top: -24px; }
.platforms a { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; color: var(--fg); }
.platforms a:hover { opacity: 0.6; }
.albums {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.album iframe { display: block; width: 100%; height: 352px; border: 0; border-radius: 12px; background: var(--track); }

/* contact */
.contact {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 80px;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}
.contact-info { display: flex; flex-direction: column; gap: 18px; margin: 0; font-size: 17px; line-height: 1.7; }
.contact-info dt { font-weight: 600; }
.contact-info dd { margin: 0; color: var(--fg); }
.contact-form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.contact-form label { display: flex; flex-direction: column; gap: 6px; font-size: 15px; font-weight: 600; }
.contact-form input, .contact-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--control);
  border-radius: 0;
  background: var(--field);
  color: var(--fg);
  font: inherit;
  font-weight: 400;
  font-size: 17px;
}
.contact-form input { height: 46px; }
.contact-form input:focus-visible, .contact-form textarea:focus-visible { border-color: var(--fg); }
.form-note { font-size: 15px; color: var(--muted); }
.button {
  height: 48px;
  border: 0;
  background: var(--fg);
  color: var(--bg);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.button:hover { opacity: 0.85; }

/* footer */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0 32px;
  border-top: 1px solid var(--rule);
  font-size: 15px;
  color: var(--muted);
}
.site-footer .logo { font-size: 17px; color: var(--fg); }

/* ---- responsive ---- */
@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .timeline { gap: 0 40px; }
}
@media (max-width: 800px) {
  :root { --frame-inset: 8px; }
  .site-header { padding-top: 24px; }
  .logo { font-size: 20px; }
  .menu-button { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    flex-direction: column;
    gap: 0;
    margin: 12px 0 0;
    padding: 8px 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    background: var(--bg);
    z-index: 5;
  }
  .site-nav a { padding: 12px var(--gutter); font-size: 16px; }
  .site-header { position: relative; }
  .site-header.is-open .site-nav { display: flex; }
  .hero { min-height: 480px; gap: 24px; }
  .hero-intro { font-size: 17px; }
  .section { gap: 32px; padding: 56px 0; }
  .section-head h2 { font-size: 32px; }
  .lede { font-size: 17px; }
  .skills { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .cards { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .timeline { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .platforms { gap: 4px; flex-wrap: wrap; }
  .albums { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .contact { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .site-footer { flex-direction: column; gap: 8px; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
