/* Marharyta Dolha — shared styles
   Most of the look still lives in inline styles (exported from the design canvas).
   This file adds what inline styles can't do: hover/focus/pressed states, motion,
   the About panel and the phone/tablet layout.
   Inline styles beat stylesheet rules, so responsive overrides use !important.

   Breakpoints: ≤1100px small laptop/tablet, ≤760px phone, ≤420px small phone. */

:root {
  --paper: #F7F6F2;
  --ink: #1B1915;
  --body: #3A3732;
  --label: #67635C;
  --label-2: #6F6F66;
  --line: #DDD9D0;
  --line-2: #E6E3DC;
  --card: #FCFCFB;
  --warn: #B84A15; /* the darker ginger used for Arrivée quotes: 5:1 on white */
  --pad: clamp(20px, 5vw, 64px);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

[hidden] { display: none !important; }
html, body { background: #F7F6F2; } /* Paper: no white edge when scrolling past the page */
img, video { max-width: 100%; }
/* width/height attributes are only there to reserve space while loading */
img { height: auto; }

/* ---------------------------------------------------------------------------
   Keyboard focus, skip link
   --------------------------------------------------------------------------- */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }

.skip-link {
  position: absolute; left: 16px; top: -200px; z-index: 100;
  padding: 14px 20px; background: var(--ink); color: #F7F6F2;
  font: 500 15px/1 Inter, system-ui, sans-serif; text-decoration: none;
}
.skip-link:focus { top: 16px; }
.skip-link:focus-visible { outline: 2px solid #F7F6F2; outline-offset: -6px; }

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

/* ---------------------------------------------------------------------------
   Header logo: "mm." (inline SVG, takes the link colour) + the name
   --------------------------------------------------------------------------- */
.site-logo { gap: 12px; }
.site-logo svg { display: block; flex-shrink: 0; height: 20px; width: auto; }

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 22px; box-sizing: border-box;
  border: 1px solid var(--ink); border-radius: 0;
  font-family: inherit; font-size: 15px; font-weight: 500; line-height: normal;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .12s ease;
}
/* filled: transparent border by default (padding 21px keeps the old width) */
.btn--fill { padding: 0 21px; background: var(--ink); color: #F7F6F2; border-color: transparent; }
.btn--fill:hover { background: #F7F6F2; color: var(--ink); border-color: var(--ink); }
.btn--fill:disabled { cursor: progress; background: var(--ink); color: #F7F6F2; border-color: transparent; opacity: .75; }

.btn--outline { background: transparent; color: var(--ink); }
.btn--outline:hover,
.project-row:hover .btn--outline,
.next-link:hover .btn--outline { background: var(--ink); color: #F7F6F2; }

/* round arrow buttons in the carousels */
.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--ink); border-radius: 50%;
  background: var(--card); color: var(--ink); cursor: pointer;
  transition: background-color .2s ease, color .2s ease, opacity .2s ease, transform .12s ease;
}
.icon-btn svg { transition: transform .2s ease; }
.icon-btn:not([aria-disabled="true"]):hover { background: var(--ink); color: #F7F6F2; }
.icon-btn--prev:not([aria-disabled="true"]):hover svg { transform: translateX(-3px); }
.icon-btn--next:not([aria-disabled="true"]):hover svg { transform: translateX(3px); }
.icon-btn[aria-disabled="true"] { cursor: default; }

/* MealCraft tabs */
.tab { border-bottom: 2px solid transparent !important; color: var(--label) !important; transition: color .2s ease, border-color .2s ease, transform .12s ease; }
.tab:hover, .tab[aria-selected="true"] { color: var(--ink) !important; }
.tab[aria-selected="true"] { border-bottom-color: var(--ink) !important; }

/* MealCraft tab panels: old screens fade out, new ones fade up while the box
   eases to their height (classes set by js/site.js) */
.tabpanels { display: flow-root; box-sizing: content-box; }
.tabpanels.is-switching {
  overflow: hidden; transition: height .4s cubic-bezier(.22, .61, .36, 1);
  padding: 0 20px 48px; margin: 0 -20px -48px; /* room for the screens' soft shadows */
}
[data-panel] { transition: opacity .4s ease, transform .45s cubic-bezier(.22, .61, .36, 1); }
[data-panel].is-leaving { opacity: 0; transition-duration: .18s; }
[data-panel].is-entering { opacity: 0; transform: translateY(14px); transition: none; }

/* MealCraft competitor carousels: screens side by side in a snapping strip,
   one in view; swipe, trackpad, arrows and ←/→ all glide between them */
.comp-strip {
  display: flex; gap: 16px;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.comp-strip::-webkit-scrollbar { display: none; }
.comp-strip > * { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; }
.fade-in { animation: fade-in .35s ease both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* pressed */
.btn:active, .icon-btn:not([aria-disabled="true"]):active, .tab:active,
.copy-btn:active, .back-btn:active { transform: scale(.97); }

/* arrows nudge in their direction */
.arr { display: inline-block; transition: transform .2s ease; }
.btn:hover .arr--r, .project-row:hover .arr--r, .next-link:hover .arr--r { transform: translateX(3px); }
.btn:hover .arr--d { transform: translateY(3px); }
.tlink:hover .arr--u { transform: translateY(-3px); }
.back-btn:hover .arr--l { transform: translateX(-3px); }
.contact-row:hover .arr--ne { transform: translate(2px, -2px); }

/* ---------------------------------------------------------------------------
   Text links: underline grows from the left
   --------------------------------------------------------------------------- */
.tlink, .contact-value, .inline-link {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 0 1px;
  transition: background-size .3s ease;
}
.tlink { background-position: 0 calc(50% + .72em); }
.tlink:hover { background-size: 100% 1px; }

.contact-value { align-self: flex-start; background-position: 0 100%; }
.contact-row:hover .contact-value { background-size: 100% 1px; }

/* the link inside the About text is always underlined */
.inline-link { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; background: none; }
.inline-link:hover { text-decoration-thickness: 2px; }

/* the email row: whole row is clickable, the Copy button sits on top */
.contact-row { position: relative; }
.stretched::after { content: ""; position: absolute; inset: 0; }
.contact-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.copy-btn {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink);
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer; transition: background-color .2s ease, color .2s ease, transform .12s ease;
}
.copy-btn::before { content: ""; position: absolute; inset: -6px -4px; } /* 44px tap area */
.copy-btn:hover { background: var(--ink); color: #F7F6F2; }

/* ---------------------------------------------------------------------------
   Home: project rows
   --------------------------------------------------------------------------- */
.cover { overflow: hidden; }
.cover img { transition: transform .4s ease; }
.project-row:hover .cover img { transform: scale(1.03); }

/* ---------------------------------------------------------------------------
   Home: intro + "More about me" panel
   Without JS the About panel simply sits under the intro.
   --------------------------------------------------------------------------- */
.intro-viewport { overflow: hidden; overflow: clip; }
.intro-panel { min-width: 0; box-sizing: border-box; }
.about { padding-top: clamp(48px, 6vw, 80px); }
.js .intro-track { display: flex; align-items: flex-start; gap: var(--pad); transition: transform .5s cubic-bezier(.22, .61, .36, 1); }
.js .intro-viewport { transition: height .5s cubic-bezier(.22, .61, .36, 1); }
.js .intro-panel { flex: 0 0 100%; }
.js .about { padding-top: 0; }
.js .intro-track.is-open { transform: translateX(calc(-100% - var(--pad))); }
.intro.no-anim .intro-track, .intro.no-anim .intro-viewport { transition: none; }
html:not(.js) .back-btn { display: none; }

.back-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0;
  border: 0; background: none; color: var(--ink); cursor: pointer;
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  transition: transform .12s ease;
}
/* horizontal video on top, text below at exactly the video's width
   (9 of 12 columns, the same width as the intro blocks) */
.about-grid {
  display: flex; flex-direction: column; gap: 32px;
  width: calc((100% - 11 * 24px) * 9 / 12 + 8 * 24px); max-width: 100%;
  margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--ink);
}
.about-media { order: -1; width: 100%; }
.about-text { display: flex; flex-direction: column; gap: 20px; }
.about-text p { margin: 0; font-size: 21px; line-height: 1.55; color: var(--body); }
.about-text .about-cta { margin-top: 12px; }
.about-video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #E9E7DF; }

/* ---------------------------------------------------------------------------
   Home: contact list
   --------------------------------------------------------------------------- */
.contact-list { align-self: start; }

/* ---------------------------------------------------------------------------
   Motion: reveal on scroll, smooth scrolling, page cross-fade
   (.reveal is only ever added by JS, so content shows without it)
   --------------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .25s; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .arr, .icon-btn svg, .cover img, .btn:active, .icon-btn:active, .tab:active, .copy-btn:active, .back-btn:active { transform: none !important; }
}

/* ---------------------------------------------------------------------------
   Fixed widths from the export: never wider than the page
   --------------------------------------------------------------------------- */
[style*="width: 1150px"], [style*="width: 1061px"], [style*="width: 823px"] { max-width: calc(100vw - 2 * var(--pad)); }

/* ===========================================================================
   ≤1100px: small laptop / tablet
   =========================================================================== */
@media (max-width: 1100px) {
  [style*="width: 1150px"], [style*="width: 1061px"], [style*="width: 823px"],
  [style*="height: 83px"], [style*="height: 238px"], [style*="height: 638px"] { width: auto !important; height: auto !important; }
  .g-first > * { grid-column: 1 / -1 !important; }

  .g-summary, .g-4to2, .g-comp { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .g-1col { grid-template-columns: minmax(0, 1fr) !important; }
  .g-hifi { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

  /* persona and findings stack: number + headline, card, what I found, quotes */
  .g-persona, .finding { grid-template-columns: minmax(0, 1fr) !important; }
  .g-persona > *, .finding > * { grid-column: 1 / -1 !important; grid-row: auto !important; }
  .finding > [style*="padding-top: 22px"] { padding-top: 0 !important; }

}

/* ===========================================================================
   ≤760px: phone
   =========================================================================== */
@media (max-width: 760px) {
  /* every 12-column / multi-column grid becomes one column ... */
  #main [style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  #main [style*="grid-column"] { grid-column: auto !important; grid-row: auto !important; }

  /* ... except these */
  #main [data-panel], #main .g-hifi, #main .g-beforeafter { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; column-gap: 16px !important; }
  #main .g-hifi { row-gap: 40px !important; }
  .g-hifi img { margin-inline: auto; }

  /* header: name left, nav right */
  .site-header { flex-wrap: nowrap !important; gap: 12px !important; }
  .site-header > div { flex-wrap: nowrap !important; gap: 0 20px !important; }
  .site-nav { flex-wrap: nowrap !important; gap: 0 16px !important; }
  .site-header > a { flex-shrink: 0; }

  /* Home */
  .project-row .cover { order: -1; }
  .about-grid { width: 100%; gap: 28px; }

  /* MealCraft competitors: one phone at a time, max 300px, centred */
  .comp { width: 100%; max-width: 300px; margin-inline: auto; }

  /* MealCraft redesign tabs scroll sideways instead of wrapping */
  .tablist { flex-wrap: nowrap !important; overflow-x: auto; gap: 0 24px !important; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tablist::-webkit-scrollbar { display: none; }
  .tab { flex-shrink: 0; white-space: nowrap; }

  /* settings carousels */
  .mc-carousel { gap: 16px !important; }
  .mc-carousel > figure { flex-basis: 92% !important; }

  /* "after" phone prototypes */
  video[style*="min(100%, 340px)"] { width: min(100%, 280px) !important; }

  /* body copy stays ≥16px */
  .about-text p { font-size: 19px; }
}

/* ≤420px: no room for the clock */
@media (max-width: 420px) {
  .clock { display: none; }
  .site-header > a { flex-shrink: 1; min-width: 0; font-size: 18px !important; line-height: 1.1; }
  .site-nav { gap: 0 12px !important; font-size: 14px !important; }
  .site-nav a { min-width: 44px; justify-content: center; }
}
