/* Emanuela Damiani — portfolio site */

:root {
  --bg: #ffffff;
  --bg-subtle: #ffffff;
  --paper: #ffffff;
  --text: #111111;
  --text-muted: #555555;
  --border: #111111;
  --accent: #12466f;
  --accent-2: #e94b1b;
  --accent-3: #f5d22b;
  --accent-4: #15985c;
  --accent-contrast: #ffffff;
  --max-width: 1040px;
  --radius: 0;
  font-size: 17px;
}

[data-theme="dark"] {
  --bg: #111111;
  --bg-subtle: #181818;
  --paper: #181818;
  --text: #f7f3ea;
  --text-muted: #bdb7ad;
  --border: #f7f3ea;
  --accent: #63a9e8;
  --accent-2: #ff6a2a;
  --accent-3: #f7d84b;
  --accent-4: #57c989;
  --accent-contrast: #111111;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 0.75rem 1.25rem;
  z-index: 100;
  border-radius: 0;
}
.skip-link:focus {
  left: 0;
}

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

a {
  color: inherit;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 1rem;
  border-bottom: 2px solid var(--border);
}

.brand {
  text-decoration: none;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: lowercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
}

.theme-toggle {
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 0;
  padding: 0.4rem 0.7rem;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.theme-toggle:hover {
  border-color: var(--accent);
}

/* Layout helpers */
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 1.5rem;
}

#work {
  padding-bottom: 2.5rem;
}

.lead-copy {
  padding-top: 2.5rem;
}

.section-heading {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
  border-top: 2px solid var(--border);
  padding-top: 1rem;
}

.section-heading > h2:only-child {
  grid-column: 1 / -1;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 900;
  margin: 0;
}

h1, h2, h3 {
  line-height: 1;
  letter-spacing: 0;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
}

h3 {
  font-size: clamp(1.45rem, 3vw, 2.35rem);
  font-weight: 900;
}

p {
  margin: 0 0 1rem;
  color: var(--text);
}

.text-muted {
  color: var(--text-muted);
}

/* Hero */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4.5rem 1.5rem 5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 39rem);
  gap: 0;
  align-items: center;
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 6.6rem);
  max-width: 10ch;
  margin: 0.45rem 0 1.2rem;
  text-transform: lowercase;
}

.hero-intro {
  color: var(--text-muted);
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  max-width: 36ch;
}

.hero-actions {
  display: flex;
  gap: 0.9rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.button {
  display: inline-block;
  padding: 0.72rem 1rem;
  border-radius: 0;
  text-decoration: none;
  font-weight: 900;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 2px solid var(--border);
}

.button.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.button.primary:hover {
  opacity: 0.9;
}

.button.secondary {
  background: transparent;
  color: var(--text);
}
.button.secondary:hover {
  background: var(--accent-3);
  color: #111111;
}

/* Intro band */
.intro-band {
  padding-top: 0;
  padding-bottom: 0;
}
.intro-band p {
  font-size: 1.2rem;
  max-width: 62ch;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 2rem 0;
}

/* Work / case study teasers */
.project-list {
  display: grid;
  gap: 0;
}

.project-card {
  position: relative;
  display: grid;
  grid-template-columns: 7rem 1fr 1.15fr;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.6rem 0 1.8rem 3rem;
  border: 0;
  border-bottom: 2px solid var(--border);
  border-radius: 0;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  transition: color 0.15s ease, transform 0.15s ease;
}

.project-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.6rem;
  width: 1.35rem;
  height: 4.2rem;
  background: var(--accent);
}

.project-card:nth-child(2)::before {
  background: var(--accent-2);
}

.project-card:nth-child(3)::before {
  background: var(--accent-4);
}

a.project-card:hover {
  color: var(--accent);
  transform: translateX(0.25rem);
}

.project-kicker {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--text-muted);
  font-weight: 900;
  margin: 0;
}

.project-card h3 {
  margin: 0;
}

.project-card p {
  color: var(--text-muted);
  margin: 0;
  max-width: 34ch;
}

.read-more {
  grid-column: 3;
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--accent);
  margin-top: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* How I lead */
.lead-heading {
  align-items: baseline;
}

.lead-position {
  display: none;
  justify-self: end;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.lead-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.2vw, 1.25rem);
  width: min(calc(100vw - 4rem), 1520px);
  margin-left: 50%;
  transform: translateX(-50%);
}

.principle-poster {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 1rem;
  contain: layout paint;
}

.poster-eyebrow {
  position: relative;
  z-index: 3;
  margin: 0;
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.principle-poster h3 {
  position: relative;
  z-index: 3;
  margin: 0;
  padding-top: 1.35rem;
  width: 50%;
  max-width: none;
  font-size: clamp(1.65rem, 2.15vw, 3rem);
  line-height: 0.98;
}

.poster-art {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.shape-yellow {
  fill: var(--accent-3);
}

.shape-orange {
  fill: var(--accent-2);
}

.shape-blue {
  fill: var(--accent);
}

.shape-green {
  fill: var(--accent-4);
}

.shape-black,
.shape-black-fill {
  fill: var(--border);
}

.shape-white {
  fill: var(--bg);
}

.shape-line,
.shape-arc {
  fill: none;
  stroke: var(--border);
  stroke-width: 2;
  stroke-linecap: round;
}

.shape-line.dashed,
.dashed {
  stroke-dasharray: 7 7;
}

.noise {
  fill: var(--border);
}

.precision {
  fill: var(--accent-3);
}

.precision rect:nth-child(n + 3) {
  fill: var(--border);
}

.craft-art {
  top: 3.3rem;
  transform: scale(0.94);
  transform-origin: center;
}

.conflict-art {
  top: 0;
  transform: none;
}

.people-art {
  top: 1.7rem;
  transform: scale(0.96);
  transform-origin: center;
}

.context-art {
  top: 1.2rem;
  transform: scale(0.9);
  transform-origin: center;
}

.pivot {
  fill: var(--border);
}

.context-row {
  transform-box: fill-box;
}

.poster-description {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 48%;
  margin: 0;
  padding: 1.15rem 1rem 4.5rem;
  background: var(--bg);
  border-top: 2px solid var(--border);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.45;
  font-weight: 700;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.principle-poster[data-open="true"] .poster-description {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.principle-poster[data-open="true"] .poster-art {
  opacity: 0.35;
}

.principle-toggle {
  position: absolute;
  z-index: 5;
  left: 1rem;
  bottom: 1rem;
  min-height: 2.75rem;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.principle-toggle::after {
  content: none;
}

.principle-toggle:hover,
.principle-toggle:focus-visible {
  color: var(--accent);
  outline: 0;
}

.principle-toggle:focus-visible {
  background: var(--accent-3);
  color: #111111;
}

.lead-gallery-controls {
  display: none;
}

.gallery-button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 900;
}

.gallery-button:hover,
.gallery-button:focus-visible {
  background: var(--accent-3);
  color: #111111;
  outline: 0;
}

/* Ideas */
.ideas-heading {
  margin-bottom: 2.4rem;
}

.ideas-intro {
  max-width: 56ch;
  margin: 0;
  color: var(--text);
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  line-height: 1.3;
  font-weight: 800;
}

.ideas-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.ideas-card {
  display: flex;
  flex-direction: column;
  min-height: 19rem;
  padding: 1.1rem 1rem;
  border: 2px solid var(--border);
  border-left-width: 1.3rem;
  color: var(--text);
  text-decoration: none;
}

.ideas-card:nth-child(1) {
  border-left-color: var(--accent);
}

.ideas-card:nth-child(2) {
  border-left-color: var(--accent-4);
}

.ideas-card:hover,
.ideas-card:focus-visible {
  background: var(--accent-3);
  color: #111111;
  outline: 0;
}

.ideas-card-eyebrow {
  margin: 0 0 1.2rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ideas-card:hover .ideas-card-eyebrow,
.ideas-card:focus-visible .ideas-card-eyebrow,
.ideas-card:hover p,
.ideas-card:focus-visible p {
  color: #111111;
}

.ideas-card h3 {
  max-width: 13ch;
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 3.4vw, 3rem);
}

.ideas-card p:not(.ideas-card-eyebrow) {
  max-width: 36ch;
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.45;
}

.ideas-card span {
  margin-top: auto;
  padding-top: 2rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ideas-card:hover span,
.ideas-card:focus-visible span {
  color: #111111;
}

/* Contact */
.contact-links {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.contact-links a {
  text-decoration: none;
  font-weight: 900;
  border: 2px solid var(--border);
  padding: 0.7rem 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.contact-links a:hover {
  background: var(--accent-3);
  color: #111111;
}

/* Footer */
.footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 2px solid var(--border);
}

/* Case study pages */
.case-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 2.5rem;
}

.back-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}
.back-link:hover {
  color: var(--accent);
}

.case-kicker {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0 0 0.6rem;
}

.case-header h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
}

.case-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 1rem;
}

.case-body {
  max-width: 70ch;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.case-body h2:not(.eyebrow) {
  font-size: 1.3rem;
  margin-top: 2.5rem;
}

.case-body p,
.case-body li {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.45;
}

.case-body ul {
  padding-left: 1.2rem;
}

.case-body li::marker {
  color: var(--text-muted);
}

.callout {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.callout p {
  margin: 0;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem;
  background: var(--bg-subtle);
}

.stat-box strong {
  display: block;
  font-size: 1.4rem;
  color: var(--accent);
}

.stat-box span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.quote {
  font-size: 1.05rem;
  font-style: italic;
  border-left: 3px solid var(--accent-2);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--text);
}
.quote cite {
  display: block;
  font-style: normal;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.case-nav {
  display: flex;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 2rem auto 4rem;
  padding: 1.5rem 1.5rem 0;
  border-top: 1px solid var(--border);
}
.case-nav a {
  text-decoration: none;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.case-nav a:hover {
  color: var(--accent);
}

.case-figure {
  margin: 1.5rem 0 0;
}

.case-figure figcaption {
  margin-top: 0.65rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.case-body a {
  color: var(--accent);
  font-weight: 600;
}

.case-body a:hover,
.case-body a:focus-visible {
  color: var(--text);
}

.smart-window-overview .case-header,
.smart-window-overview .case-body,
.smart-window-overview .case-nav {
  max-width: 760px;
}

.smart-window-overview .case-header {
  padding-bottom: 1.4rem;
}

.smart-window-overview .case-header h1 {
  font-size: clamp(2.35rem, 4vw, 2.6rem);
}

.case-intro {
  max-width: 620px;
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  font-size: clamp(1.08rem, 1.7vw, 1.18rem);
  line-height: 1.42;
  font-weight: 400;
}

.smart-window-overview .case-meta {
  gap: 1.1rem;
  font-size: 0.82rem;
}

.smart-window-overview .case-figure {
  margin-top: 0;
}

.smart-window-overview .case-figure img {
  border: 0;
}

.smart-window-overview .case-figure figcaption {
  font-size: 0.74rem;
}

.case-overview {
  margin-top: 2rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border);
}

.smart-window-overview .case-overview {
  padding-top: 0;
  border-top: 0;
}

.case-overview h2 {
  margin: 0;
}

.case-overview p {
  margin-top: 1rem;
}

.smart-window-overview .case-overview p {
  margin-top: 0;
}

.case-overview ul {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
}

.case-overview li + li {
  margin-top: 0.65rem;
}

.case-section {
  margin-top: 1.8rem;
}

.case-section-heading {
  margin-bottom: 1rem;
}

.case-section p {
  margin-top: 0;
}

.case-impact-list {
  margin: 0;
  padding-left: 1.1rem;
}

.case-impact-list li + li {
  margin-top: 0.65rem;
}

.case-press {
  margin-top: 1.7rem;
}

.case-press-list {
  display: grid;
  gap: 0.85rem;
}

.case-press-row {
  display: grid;
  grid-template-columns: minmax(6.5rem, 0.65fr) minmax(0, 1.7fr);
  gap: 1rem;
  align-items: baseline;
  color: var(--text);
  text-decoration: none;
}

.case-press-row span {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.case-press-row strong {
  color: var(--accent);
  font-size: 0.95rem;
  line-height: 1.35;
}

.case-press-row:hover,
.case-press-row:focus-visible {
  color: var(--accent);
  outline: 0;
}

.case-press-row:focus-visible {
  background: var(--accent-3);
  box-shadow: 0 0 0 0.25rem var(--accent-3);
  color: #111111;
}

.case-press-row:focus-visible span,
.case-press-row:focus-visible strong {
  color: #111111;
}

.case-request {
  margin-top: 2.4rem;
  margin-bottom: 0;
}

.case-request a {
  color: var(--text-muted);
  font-weight: 400;
}

.case-request a:hover,
.case-request a:focus-visible {
  color: var(--accent);
}

.smart-window-overview .case-request {
  text-align: center;
}

.smart-window-overview .case-nav {
  margin-top: 1.5rem;
}

/* Draft flags — remove once resolved, not meant to ship */
.flag {
  display: block;
  background: #fff4d6;
  border: 1px dashed #c99a2e;
  color: #7a5a10;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.82rem;
  margin: 0.75rem 0 1.25rem;
}
[data-theme="dark"] .flag {
  background: #3a3120;
  border-color: #8a6a2e;
  color: #f0cf8a;
}

@media (max-width: 1199px) {
  .lead-grid {
    width: 100%;
    margin-left: 0;
    transform: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .site-header {
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
  }

  .nav {
    order: 3;
    width: 100%;
    gap: 0.9rem;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  .section {
    padding: 3.7rem 1.25rem;
  }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .hero {
    padding: 3.4rem 1.25rem 4rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero h1 {
    max-width: 10ch;
  }

  .project-card {
    grid-template-columns: 1fr;
    gap: 0.7rem;
    padding: 1.35rem 0 1.5rem 2.2rem;
  }

  .project-card::before {
    width: 1rem;
    height: 3.5rem;
  }

  .read-more {
    grid-column: auto;
  }

  .ideas-grid {
    grid-template-columns: 1fr;
  }

  .case-press-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

}

@media (max-width: 699px) {
  .lead-heading {
    grid-template-columns: 1fr auto;
  }

  .lead-position {
    display: block;
  }

  .lead-grid {
    display: flex;
    width: calc(100vw - 1rem);
    margin-left: 0;
    transform: none;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 12vw 0 0;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .lead-grid::-webkit-scrollbar {
    display: none;
  }

  .principle-poster {
    flex: 0 0 86vw;
    scroll-snap-align: start;
  }

  .lead-gallery-controls {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
  }
}

@media (max-width: 520px) {
  :root {
    font-size: 16px;
  }

  .site-header {
    padding-inline: 1rem;
  }

  .theme-toggle {
    padding-inline: 0.55rem;
  }

  .hero,
  .section,
  .footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hero h1 {
    font-size: clamp(2.75rem, 16vw, 4.8rem);
  }

  .principle-poster h3 {
    font-size: clamp(2rem, 10vw, 3.2rem);
  }

  .poster-description {
    font-size: 1rem;
  }

  .ideas-card {
    min-height: 17rem;
  }

  .ideas-card h3 {
    max-width: 14ch;
  }

}

@media (prefers-reduced-motion: reduce) {
  .poster-description {
    transition: none;
  }
}
