/* ==========================================================================
   tourac.dev stylesheet
   Order: tokens, base, layout, components (in page order), animations.
   Mobile first: base styles target phones; tablets and up are added with
   @media (width > 40rem), laptops and up with @media (width > 64rem), and very
   wide screens (large monitors or a zoomed-out browser) with @media (width > 112rem).
   ========================================================================== */

/* Tokens
   ========================================================================== */

:root {
  /* Surfaces */
  --color-surface: #0a0a0b;
  --color-surface-overlay: rgb(10 10 11 / 0.92);
  --color-surface-container: #161618;
  --color-border: #2a2a2e;
  --color-border-strong: #3a3a40;

  /* Text, each paired with the surfaces above */
  --color-on-surface: #e6e6e8;
  --color-on-surface-strong: #ffffff;
  --color-on-surface-muted: #a1a1aa;

  /* Accent (Salesforce blues) */
  --color-accent: #1b96ff;
  --color-accent-container: #0176d3;
  --color-accent-container-hover: #0b5cab;
  --color-on-accent: #ffffff;
  --color-accent-subtle: #032d60;
  --color-on-accent-subtle: #cfe9fe;
  --color-focus: #1b96ff;

  /* Status */
  --color-success: #3ba755;
  --color-success-ring: rgb(59 167 85 / 0.18);

  /* Type and layout */
  --font-family:
    system-ui, -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", "Arial",
    sans-serif;
  --radius: 10px;
  --radius-card: 14px;

  /* Grows with the screen (about 84% of it) between 76rem and 140rem, so a
     zoomed-out browser or large monitor doesn't leave wide empty sides */
  --content-width: clamp(76rem, 84vw, 140rem);
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

/* Base
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-surface);
  color: var(--color-on-surface);
  font-family: var(--font-family);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--color-on-surface-strong);
  font-weight: 650;
  line-height: 1.25;
}

h2 {
  margin-bottom: 1.75rem;
  font-size: clamp(1.6rem, 3vw, 2rem);
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0;
}

a {
  color: var(--color-accent);
  text-underline-offset: 3px;
}

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

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

/* Layout
   ========================================================================== */

.wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

section {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--color-border);
  scroll-margin-top: 4.5rem;
}

/* Sections receive focus when reached from the menu; no outline box around a whole section */
main:focus,
section:focus {
  outline: none;
}

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

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

@media (width > 40rem) {
  section {
    padding: 4.5rem 0;
  }

  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
  }
}

@media (width > 64rem) {
  .skills-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .projects-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Skip link
   ========================================================================== */

.skip-link {
  position: absolute;
  top: 0;
  left: -999px;
}

.skip-link:focus {
  z-index: 10;
  top: 1rem;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--color-accent-container);
  color: var(--color-on-accent);
}

/* Site header and navigation
   ========================================================================== */

.site-header {
  position: sticky;
  z-index: 5;
  top: 0;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-overlay);
  backdrop-filter: saturate(150%) blur(8px);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.brand {
  color: var(--color-on-surface-strong);
  font-weight: 650;
  text-decoration: none;
}

.brand span {
  color: var(--color-accent);
}

/* Without JavaScript the links simply wrap; js/main.js adds .is-enhanced,
   which collapses them behind the Menu button on narrow or zoomed-in screens */
.nav-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-menu a {
  color: var(--color-on-surface-muted);
  font-size: 0.95rem;
  text-decoration: none;
}

.nav-menu a:hover,
.nav-menu a.is-active {
  color: var(--color-on-surface-strong);
}

@media (width > 40rem) {
  .nav-menu {
    gap: 0.25rem 1.25rem;
  }
}

.nav-toggle {
  display: none;
}

.is-enhanced .nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--color-on-surface-strong);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  cursor: pointer;
}

.is-enhanced .nav-toggle:hover {
  border-color: var(--color-on-surface-muted);
}

/* Three lines drawn with CSS; they turn into a cross while the menu is open */
.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  display: block;
  width: 1rem;
  height: 2px;
  border-radius: 2px;
  background: currentcolor;
  transition:
    transform 0.25s ease,
    background-color 0.25s ease;
}

.nav-toggle-icon {
  position: relative;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  position: absolute;
  left: 0;
  content: "";
}

.nav-toggle-icon::before {
  top: -5px;
}

.nav-toggle-icon::after {
  top: 5px;
}

.is-open .nav-toggle-icon {
  background: transparent;
}

.is-open .nav-toggle-icon::before {
  transform: translateY(5px) rotate(45deg);
}

.is-open .nav-toggle-icon::after {
  transform: translateY(-5px) rotate(-45deg);
}

/* Collapsed menu: a panel that drops down below the header */
.is-enhanced .nav-menu {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  display: none;
  flex-direction: column;
  gap: 0;
  padding: 0.5rem var(--gutter) 1rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.is-open .nav-menu {
  display: flex;
  animation: menu-drop 0.2s ease;
}

.is-enhanced .nav-menu a {
  display: block;
  padding: 0.7rem 0;
  font-size: 1.05rem;
}

@keyframes menu-drop {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Wide enough for every link: show the full row and hide the button */
@media (width > 48rem) {
  .is-enhanced .nav-toggle {
    display: none;
  }

  .is-enhanced .nav-menu {
    position: static;
    display: flex;
    flex-direction: row;
    gap: 0.25rem 1.25rem;
    padding: 0;
    border-bottom: 0;
    background: none;
    animation: none;
  }

  .is-enhanced .nav-menu a {
    display: inline;
    padding: 0;
    font-size: 0.95rem;
  }
}

/* Shared text styles
   ========================================================================== */

.eyebrow {
  margin-bottom: 0.75rem;
  color: var(--color-accent);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.muted {
  color: var(--color-on-surface-muted);
}

/* Hero
   ========================================================================== */

.hero {
  position: relative;
  padding: 3.5rem 0 4.5rem;
  isolation: isolate;
}

/* Background holder: js/main.js fills it only when the image file exists */
.hero-media {
  position: absolute;
  z-index: -1;
  overflow: hidden;
  inset: 0;
}

.hero-media-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.hero-media-image.is-loaded {
  opacity: 1;
}

/* Dark overlay keeps the text readable and fades into the page at the bottom */
.hero-media::after {
  position: absolute;
  background: linear-gradient(
    to bottom,
    rgb(10 10 11 / 0.6) 0%,
    rgb(10 10 11 / 0.78) 55%,
    var(--color-surface) 100%
  );
  content: "";
  inset: 0;
}

.hero-media-toggle {
  position: absolute;
  z-index: 1;

  /* Line up with the right edge of the content, however wide the screen */
  right: calc((100% - min(100%, var(--content-width))) / 2 + var(--gutter));
  bottom: 1rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface-overlay);
  color: var(--color-on-surface-muted);
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.4;
  cursor: pointer;
}

.hero-media-toggle:hover {
  border-color: var(--color-on-surface-muted);
  color: var(--color-on-surface-strong);
}

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

.hero-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}

.monogram {
  display: grid;
  width: 5.5rem;
  height: 5.5rem;
  border: 1px solid var(--color-accent-container);
  border-radius: 50%;
  background: var(--color-accent-subtle);
  color: var(--color-on-accent-subtle);
  font-size: 1.8rem;
  font-weight: 650;
  place-items: center;
}

.monogram-photo {
  object-fit: cover;
}

.hero h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.1rem, 5vw, 3.25rem);
}

.lead {
  max-width: 40rem;
  margin: 0 auto;
  color: var(--color-on-surface);
  font-size: 1.2rem;
}

.availability {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 1.1rem;
  color: var(--color-on-surface-muted);
  font-size: 0.95rem;
}

.availability-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 4px var(--color-success-ring);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
}

@media (width > 40rem) {
  .hero {
    padding-top: 5.5rem;
  }

  .hero-intro {
    gap: 1.75rem;
  }

  .monogram {
    width: 7.5rem;
    height: 7.5rem;
    font-size: 2.4rem;
  }
}

/* Buttons
   ========================================================================== */

.btn {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
}

.btn-primary {
  background: var(--color-accent-container);
  color: var(--color-on-accent);
}

.btn-primary:hover {
  background: var(--color-accent-container-hover);
}

.btn-secondary {
  border: 1px solid var(--color-border-strong);
  color: var(--color-on-surface-strong);
}

.btn-secondary:hover {
  border-color: var(--color-on-surface-muted);
}

/* Headline numbers
   ========================================================================== */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem;
  margin-top: 3.5rem;
}

.stat {
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-container);
}

.stat-value {
  display: block;
  color: var(--color-on-surface-strong);
  font-size: 1.9rem;
  line-height: 1.2;
}

.stat-label {
  color: var(--color-on-surface-muted);
  font-size: 0.92rem;
}

/* About
   ========================================================================== */

.about-layout {
  display: grid;
  gap: 3rem;
}

.about {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 46rem;
}

.about-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 2.5rem;
}

@media (width > 64rem) {
  .about-layout {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    align-items: start;
    gap: 4rem;
  }

  .about-facts {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (width > 112rem) {
  .about-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Cards and tags (skills, projects)
   ========================================================================== */

.card {
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface-container);
}

.card h3 {
  margin-bottom: 0.75rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag {
  padding: 0.2rem 0.65rem;
  border-radius: 6px;
  background: var(--color-accent-subtle);
  color: var(--color-on-accent-subtle);
  font-size: 0.85rem;
}

.project-summary {
  color: var(--color-on-surface);
}

.project .tags {
  margin-top: 1rem;
}

/* Experience timeline
   ========================================================================== */

.timeline {
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--color-border);
  list-style: none;
}

.job {
  position: relative;
  padding: 0 0 2.5rem 1.75rem;
}

.job:last-child {
  padding-bottom: 0;
}

.job::before {
  position: absolute;
  top: 0.5rem;
  left: -7px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--color-accent);
  border-radius: 50%;
  background: var(--color-surface);
  content: "";
}

.job-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
}

.job-org {
  color: var(--color-accent);
  font-weight: 600;
}

.job-date {
  color: var(--color-on-surface-muted);
  font-size: 0.92rem;
  white-space: nowrap;
}

.job-earlier {
  color: var(--color-on-surface-muted);
  font-size: 0.92rem;
}

.job-points {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
}

.job-points > li {
  display: list-item;
}

/* Laptops and up: dates and company in a left column, role and points on the right */
@media (width > 64rem) {
  .job {
    display: grid;
    grid-template-columns: 13rem minmax(0, 1fr);
    align-items: start;
    column-gap: 2.5rem;
  }

  .job-head {
    display: contents;
  }

  .job-date {
    grid-column: 1;
    grid-row: 1;
  }

  .job-org {
    grid-column: 1;
    grid-row: 2;
  }

  .job-head h3,
  .job-earlier,
  .job-points {
    grid-column: 2;
  }

  .job-head h3 {
    grid-row: 1;
  }

  .job-earlier {
    grid-row: 2;
  }

  .job-points {
    grid-row: 2 / span 2;
  }

  .job-earlier + .job-points {
    grid-row: 3;
  }
}

/* Very wide screens: keep the bullet lines a comfortable reading length */
@media (width > 112rem) {
  .job {
    grid-template-columns: 13rem minmax(0, 60rem);
  }
}

/* Certifications, languages and education
   ========================================================================== */

.certs {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.75rem 1.1rem 0.75rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-container);
}

/* Logo holder: shows a short abbreviation until a badge image replaces it */
.cert-logo {
  display: grid;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--color-accent-container);
  border-radius: var(--radius);
  background: var(--color-accent-subtle);
  color: var(--color-on-accent-subtle);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  place-items: center;
}

/* Badge image in place of the abbreviation */
.cert-logo-image {
  border: 0;
  background: none;
  object-fit: contain;
}

.cert-name {
  color: var(--color-on-surface-strong);
  font-weight: 550;
  line-height: 1.4;
}

.cert-date {
  color: var(--color-on-surface-muted);
  font-size: 0.92rem;
  white-space: nowrap;
}

@media (width > 64rem) {
  .certs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (width > 112rem) {
  .certs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.cert-note {
  margin-top: 0.75rem;
  color: var(--color-on-surface-muted);
  font-size: 0.9rem;
}

.badge-new {
  margin-left: 0.5rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--color-accent-container);
  color: var(--color-on-accent);
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: 2px;
}

.retired {
  color: var(--color-on-surface-muted);
  font-size: 0.85rem;
  font-weight: normal;
}

.plain-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

/* Contact and footer
   ========================================================================== */

.contact {
  border-bottom: 0;
}

.contact-list {
  display: grid;
  gap: 0.6rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.contact-label {
  display: inline-block;
  min-width: 6rem;
  color: var(--color-on-surface-muted);
}

.site-footer {
  padding: 2rem 0 3rem;
  color: var(--color-on-surface-muted);
  font-size: 0.9rem;
}

/* Animations (driven by js/main.js)
   Elements only start hidden once the script marks them, so the page still
   shows everything if JavaScript is off or fails to load.
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Small lift on cards and buttons */
.card,
.stat,
.btn {
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.card:hover,
.stat:hover {
  border-color: var(--color-border-strong);
  transform: translateY(-3px);
}

.btn:hover {
  transform: translateY(-1px);
}
