/* WebStar — portfolio of Vicenzo Parente */
:root {
  --sky: #dcebf7;
  --sky-deep: #b9d5ee;
  --ink: #00408c;      /* logo blue */
  --ink-soft: #3a5a8c;
  --star: #f9c34a;     /* logo gold */
  --paper: #ffffff;
  --line: #00408c;
  --radius-lg: 22px;
  --radius-sm: 10px;
  --max: 1180px;
  font-size: 17px;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  background: var(--sky);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { display: block; max-width: 100%; }
iframe { display: block; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.band--ink :focus-visible { outline-color: var(--star); }

.wrap { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--sky) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 2rem; height: 68px; }
.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo img { height: 50px; width: auto; }
.nav { display: flex; gap: 1.6rem; margin-left: auto; }
.nav a { text-decoration: none; font-weight: 500; }
.nav a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  padding: .75rem 1.25rem; border-radius: 999px;
  border: 2px solid var(--line); background: var(--star); color: var(--ink);
  box-shadow: 3px 3px 0 var(--line);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--line); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--line); }
.btn--ghost { background: var(--paper); }

/* ---------- Hero ---------- */
.hero { padding: 4.5rem 0 5rem; }
.hero .wrap { display: grid; grid-template-columns: 1fr 1.15fr; gap: 3.5rem; align-items: center; }
.hero h1 {
  font-size: clamp(2.6rem, 5.4vw, 4.6rem);
  line-height: 1.02; letter-spacing: -.035em; font-weight: 800;
  font-variation-settings: "wdth" 88;
}
.hero p.lede { margin-top: 1.4rem; font-size: 1.2rem; max-width: 34ch; color: var(--ink-soft); }
.hero .actions { margin-top: 2rem; display: flex; gap: .9rem; flex-wrap: wrap; }
.byline { margin-top: 2.2rem; display: flex; align-items: center; gap: .8rem; font-size: .95rem; }
.byline .avatar {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--line); background: var(--sky-deep);
}

/* Browser frame showing the concept sites live */
.browser {
  background: var(--paper); border: 2px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: 8px 8px 0 var(--line); overflow: hidden;
}
.browser__bar { display: flex; align-items: center; gap: .9rem; padding: .7rem .9rem; border-bottom: 2px solid var(--line); background: var(--sky-deep); }
.dots { display: flex; gap: 6px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--line); background: var(--paper); }
.dots i:first-child { background: var(--star); }
.tabs { display: flex; gap: .35rem; overflow-x: auto; }
.tabs button {
  font: inherit; font-size: .85rem; font-weight: 600; white-space: nowrap;
  border: 2px solid transparent; background: transparent; color: var(--ink);
  padding: .3rem .75rem; border-radius: 999px; cursor: pointer;
}
.tabs button[aria-pressed="true"] { background: var(--paper); border-color: var(--line); }
.browser__screen { position: relative; aspect-ratio: 16 / 11; overflow: hidden; background: #eee; }
.browser__screen iframe {
  position: absolute; top: 0; left: 0; border: 0;
  width: 250%; height: 250%; transform: scale(.4); transform-origin: 0 0;
  pointer-events: none; opacity: 0; transition: opacity .5s ease;
}
.browser__screen iframe.is-active { opacity: 1; }
.browser__foot { display: flex; justify-content: space-between; align-items: center; padding: .7rem 1rem; border-top: 2px solid var(--line); font-size: .9rem; }
.browser__foot a { font-weight: 700; }

/* ---------- Sections ---------- */
section { padding: 5.5rem 0; }
.section-head { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: end; margin-bottom: 3rem; }
.section-head h2 { font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.05; letter-spacing: -.03em; font-weight: 800; }
.section-head p { color: var(--ink-soft); max-width: 46ch; }

.band { background: var(--paper); border-block: 2px solid var(--line); }
.band--ink { background: var(--ink); color: var(--sky); }
.band--ink .section-head p { color: var(--sky-deep); }

/* Work list */
.work { display: grid; gap: 1.5rem; }
.project {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 0;
  border: 2px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
  background: var(--sky); text-decoration: none;
}
.project__shot { position: relative; min-height: 300px; overflow: hidden; border-right: 2px solid var(--line); background: #ddd; }
.project__shot iframe {
  position: absolute; inset: 0; border: 0; width: 300%; height: 300%;
  transform: scale(.3333); transform-origin: 0 0; pointer-events: none;
}
.project__body { padding: 2rem 2.2rem; display: flex; flex-direction: column; gap: 1rem; }
.tag { align-self: flex-start; font-size: .8rem; font-weight: 700; padding: .25rem .7rem; border-radius: 999px; border: 2px solid var(--line); background: var(--paper); }
.project h3 { font-size: 1.9rem; letter-spacing: -.025em; line-height: 1.1; }
.project dl { display: grid; gap: .7rem; }
.project dt { font-weight: 700; }
.project dd { color: var(--ink-soft); }
.project .open { margin-top: auto; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.project:hover .open { text-decoration-thickness: 3px; }

/* Promises */
.promises { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.promise { border: 2px solid var(--sky-deep); border-radius: var(--radius-sm); padding: 1.6rem; }
.promise svg { width: 30px; height: 30px; color: var(--star); margin-bottom: 1rem; }
.promise h3 { font-size: 1.2rem; margin-bottom: .4rem; }
.promise p { color: var(--sky-deep); font-size: .97rem; }

/* Process */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; counter-reset: step; }
.step { position: relative; padding-top: 4.2rem; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 0; left: 0; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 1.3rem;
  background: var(--star); border: 2px solid var(--line);
}
.step::after { content: ""; position: absolute; top: 25px; left: 64px; right: -1.5rem; border-top: 2px dashed var(--line); }
.step:last-child::after { display: none; }
.step h3 { font-size: 1.35rem; margin-bottom: .4rem; }
.step p { color: var(--ink-soft); }

/* About */
.about { display: grid; grid-template-columns: 1fr 1.1fr; gap: 3rem; align-items: center; }
.about h2 { font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.05; letter-spacing: -.03em; margin-bottom: 1.2rem; }
.about p + p { margin-top: 1rem; }
.about p { max-width: 52ch; font-size: 1.08rem; }

/* Paper streamers around the About section (drawn by script, unrolled by scroll) */
#about { position: relative; overflow: hidden; scroll-margin-top: 70px; }
#about .wrap { position: relative; z-index: 1; }
.streamers { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* Held on screen while the streamers unroll: About fills the screen below the header */
#about.is-held { --stage: calc(100svh - 70px); position: sticky; }
#about.is-held .streamers { top: auto; height: var(--stage); }
@media (min-width: 901px) {
  #about.is-held { min-height: var(--stage); padding-block: 4rem; display: flex; align-items: center; }
  #about.is-held .burst { max-width: min(560px, calc((var(--stage) - 8.5rem) * 560 / 540)); }
}
/* Phones and tablets: text first, then the photos get their own framed full screen */
@media (max-width: 900px) {
  #about.is-held { padding-bottom: 0; }
  #about.is-held .about { grid-template-rows: auto var(--stage); }
  #about.is-held .burst { align-self: center; max-width: min(560px, calc((var(--stage) - 8.5rem) * 560 / 540)); }
}

/* Photo burst: positions are % of a 560×540 box, matching the SVG trails' viewBox */
.burst { position: relative; width: 100%; max-width: 560px; aspect-ratio: 560 / 540; justify-self: center; }
.burst__trails { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--ink); overflow: visible; }
.burst__trails .sparks { fill: var(--star); stroke: var(--line); stroke-width: 1.5; }
.burst__star { fill: var(--star); stroke: var(--line); stroke-width: 2.5; stroke-linejoin: round; }

.shot {
  position: absolute; width: 34%; aspect-ratio: 4 / 5; padding: 0; overflow: hidden; cursor: zoom-in;
  border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--sky-deep);
  box-shadow: 6px 6px 0 var(--line);
  transform: rotate(var(--tilt));
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.25), box-shadow .35s ease;
  z-index: 1;
}
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot--left  { --tilt: -6deg; left: 1%;  top: 30%; }
.shot--mid   { --tilt: 0deg;  left: 33%; top: 2%;  z-index: 2; }
.shot--right { --tilt: 5deg;  left: 65%; top: 18%; }

/* Grow, straighten and come forward: hover (mouse), keyboard focus, or tap (aria-pressed) */
@media (hover: hover) {
  .shot:hover { transform: rotate(0) scale(1.15); box-shadow: 8px 8px 0 var(--line); z-index: 5; }
}
.shot:focus-visible,
.shot[aria-pressed="true"] { transform: rotate(0) scale(1.15); box-shadow: 8px 8px 0 var(--line); z-index: 5; }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.contact h2 { font-size: clamp(2.2rem, 4.4vw, 3.6rem); line-height: 1.02; letter-spacing: -.035em; }
.contact .lede { margin-top: 1rem; color: var(--ink-soft); max-width: 40ch; }
form { display: grid; gap: 1rem; background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-lg); padding: 1.8rem; box-shadow: 8px 8px 0 var(--line); }
label { display: grid; gap: .35rem; font-weight: 600; font-size: .95rem; }
input, textarea {
  font: inherit; font-weight: 400; color: var(--ink);
  border: 2px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .85rem; background: var(--paper);
}
textarea { min-height: 110px; resize: vertical; }
.form-note { font-size: .88rem; color: var(--ink-soft); }
.form-note:empty { position: absolute; } /* no gap until there's a message */
.form-note[data-state] { font-size: 1rem; font-weight: 600; color: var(--ink); }
.form-note[data-state="error"] { color: #a3210f; }
.form-note a { color: inherit; }

footer { padding: 2rem 0 3rem; font-size: .9rem; }
footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero .wrap, .section-head, .project, .about, .contact { grid-template-columns: 1fr; }
  .project__shot { border-right: 0; border-bottom: 2px solid var(--line); }
  .promises, .steps { grid-template-columns: 1fr; }
  .step::after { display: none; }
  .nav { display: none; }
  .site-header .btn { margin-left: auto; }
  section { padding: 4rem 0; }
}
@media (max-width: 520px) {
  .site-header .wrap { gap: 1rem; }
  .logo img { height: 40px; }
  .site-header .btn { white-space: nowrap; font-size: .88rem; padding: .5rem .9rem; box-shadow: 2px 2px 0 var(--line); }
}
