/* Pinky Salvanera — portfolio styles. No build step; plain CSS. */

/* ---------- Tokens ---------- */

/* Dark is the default for every visitor. The toggle (script.js) sets data-theme="light". */
:root {
  color-scheme: dark;
  --bg: #181515;
  --text: #EDE8E6;
  --muted: #A39C98;
  --accent: #DA8080;
  --chip-bg: #2E1F1F;
  --chip-text: #EFB8B8;
  --border: rgba(237, 232, 230, 0.12);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "New York", ui-serif, "Iowan Old Style", Georgia, serif;

  --gutter: 1.5rem;
  --phone-video-width: 150px;
  --radius: 12px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #FAF7F2;
  --text: #22201C;
  --muted: #5C564E;
  --accent: #9C3D3D;
  --chip-bg: #F3E0DE;
  --chip-text: #742D2D;
  --border: rgba(34, 32, 28, 0.12);
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, p, ul, ol {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--chip-bg);
  color: var(--chip-text);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 20;
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Layout ---------- */

.layout {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.sidebar {
  padding: 4.5rem 0 3rem;
}

.content {
  padding-bottom: 4rem;
}

/* ---------- Left column ---------- */

.name {
  color: var(--text);
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 7vw, 3.25rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.role {
  margin-top: 0.75rem;
  color: var(--accent);
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.4;
}

.tagline {
  max-width: 20rem;
  margin-top: 1rem;
}

.section-nav {
  display: none;
}

.section-nav ul {
  display: grid;
  gap: 0.25rem;
}

.section-nav a {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}

.section-nav a::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: currentColor;
  transition: width 150ms ease;
}

.section-nav a:hover,
.section-nav a[aria-current="true"] {
  color: var(--accent);
}

.section-nav a:hover::before,
.section-nav a[aria-current="true"]::before {
  width: 4rem;
  height: 2px;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 2rem;
}

.socials {
  display: flex;
  gap: 1.25rem;
}

.theme-toggle {
  display: block;
  margin: 0 0 0 0.5rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.theme-toggle[hidden] {
  display: none;
}

.theme-toggle:hover {
  color: var(--text);
}

.theme-toggle svg {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
}

/* Show the icon for the mode you'd switch to. */
.theme-toggle .icon-moon,
[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

.socials a {
  display: block;
  color: var(--muted);
}

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

.socials svg {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
}

/* ---------- Sections ---------- */

.section + .section {
  margin-top: 5rem;
}

/* Phone: each section heading sticks to the top while you scroll through it. */
.section-heading {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 calc(-1 * var(--gutter)) 1.5rem;
  padding: 1rem var(--gutter);
  background: var(--bg);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section p + p {
  margin-top: 1rem;
}

.subheading {
  margin: 3.5rem 0 1.25rem;
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------- Experience ---------- */

.entries {
  display: grid;
  gap: 3rem;
}

.entry,
.earlier li {
  display: grid;
  gap: 0.25rem 1.5rem;
}

.entry-dates {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.9;
  text-transform: uppercase;
  white-space: nowrap;
}

.entry-title {
  color: var(--text);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
}

.bullets {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.875rem;
}

.bullets li {
  position: relative;
  padding-left: 1.125rem;
}

.bullets li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 0.375rem;
  height: 1px;
  background: var(--accent);
}

.highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 0.625rem;
  margin-top: 1.5rem;
}

.highlights li {
  padding: 0.75rem 0.875rem;
  border-radius: 10px;
  background: var(--chip-bg);
}

.highlight-value {
  display: block;
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 1.2;
  white-space: nowrap;
}

.highlight-label {
  display: block;
  margin-top: 0.25rem;
  color: var(--chip-text);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.chips li {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
}

.earlier {
  display: grid;
  gap: 1.75rem;
}

.earlier-title {
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.earlier p:not(.entry-dates) {
  margin-top: 0.375rem;
  font-size: 0.9375rem;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badges li {
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 500;
}

.section .badges-issuer {
  margin-top: 0.625rem;
  font-size: 0.8125rem;
}

.section .degree {
  margin-top: 1.5rem;
  color: var(--text);
  font-weight: 500;
}

.degree-minor {
  display: block;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 400;
}

/* ---------- Projects ---------- */

.project + .project {
  margin-top: 4rem;
}

.project-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section .project-title {
  margin: 0.375rem 0 0.75rem;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.2;
}

.project-title a {
  color: inherit;
  text-decoration: none;
}

.project-title a:hover {
  color: var(--accent);
}

.project-title .arrow {
  display: inline-block;
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 0.7em;
  transition: transform 150ms ease;
}

.project-title a:hover .arrow {
  transform: translate(2px, -2px);
}

.project-title .icon-github {
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin-left: 0.1em;
  color: var(--accent);
  vertical-align: 0.05em;
}

.project-image {
  display: block;
  margin-top: 1.5rem;
}

.project-image img {
  width: 280px;
  border-radius: var(--radius);
}

.case-studies {
  display: grid;
  gap: 2.75rem;
  margin-top: 2.5rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--accent);
}

.case-study h4 {
  color: var(--text);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
}

.case-study p {
  margin-top: 0.375rem;
}

/* Phone-shaped video beside a landscape image; the image drops below on narrow screens. */
.media-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1rem;
}

.phone-video {
  flex: none;
  width: var(--phone-video-width);
  border-radius: var(--radius);
  background: #1f2330;
}

/* Added by script.js: wraps each video so the pause/play button can sit in its corner. */
.video-wrap {
  position: relative;
  flex: none;
  width: var(--phone-video-width);
}

.video-wrap .phone-video {
  width: 100%;
}

.video-toggle {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(24, 21, 21, 0.72);
  color: #fff;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.video-toggle:hover {
  background: rgba(24, 21, 21, 0.9);
}

.video-toggle svg {
  display: block;
}

.media-wide {
  flex: 1 1 15rem;
  max-width: 24rem;
}

.media-full {
  display: block;
  max-width: 28rem;
  margin-top: 1rem;
}

.media-wide img,
.media-full img {
  width: 100%;
  border-radius: var(--radius);
  outline: 1px solid var(--border);
  outline-offset: -1px;
}

/* ---------- Footer ---------- */

.footer {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
}

.footer p + p {
  margin-top: 0.25rem;
}

/* ---------- 404 page ---------- */

.not-found {
  display: grid;
  place-content: center;
  min-height: 100vh;
  padding: var(--gutter);
  text-align: center;
}

.not-found-code {
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 4rem;
  line-height: 1;
}

.not-found-title {
  margin: 0.75rem 0 1.5rem;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 600;
}

/* ---------- Wider screens ---------- */

@media (min-width: 40rem) {
  :root {
    --gutter: 3rem;
  }

  .entry,
  .earlier li {
    grid-template-columns: 8.5rem minmax(0, 1fr);
  }
}

/* Desktop: sticky left column with section nav, content scrolls on the right. */
@media (min-width: 64rem) {
  .layout {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 4rem;
    transition: grid-template-columns 300ms ease;
  }

  .layout.is-compact {
    grid-template-columns: minmax(0, 3fr) minmax(0, 7fr);
  }

  .sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    max-height: 100vh;
    padding: 6rem 0;
  }

  .section-nav {
    display: block;
    margin-top: 4rem;
    transition: margin-top 250ms ease;
  }

  /* Compact state (script.js adds .is-compact to .layout once the page leaves the very top). */
  .name {
    transition: font-size 250ms ease;
  }

  .tagline {
    max-height: 8rem;
    overflow: hidden;
    transition: max-height 250ms ease, margin-top 250ms ease, opacity 200ms ease;
  }

  .is-compact .name {
    font-size: 1.75rem;
  }

  .is-compact .tagline {
    max-height: 0;
    margin-top: 0;
    opacity: 0;
  }

  .is-compact .section-nav {
    margin-top: 2.5rem;
  }

  .sidebar-footer {
    margin-top: auto;
    padding-top: 2rem;
  }

  .content {
    padding: 6rem 0;
  }

  .section {
    scroll-margin-top: 6rem;
  }

  .section + .section {
    margin-top: 7rem;
  }

  /* The nav names each section, so headings are for screen readers only. */
  .section-heading {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
