/* =====================================================
   STYLE.CSS: shared by every page of the MarhayWorks site
   Read the comments (notes like this one) to see what
   each part does. The browser ignores comments.
   ===================================================== */


/* ===== 1. COLORS AND SIZES =====
   These are "variables": named values you set once and reuse.
   Change a color here and it updates everywhere on the site. */

:root {
  --paper: #f7f3ee;      /* page background: your warm off-white */
  --lilac-wash: #efe6f4; /* tinted section background (a lighter lilac) */
  --plum: #5a1b66;       /* main brand color: headings, buttons */
  --plum-deep: #45124f;  /* darker plum for the contact band and hovers */
  --lavender: #9463bb;   /* accent: underlines and focus rings */
  --lilac: #d9c2e9;      /* soft highlight: dividers, light buttons */
  --ink: #2b1f2e;        /* body text: a very dark plum-grey */
  --muted: #6b5a70;      /* softer text, like dates */
  --line: #d9c2e9;       /* thin divider lines */

  --max-width: 68rem;    /* widest the content can get */
  --gutter: 1.25rem;     /* space at the left and right edges on phones */
}


/* ===== 2. RESET AND BASICS ===== */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Schibsted Grotesk", "Segoe UI", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

img {
  max-width: 100%;
}

a {
  color: var(--plum);
}

/* A visible outline when someone moves around with the Tab key */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--lavender);
  outline-offset: 3px;
  border-radius: 4px;
}

/* "hidden" items stay hidden even if another rule says display: grid */
[hidden] {
  display: none !important;
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--plum);
  color: var(--paper);
  padding: 0.5rem 1rem;
  z-index: 20;
}
.skip-link:focus {
  left: 0.5rem;
}


/* ===== 3. HEADER, MENU AND PHONE MENU BUTTON ===== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: var(--paper);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-top: 0.625rem;
  padding-bottom: 0.625rem;
}

.brand {
  display: block;
  line-height: 0;
}

/* The logo is saved at double size so it's sharp on high-resolution
   screens; here we show it smaller. "width: auto" keeps its shape. */
.brand img {
  height: 44px;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}

.site-nav a:not(.button) {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.25rem 0;
  text-decoration-color: var(--lavender);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.site-nav a:not(.button):hover {
  color: var(--plum);
  text-decoration-line: underline;
}

/* The page you're on: plum and underlined */
.site-nav a[aria-current="page"] {
  color: var(--plum);
  font-weight: 700;
  text-decoration-line: underline;
}

/* The Menu button is hidden on laptops */
.menu-toggle {
  display: none;
}

/* ---- Phones and small tablets ----
   Everything inside this @media block only applies
   when the screen is narrower than 52rem (about 830px). */
@media (max-width: 52rem) {
  .brand img { height: 38px; }

  .js .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font: inherit;
    font-weight: 700;
    color: var(--plum);
    background: transparent;
    border: 2px solid var(--plum);
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
  }

  /* The three-line "hamburger" icon, drawn with CSS borders */
  .menu-icon,
  .menu-icon::before,
  .menu-icon::after {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--plum);
    border-radius: 2px;
    transition: transform 0.2s ease, background-color 0.2s ease;
  }
  .menu-icon { position: relative; }
  .menu-icon::before,
  .menu-icon::after {
    content: "";
    position: absolute;
    left: 0;
  }
  .menu-icon::before { top: -6px; }
  .menu-icon::after { top: 6px; }

  /* When the menu is open, the three lines turn into an X */
  .menu-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
  .menu-toggle[aria-expanded="true"] .menu-icon::before { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-icon::after { transform: translateY(-6px) rotate(-45deg); }

  /* With JavaScript on, the links hide until Menu is tapped */
  .js .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 0 0.75rem;
  }

  .js .site-nav.is-open {
    display: flex;
  }

  .js .site-nav a:not(.button) {
    font-size: 1.0625rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
  }

  .js .site-nav .button {
    margin-top: 1rem;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .menu-icon, .menu-icon::before, .menu-icon::after { transition: none; }
}


/* ===== 4. BUTTONS =====
   Every button and button-style link shares these rules. */

.button {
  display: inline-block;
  padding: 0.75rem 1.375rem;
  border: 2px solid var(--plum);
  border-radius: 6px;
  background-color: var(--plum);
  color: var(--paper);
  font: inherit;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.button:hover {
  background-color: var(--plum-deep);
  border-color: var(--plum-deep);
}

/* Pressing a button nudges it down 1px, so it feels clicked */
.button:active {
  transform: translateY(1px);
}

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
  .button:active { transform: none; }
}

.button-small {
  padding: 0.45rem 0.95rem;
  font-size: 0.9375rem;
}

.button-quiet {
  background-color: transparent;
  color: var(--plum);
}

.button-quiet:hover {
  background-color: var(--lilac-wash);
  border-color: var(--plum);
}

.button-on-dark {
  background-color: var(--lilac);
  border-color: var(--lilac);
  color: var(--plum-deep);
}

.button-on-dark:hover {
  background-color: var(--paper);
  border-color: var(--paper);
}

.button-outline-light {
  background-color: transparent;
  border-color: var(--lilac);
  color: var(--paper);
}

.button-outline-light:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--paper);
}

/* A row of buttons that wraps onto a new line on small screens */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}


/* ===== 5. HEADINGS AND SECTIONS ===== */

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--plum);
  margin-bottom: 2rem;
}

h3 {
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.section {
  padding: 4.5rem 0;
}

.section-tinted {
  background-color: var(--lilac-wash);
}

/* Less space at the top when a section follows a page title */
.section-top-tight {
  padding-top: 1rem;
}

.h2-spaced {
  margin-top: 3rem;
}


/* ===== 6. HOME PAGE HERO ===== */

.hero {
  padding: 4.5rem 0 4rem;
}

.hero h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--plum);
}

.hero-lede {
  margin-top: 1.75rem;
  font-size: 1.25rem;
  color: var(--muted);
}

/* The four big roles: the one bold design moment on the site */
.roles {
  list-style: none;
  margin-top: 0.5rem;
}

.roles a {
  display: inline-block;
  font-size: clamp(2.5rem, 7.5vw, 5.25rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--plum);
  text-decoration: none;
  padding: 0.08em 0;
  background-image: linear-gradient(var(--lavender), var(--lavender));
  background-size: 0% 0.12em;
  background-position: 0 92%;
  background-repeat: no-repeat;
  transition: background-size 0.25s ease;
}

.roles a:hover,
.roles a:focus-visible {
  background-size: 100% 0.12em;
}

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

.hero-summary {
  margin-top: 2.25rem;
  max-width: 38rem;
  font-size: 1.125rem;
}

.hero-meta {
  margin-top: 1.25rem;
  font-size: 0.9375rem;
  color: var(--muted);
}


/* ===== 7. TITLES AT THE TOP OF INNER PAGES ===== */

.page-hero {
  padding: 4rem 0 2.5rem;
}

.page-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--plum);
}

.page-lede {
  margin-top: 1rem;
  max-width: 40rem;
  font-size: 1.25rem;
  color: var(--muted);
}


/* ===== 8. HOME: "HOW I CAN HELP" =====
   Each block is one big link, so the whole area is clickable. */

.services-overview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 40rem) {
  .services-overview { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 64rem) {
  .services-overview { grid-template-columns: repeat(4, 1fr); }
}

.service-link {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem 0 1rem;
  border-top: 3px solid var(--plum);
  color: var(--ink);
  text-decoration: none;
}

.service-link h3 {
  color: var(--plum);
}

.service-link p {
  font-size: 0.9875rem;
  flex-grow: 1;
}

.link-label {
  font-weight: 700;
  color: var(--plum);
  text-decoration: underline;
  text-decoration-color: var(--lavender);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.service-link:hover .link-label {
  text-decoration-color: var(--plum);
}


/* ===== 9. PROJECT ROWS (Home) ===== */

.project-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  padding: 2rem 0;
  border-top: 1px solid var(--line);
}

.project-row:last-of-type {
  border-bottom: 1px solid var(--line);
}

@media (min-width: 48rem) {
  .project-row {
    grid-template-columns: 14rem 1fr;
    gap: 2rem;
  }
}

.project-role {
  font-weight: 700;
  color: var(--plum);
  font-size: 0.9375rem;
}

.project-row h3 {
  margin-bottom: 0.5rem;
}

.project-row p {
  max-width: 42rem;
}

.about-teaser {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

@media (min-width: 48rem) {
  .about-teaser {
    grid-template-columns: 14rem 1fr;
    gap: 2rem;
  }
  .about-teaser h2 { font-size: 1.5rem; }
}

.about-teaser p {
  max-width: 42rem;
}


/* ===== 10. ABOUT PAGE ===== */

.about-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 56rem) {
  .about-layout {
    grid-template-columns: 1fr 20rem;
    gap: 4rem;
    align-items: start;
  }
}

.story p {
  max-width: 40rem;
  font-size: 1.125rem;
}

.story p + p {
  margin-top: 1.25rem;
}

/* The quick-facts box beside your story */
.facts {
  background-color: var(--lilac-wash);
  border-left: 4px solid var(--plum);
  padding: 1.5rem;
  border-radius: 0 8px 8px 0;
}

.facts h2 {
  font-size: 1.375rem;
  margin-bottom: 1rem;
}

.facts dt {
  font-weight: 700;
  color: var(--plum);
  font-size: 0.9375rem;
}

.facts dd + dt {
  margin-top: 1rem;
}

.facts-note {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Experience timeline */
.timeline {
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}

@media (min-width: 48rem) {
  .timeline li {
    grid-template-columns: 14rem 1fr;
    gap: 2rem;
  }
}

.timeline-date {
  color: var(--muted);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.timeline h3 {
  margin-bottom: 0.25rem;
}

.timeline p:not(.timeline-date) {
  max-width: 42rem;
}

/* Tools, certifications and education */
.credentials {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 56rem) {
  .credentials { grid-template-columns: 1fr 1fr; }
}

.tools dt {
  font-weight: 700;
  color: var(--plum);
  margin-top: 1rem;
}

.tools dt:first-child {
  margin-top: 0;
}

.plain-list {
  list-style: none;
}

.plain-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}


/* ===== 11. SERVICES PAGE TABS ===== */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

/* Without JavaScript the tab buttons can't work, so hide them
   and let all four services show as a list instead. */
html:not(.js) .tabs {
  display: none;
}

.tab {
  font: inherit;
  font-weight: 700;
  font-size: 0.9875rem;
  color: var(--plum);
  background: transparent;
  border: 2px solid var(--lilac);
  border-radius: 999px;   /* very round ends: a "pill" shape */
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.tab:hover {
  border-color: var(--plum);
}

/* The selected tab is filled in */
.tab[aria-selected="true"] {
  background-color: var(--plum);
  border-color: var(--plum);
  color: var(--paper);
}

.tab-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  scroll-margin-top: 7rem;
}

html:not(.js) .tab-panel + .tab-panel {
  margin-top: 4rem;
  padding-top: 4rem;
  border-top: 1px solid var(--line);
}

@media (min-width: 56rem) {
  .tab-panel {
    grid-template-columns: 1fr 20rem;
    gap: 4rem;
    align-items: start;
  }
}

.panel-intro {
  font-size: 1.25rem;
  max-width: 36rem;
  margin-top: -1rem;
  margin-bottom: 2rem;
}

.panel-main h3,
.panel-side h3 {
  font-size: 1rem;
  color: var(--plum);
  margin-bottom: 0.5rem;
}

.panel-side {
  background-color: var(--lilac-wash);
  border-left: 4px solid var(--plum);
  padding: 1.5rem;
  border-radius: 0 8px 8px 0;
}

.panel-side p + h3 {
  margin-top: 1.25rem;
}

.panel-side .button {
  margin-top: 1.5rem;
}

/* A list with small plum check marks instead of bullets */
.check-list {
  list-style: none;
}

.check-list li {
  position: relative;
  padding: 0.6rem 0 0.6rem 1.75rem;
  border-bottom: 1px solid var(--line);
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 1.05rem;
  width: 0.7rem;
  height: 0.38rem;
  border-left: 2px solid var(--plum);
  border-bottom: 2px solid var(--plum);
  transform: rotate(-45deg);
}


/* ===== 12. WORK PAGE: FILTERS AND PROJECT CARDS ===== */

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

html:not(.js) .filters {
  display: none;
}

.filter {
  font: inherit;
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--plum);
  background: transparent;
  border: 2px solid var(--lilac);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  cursor: pointer;
}

.filter:hover {
  border-color: var(--plum);
}

.filter[aria-pressed="true"] {
  background-color: var(--plum);
  border-color: var(--plum);
  color: var(--paper);
}

.filter-status {
  min-height: 1.5rem;
  margin: 0.75rem 0 1rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 52rem) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}

.project-card {
  display: flex;
  flex-direction: column;
  background-color: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--plum);
  border-radius: 4px 4px 8px 8px;
  padding: 1.75rem;
}

.project-card h2 {
  font-size: 1.375rem;
  letter-spacing: -0.01em;
  margin: 0.5rem 0 0.75rem;
}

.project-card > p:not(.project-role) {
  flex-grow: 1;
}

.project-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
}

.project-meta dt {
  font-weight: 700;
  color: var(--plum);
}

.project-meta dd {
  color: var(--muted);
}


/* ===== 13. CONTACT PAGE ===== */

.contact-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 56rem) {
  .contact-layout {
    grid-template-columns: 1fr 20rem;
    gap: 4rem;
    align-items: start;
  }
}

.contact-card h2 {
  font-size: 1.375rem;
  margin-bottom: 0.5rem;
}

.contact-email {
  font-size: clamp(1.5rem, 4.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--plum);
  overflow-wrap: anywhere;  /* lets the long address wrap on small phones */
}

.copy-status {
  min-height: 1.5rem;
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  color: var(--muted);
}


/* ===== 14. CONTACT BAND (bottom of most pages) ===== */

.cta-band {
  background-color: var(--plum-deep);
  color: var(--paper);
  padding: 5rem 0;
}

.cta-band h2 {
  color: var(--paper);
  max-width: 34rem;
  margin-bottom: 1rem;
}

.cta-band p {
  max-width: 34rem;
  color: #eadcf2;
}


/* ===== 15. FOOTER ===== */

.site-footer {
  padding: 3rem 0 1.5rem;
  font-size: 0.9375rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 48rem) {
  .footer-inner { grid-template-columns: 2fr 1fr 1.5fr; }
}

.footer-brand img {
  height: 40px;
  width: auto;
}

.footer-brand p {
  margin-top: 0.75rem;
  max-width: 22rem;
  color: var(--muted);
}

.footer-nav,
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-nav a,
.footer-contact a {
  color: var(--ink);
  text-decoration: none;
}

.footer-nav a:hover,
.footer-contact a:hover {
  color: var(--plum);
  text-decoration: underline;
}

.footer-contact p {
  color: var(--muted);
}

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}


/* ===== 16. FRIENDLY TOUCHES: photo, sticker note, waving hand ===== */

/* Home hero: text on the left, photo on the right */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 56rem) {
  .hero-grid {
    grid-template-columns: 1fr 22rem;
    gap: 3.5rem;
  }
  /* Slightly smaller roles so they fit beside the photo */
  .hero-grid .roles a {
    font-size: clamp(2.5rem, 4.6vw, 3.85rem);
  }
}

/* On phones the photo comes first, a bit smaller */
@media (max-width: 55.99rem) {
  .hero-grid .photo-frame {
    order: -1;
    max-width: 15rem;
  }
}

.hero h1 {
  font-size: 1.5rem;
}

/* The waving hand waves once when the page opens */
.wave {
  display: inline-block;
  transform-origin: 70% 70%;
  animation: wave 1.2s ease-in-out 0.5s 1;
}

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(16deg); }
  30% { transform: rotate(-8deg); }
  45% { transform: rotate(14deg); }
  60% { transform: rotate(-4deg); }
  75% { transform: rotate(10deg); }
}

@media (prefers-reduced-motion: reduce) {
  .wave { animation: none; }
}

/* Your photo, framed like a print on a desk: white border,
   a slight tilt, and a solid lilac "shadow" offset behind it */
.photo-frame {
  position: relative;
  background: #fff;
  padding: 0.6rem 0.6rem 0.6rem;
  border-radius: 6px;
  box-shadow: 10px 10px 0 var(--lilac);
  transform: rotate(2deg);
  justify-self: center;
  width: 100%;
}

.photo-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
}

/* A sparkle in the corner, borrowed from your logo */
.photo-frame::after {
  content: "✦";
  position: absolute;
  top: -1.1rem;
  right: -0.9rem;
  font-size: 2rem;
  line-height: 1;
  color: var(--lavender);
  transform: rotate(-2deg);
}

/* The little sticky note on the photo */
.sticker {
  position: absolute;
  left: -1rem;
  bottom: 1.5rem;
  max-width: 13rem;
  background-color: var(--lilac);
  color: var(--plum-deep);
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.35;
  padding: 0.7rem 0.9rem;
  border-radius: 4px;
  transform: rotate(-5deg);
}

@media (max-width: 30rem) {
  .sticker {
    left: -0.5rem;
    font-size: 0.875rem;
    max-width: 11rem;
  }
}

/* About page: photo above the quick-facts box */
.about-side {
  display: grid;
  gap: 2.5rem;
  justify-items: start;
}

.photo-frame-small {
  max-width: 17rem;
  justify-self: center;
}

/* The "page not found" page */
.not-found {
  padding: 6rem 0 7rem;
}
