/* ============================================================================
   mac-system.css — System 7.5.3 skin (Layer 2: the desktop)

   Opt-in retro skin, scoped under html.mac-os. The temporary
   html.mac-os-pending state only masks the normal page during saved-skin
   startup. The header toggle is wired in js/mac-system.js. With JavaScript
   off, or the skin off, none of this applies (progressive enhancement, same
   contract as the dark/light theme).

   LAYOUT — <main> stops being a page and becomes the DESKTOP: a fixed, dithered
   surface below the menu bar. Each section of the site is moved into its own
   .mac-window, absolutely positioned inside it. Anything on the desktop that
   isn't a window or the icon layer is hidden, so a section that hasn't been
   opened yet simply waits out of sight.

   THE ANCHOR RULE — all *content* styling hangs off .mac-win-body, NOT off
   main. That matters: the blanket reset below strips colour, radius and shadow
   from everything it covers, and anchoring it to the window body is what keeps
   it away from the window chrome. Move a content rule back onto `main` and it
   will either do nothing or repaint the desktop.

   TYPEFACE — a deliberate departure from strict authenticity:
   The chrome originally used a pixel revival of Susan Kare's Chicago. It was
   accurate but hard to read on modern displays at UI sizes, so the whole skin
   now runs on Verdana — Matthew Carter, 1996, the same year as 7.5.3, drawn
   specifically for on-screen legibility. Chrome is bold Verdana, content is
   regular Verdana. No webfont is downloaded: this costs zero bytes and reads
   cleanly at every size.

   COLOUR — 8-bit era. Windows and their content are black on white, exactly
   like a real Finder/document window. Colour lives where the Mac put it: the
   desktop pattern, the icons, the Apple logo, and selection highlights.
   Blended shades are faked with ordered DITHER (2px checkerboards) rather than
   smooth gradients.
   ========================================================================== */

/* ---- [TOKENS] ------------------------------------------------------------ */
html.mac-os,
html.mac-os-pending {
  /* One family for the whole skin; weight separates chrome from content. */
  --mac-geneva:  'Verdana', 'Geneva', 'Tahoma', 'DejaVu Sans', sans-serif;
  --mac-ui:      'Verdana', 'Geneva', 'Tahoma', 'DejaVu Sans', sans-serif;
  --mac-ui-size: 12px;

  --mac-black:   #000000;
  --mac-white:   #ffffff;
  --mac-face:    #cccccc;
  --mac-face-hi: #eeeeee;
  --mac-desk-a:  #8fa3a3;   /* desktop dither pair — muted teal-grey */
  --mac-desk-b:  #6f8888;
  --mac-hi:      #b7c9ef;   /* selection highlight */
  --mac-target:  44px;      /* accessible hit area around the 11px-era glyphs */
}

/* ---- [PRE-PAINT RESTORE] -------------------------------------------------
   The head bootstrap applies this temporary state while the full runtime at
   the end of <body> is still loading. Show only the desktop pattern so the
   ordinary site cannot flash between same-origin page navigations. */
html.mac-os-pending,
html.mac-os-pending body {
  height: 100%;
  overflow: hidden;
  background-color: var(--mac-desk-a);
  background-image:
    linear-gradient(45deg, var(--mac-desk-b) 25%, transparent 25% 75%, var(--mac-desk-b) 75%),
    linear-gradient(45deg, var(--mac-desk-b) 25%, transparent 25% 75%, var(--mac-desk-b) 75%);
  background-size: 2px 2px;
  background-position: 0 0, 1px 1px;
}
html.mac-os-pending #app { visibility: hidden; }

/* Chrome type: menu bar, window titles, menus, buttons. */
html.mac-os .mac-ui {
  font-family: var(--mac-ui);
  font-size: var(--mac-ui-size);
  font-weight: 700;
  line-height: 1;
}

/* ---- [DESKTOP] ----------------------------------------------------------- */
html.mac-os,
html.mac-os body {
  height: 100%;
  overflow: hidden;                 /* windows scroll, the page never does */
  background-color: var(--mac-desk-a);
  background-image:
    linear-gradient(45deg, var(--mac-desk-b) 25%, transparent 25% 75%, var(--mac-desk-b) 75%),
    linear-gradient(45deg, var(--mac-desk-b) 25%, transparent 25% 75%, var(--mac-desk-b) 75%);
  background-size: 2px 2px;
  background-position: 0 0, 1px 1px;
  font-family: var(--mac-geneva);
}
html.mac-os #app { display: block; min-height: 0; }
/* Only the PAGE's own header and footer, never a <header>/<footer> inside the
   content. Blog posts wrap their title and date in <header id="post-header">,
   and a blanket `header { display: none }` silently ate the post metadata. */
html.mac-os #header-placeholder,
html.mac-os #app > header,
html.mac-os #app > footer,
html.mac-os #mobile-menu,
html.mac-os #mobile-menu-backdrop { display: none !important; }

/* <main> IS the desktop: transparent, so the body's dither shows through. */
html.mac-os main {
  position: fixed;
  top: 20px; left: 0; right: 0; bottom: 0;
  margin: 0; padding: 0;
  overflow: hidden;
  background: transparent;
  z-index: 1;
}
/* Sections waiting to be opened are still children of <main>. Hide everything
   that isn't a window or the icon layer, or they'd pile up on the desktop. */
html.mac-os main > :not(.mac-window):not(.mac-desktop-icons) { display: none !important; }

/* design.css:133 alternates #F8F9FA / #FFFFFF across every DIRECT CHILD of
   <main> to stripe the marketing page's sections. On the desktop those children
   are the windows and the icon layer — and the icon layer spans inset:0, so its
   stripe painted the whole desktop near-white, hiding the dither completely.
   Strip the stripe here; the window re-asserts its own white below (higher
   specificity, so it wins). */
html.mac-os main > * { background-color: transparent !important; }

/* Suppress text selection while a window or icon is being dragged. */
html.mac-os body.mac-dragging { user-select: none; cursor: default; }

/* ---- [MENU BAR] ---------------------------------------------------------- */
html.mac-os .mac-menubar {
  position: fixed; top: 0; left: 0; right: 0; height: 20px;
  display: flex; align-items: stretch;
  padding: 0 6px;
  background: var(--mac-white);
  border-bottom: 1px solid var(--mac-black);
  color: var(--mac-black);
  z-index: 2000; user-select: none;
}
html.mac-os .mac-menu {
  display: flex; align-items: center;
  padding: 0 10px;
  background: none; border: 0; margin: 0;
  color: inherit; cursor: default;
}
html.mac-os .mac-menu[aria-expanded="true"] { background: var(--mac-black); color: var(--mac-white); }
html.mac-os .mac-menu.apple { padding: 0 11px; }
html.mac-os .mac-menu.apple svg { width: 13px; height: 15px; display: block; }
html.mac-os .mac-menu[aria-expanded="true"].apple svg { filter: grayscale(1) brightness(3); }
html.mac-os .mac-clock { margin-left: auto; display: flex; align-items: center; padding: 0 6px; }

/* ---- [MENUS] ------------------------------------------------------------- */
html.mac-os .mac-dropdown {
  position: fixed; top: 20px;
  min-width: 168px; padding: 2px 0;
  background: var(--mac-white);
  border: 1px solid var(--mac-black);
  box-shadow: 2px 2px 0 rgba(0,0,0,.45);
  z-index: 2100;
}
html.mac-os .mac-dropdown[hidden] { display: none; }
html.mac-os .mac-item {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: 3px 14px 3px 20px;
  background: none; border: 0; text-align: left;
  color: var(--mac-black); cursor: default;
}
html.mac-os .mac-item:not(.disabled):hover,
html.mac-os .mac-item:not(.disabled):focus { background: var(--mac-black); color: var(--mac-white); outline: none; }
html.mac-os .mac-item.disabled { color: #999; }
html.mac-os .mac-sep { height: 1px; margin: 3px 0; background: #999; }

/* ============================================================================
   [WINDOW] One Finder window per section, positioned by js/mac-windows.js.
   ========================================================================== */
html.mac-os .mac-window {
  position: absolute;
  display: flex; flex-direction: column;
  /* !important beats the main > * stripe reset above; (0,2,1) outranks its
     (0,1,2), so a window is always white regardless of its child index. */
  background-color: var(--mac-white) !important;
  border: 1px solid var(--mac-black);
  box-shadow: 1px 1px 0 rgba(0,0,0,.45), 2px 2px 0 rgba(0,0,0,.28);
  overflow: hidden;
}

/* WindowShade — the 7.5 collapse box rolls the window up to its title bar. This
   is the era's "minimize"; System 7 had no Dock and no taskbar. */
html.mac-os .mac-window.shaded { height: auto !important; }
html.mac-os .mac-window.shaded .mac-win-body,
html.mac-os .mac-window.shaded .mac-grow { display: none; }

html.mac-os .mac-titlebar {
  flex: 0 0 auto; position: relative;
  height: var(--mac-target);
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--mac-black);
  background:
    repeating-linear-gradient(to bottom, #000 0 1px, #fff 1px 2px) 0 16px / 100% 12px no-repeat,
    var(--mac-white);
  user-select: none; cursor: default;
}
html.mac-os .mac-titlebar:focus-visible {
  outline: 2px solid var(--mac-black);
  outline-offset: -3px;
}
html.mac-os .mac-titlebar .title {
  background: var(--mac-white); padding: 0 10px; z-index: 2;
  max-width: calc(100% - 150px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html.mac-os .tb-box {
  position: absolute; top: 0;
  width: var(--mac-target); height: var(--mac-target); padding: 0;
  background: transparent; border: 0;
  z-index: 3; cursor: pointer;
}
html.mac-os .tb-box.close { left: 0; }
html.mac-os .tb-box.zoom  { right: 0; }
html.mac-os .tb-box.shade { right: var(--mac-target); }
html.mac-os .tb-glyph {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 11px; height: 11px;
  background: var(--mac-white); border: 1px solid var(--mac-black);
  pointer-events: none;
}
html.mac-os .tb-box.zoom .tb-glyph::before {
  content: ""; position: absolute; top: 1px; left: 1px;
  width: 5px; height: 5px; border: 1px solid var(--mac-black); background: var(--mac-white);
}
html.mac-os .tb-box.shade .tb-glyph::before {
  content: ""; position: absolute; top: 2px; left: 1px; right: 1px; height: 1px;
  background: var(--mac-black);
}
html.mac-os .tb-box:active .tb-glyph { background: var(--mac-face); }
html.mac-os .tb-box:focus-visible { outline: none; }
html.mac-os .tb-box:focus-visible .tb-glyph {
  outline: 2px solid var(--mac-black);
  outline-offset: 2px;
}

/* An INACTIVE System 7 window lost its pinstripes and all three widget boxes —
   the single clearest signal of which window has focus. */
html.mac-os .mac-window:not(.focused) .mac-titlebar { background: var(--mac-white); }
html.mac-os .mac-window:not(.focused) .tb-box,
html.mac-os .mac-window:not(.focused) .mac-grow { display: none; }

/* Grow box — the resize grip, drawn as the classic overlapping squares. */
html.mac-os .mac-grow {
  position: absolute; right: 0; bottom: 0;
  width: var(--mac-target); height: var(--mac-target); padding: 0;
  background: transparent; border: 0;
  cursor: nwse-resize; z-index: 4;
}
html.mac-os .mac-grow::before,
html.mac-os .mac-grow::after {
  content: ""; position: absolute;
  border: 1px solid var(--mac-black); background: var(--mac-white);
}
html.mac-os .mac-grow::before { right: 7px; bottom: 7px; width: 7px; height: 7px; }
html.mac-os .mac-grow::after  { right: 3px; bottom: 3px; width: 7px; height: 7px; }
html.mac-os .mac-grow:focus-visible {
  outline: 2px solid var(--mac-black);
  outline-offset: -3px;
  background: var(--mac-white);
}

/* Window body — the scrolling document area. */
html.mac-os .mac-win-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 12px 14px 16px;
}

/* Classic scrollbar (WebKit/Blink) */
html.mac-os .mac-win-body::-webkit-scrollbar { width: 15px; height: 15px; }
html.mac-os .mac-win-body::-webkit-scrollbar-track {
  background-color: var(--mac-face-hi);
  background-image:
    linear-gradient(45deg, #b9b9b9 25%, transparent 25% 75%, #b9b9b9 75%),
    linear-gradient(45deg, #b9b9b9 25%, transparent 25% 75%, #b9b9b9 75%);
  background-size: 2px 2px; background-position: 0 0, 1px 1px;
  border-left: 1px solid var(--mac-black);
}
html.mac-os .mac-win-body::-webkit-scrollbar-thumb { background: var(--mac-face); border: 1px solid var(--mac-black); }
html.mac-os .mac-win-body::-webkit-scrollbar-button {
  display: block; height: 15px; background: var(--mac-face); border: 1px solid var(--mac-black);
}

/* ============================================================================
   [CONTENT] Inside a window: a document. Black on white, no colour, no radius.
   Everything below is anchored to .mac-win-body — see THE ANCHOR RULE up top.
   ========================================================================== */
html.mac-os .mac-win-body,
html.mac-os .mac-win-body * {
  font-family: var(--mac-geneva) !important;
  color: var(--mac-black) !important;
  background-color: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  letter-spacing: 0 !important;
  text-shadow: none !important;
  /* The inner pages bring their own stylesheets (case-study.css, prose.css,
     cv.css) which rule off headings and tables in light grey and teal. `color`
     doesn't touch those — border-color does. Verified safe: nothing in this
     site's CSS or markup uses a transparent border, so this can't reveal one. */
  border-color: var(--mac-black) !important;
}
html.mac-os .mac-win-body li::marker { color: var(--mac-black); }
html.mac-os .mac-win-body *::before,
html.mac-os .mac-win-body *::after { color: var(--mac-black) !important; }

/* The window body pads; the page's own big vertical rhythm is redundant here.
   NOTE the .py-20 trap: every homepage <section> carries Tailwind's py-20, and
   `.py-20` (two classes) outranks `section` (one), so zeroing the section alone
   silently does nothing. Both are set, both !important. */
html.mac-os .mac-win-body section { padding: 0 !important; margin: 0 !important; }
html.mac-os .mac-win-body .py-20,
html.mac-os .mac-win-body .py-10 { padding-top: 0 !important; padding-bottom: 0 !important; }
html.mac-os .mac-win-body > * + * { margin-top: 16px !important; }

/* Drop the marketing-page centring, wide measures and boxed layout. */
html.mac-os .mac-win-body .container { max-width: none !important; margin: 0 !important; padding: 0 !important; }
html.mac-os .mac-win-body [class*="max-w-"],
html.mac-os .mac-win-body .projects-grid { max-width: none !important; margin-left: 0 !important; margin-right: 0 !important; }
html.mac-os .mac-win-body p,
html.mac-os .mac-win-body li { max-width: 74ch !important; }
html.mac-os .mac-win-body h1 { max-width: 34ch !important; }
html.mac-os .mac-win-body h2 { max-width: 46ch !important; }
html.mac-os .mac-win-body .text-center { text-align: left !important; }
/* Centred flex rows leave the hero indented while the boxes below sit flush;
   pin everything to the same left edge. */
html.mac-os .mac-win-body .justify-center { justify-content: flex-start !important; }
html.mac-os .mac-win-body .items-center { align-items: flex-start !important; }
html.mac-os .mac-win-body .mt-4, html.mac-os .mac-win-body .mt-6, html.mac-os .mac-win-body .mt-8,
html.mac-os .mac-win-body .mt-10, html.mac-os .mac-win-body .mt-12 { margin-top: 8px !important; }
html.mac-os .mac-win-body .mb-12 { margin-bottom: 8px !important; }
html.mac-os .mac-win-body .space-y-4 > * + * { margin-top: 8px !important; }
html.mac-os .mac-win-body .gap-12, html.mac-os .mac-win-body .gap-4 { gap: 10px !important; }

/* Card grids reflow against the WINDOW's width, not the viewport's — auto-fit
   means a window dragged narrow collapses to one column on its own, with no
   media query involved. */
html.mac-os .mac-win-body .services-grid,
html.mac-os .mac-win-body .case-grid,
html.mac-os .mac-win-body .projects-grid,
html.mac-os .mac-win-body .recommendations-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) !important;
  gap: 8px !important;
}
html.mac-os .mac-win-body #latest-blog-posts > a { display: block; margin-bottom: 8px !important; }

/* ---- Inner-page layouts (case studies, build details, CV, posts) -----------
   These pages are built for a full-width scrolling document, so their sections
   carry 48–96px of vertical padding. Inside a window that reads as dead space —
   the hero alone opened with 96px of nothing above the first line. */
html.mac-os .mac-win-body .cs-section {
  padding: 0 0 14px !important;
  margin: 0 0 14px !important;
}
html.mac-os .mac-win-body .cs-hero { padding-top: 0 !important; }
html.mac-os .mac-win-body .cs-metrics .cs-metric-grid,
html.mac-os .mac-win-body .cs-metrics [class*="grid"] {
  gap: 10px !important;
}
html.mac-os .mac-win-body .cs-summary { padding: 6px 0 6px 12px !important; margin: 8px 0 !important; }
html.mac-os .mac-win-body .cs-table-wrap { margin: 8px 0 !important; }
/* Post and CV bodies pad themselves via .container, which is already zeroed. */
html.mac-os .mac-win-body article.container,
html.mac-os .mac-win-body .cv-page { padding: 0 !important; }

/* The window's title bar now carries the section name, so the page's own eyebrow
   and any heading that just repeats it are redundant chrome — hide them.
   (js/mac-system.js tags the duplicate heading with .mac-dup.) */
html.mac-os .mac-win-body .section-eyebrow { display: none !important; }
html.mac-os .mac-win-body h1.mac-dup,
html.mac-os .mac-win-body h2.mac-dup { display: none !important; }

/* The social-proof bullets are drawn with background-color, not color, so the
   generic ::before reset misses them. Square them off in black. */
html.mac-os .mac-win-body .sp-item::before {
  background-color: var(--mac-black) !important;
  border-radius: 0 !important;
  width: 4px !important; height: 4px !important;
}
html.mac-os .mac-win-body .sp-label,
html.mac-os .mac-win-body .sp-items { text-align: left !important; justify-content: flex-start !important; }
html.mac-os .mac-win-body .sp-items { gap: 4px 18px !important; }

/* Card internals: pull the heading and summary together. */
html.mac-os .mac-win-body .project-card > * + *,
html.mac-os .mac-win-body article > * + * { margin-top: 6px !important; }

/* Hero: a portrait, not a hero image. */
html.mac-os .mac-win-body #home img { width: 148px !important; height: 148px !important; object-fit: cover; }
html.mac-os .mac-win-body #home .flex-wrap { gap: 6px !important; }
/* Finder folders and document icons replace the marketing-page hero actions.
   Hide the whole group so its in-page anchor cannot target hidden desktop content. */
html.mac-os .mac-win-body #home .hero-actions { display: none !important; }

html.mac-os .mac-win-body h1 { font-size: 19px !important; font-weight: bold !important; line-height: 1.25 !important; margin-bottom: 8px !important; }
html.mac-os .mac-win-body h2 { font-size: 16px !important; font-weight: bold !important; line-height: 1.3 !important; }
/* line-height is not optional here: the card headings carry Tailwind's
   .text-2xl, which pins line-height to 2rem. Shrinking only the font-size
   leaves 32px of leading on 13px text — a visible gap mid-heading. */
html.mac-os .mac-win-body h3 { font-size: 13px !important; font-weight: bold !important; line-height: 1.3 !important; }
html.mac-os .mac-win-body p,
html.mac-os .mac-win-body li { font-size: 13px !important; line-height: 1.5 !important; }
html.mac-os .mac-win-body .hero-eyebrow,
html.mac-os .mac-win-body .section-eyebrow,
html.mac-os .mac-win-body .sp-label { font-size: 11px !important; text-transform: none !important; }

/* Panels: flat white with a hard 1px frame — no colour, no rounding. */
html.mac-os .mac-win-body article,
html.mac-os .mac-win-body blockquote,
html.mac-os .mac-win-body .card-hover,
html.mac-os .mac-win-body .case-card,
html.mac-os .mac-win-body .testimonial-card,
html.mac-os .mac-win-body .social-proof-strip {
  background: var(--mac-white) !important;
  border: 1px solid var(--mac-black) !important;
  margin: 0 0 10px 0 !important;
  padding: 10px 12px !important;
}
html.mac-os .mac-win-body .social-proof-strip { margin: 0 !important; }
html.mac-os .mac-win-body .testimonial-quote-mark { font-size: 20px !important; line-height: 1 !important; display: block; }
/* The metric pill draws its own pale-blue border, which the colour reset misses
   (that rule sets `color`, not `border-color`). Square it off in black. */
html.mac-os .mac-win-body .case-metric {
  font-weight: bold !important;
  border: 1px solid var(--mac-black) !important;
  padding: 3px 8px !important;
}

/* Push buttons — classic rounded rect on the exact pixel grid. */
html.mac-os .mac-win-body .btn-pill,
html.mac-os .mac-win-body a[class*="bg-light-primary"],
html.mac-os .mac-win-body a[class*="bg-dark-primary"] {
  font-family: var(--mac-ui) !important;
  font-size: var(--mac-ui-size) !important;
  line-height: 1 !important;
  font-weight: normal !important;
  background: var(--mac-white) !important;
  color: var(--mac-black) !important;
  border: 1px solid var(--mac-black) !important;
  border-radius: 7px !important;
  padding: 0 14px !important;
  text-decoration: none !important;
  /* These sit in flex rows next to taller items (the contact email), and the
     default align-items:stretch made them tall boxes with the label pinned to
     the top. Fix the height, centre the label, opt out of stretching. */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: center !important;
  height: 24px !important;
}
/* the primary CTA gets the classic "default button" double ring */
html.mac-os .mac-win-body a[class*="bg-light-primary"],
html.mac-os .mac-win-body a[class*="bg-dark-primary"] { box-shadow: 0 0 0 2px var(--mac-black) !important; }

html.mac-os .mac-win-body img { filter: grayscale(1) contrast(1.1) !important; border: 1px solid var(--mac-black) !important; }
/* Underlines: the Builds cards and blog cards are <a> elements WRAPPING whole
   blocks, so a blanket underline strikes every line of body copy in them.
   Underline only genuine inline/call-to-action links. */
html.mac-os .mac-win-body a { text-decoration: none; }
html.mac-os .mac-win-body p > a,
html.mac-os .mac-win-body li > a,
html.mac-os .mac-win-body .case-card > a,
html.mac-os .mac-win-body .text-center > a { text-decoration: underline; }
html.mac-os .mac-win-body a > h2,
html.mac-os .mac-win-body a > h3 { text-decoration: none !important; }

/* ============================================================================
   [DESKTOP ICONS] Absolutely positioned inside the desktop and draggable, the
   way a real desktop let you shove things anywhere. js/mac-system.js sets the
   inline left/top; "Clean Up Desktop" in the View menu re-runs the layout.
   ========================================================================== */
html.mac-os .mac-desktop-icons {
  position: absolute; inset: 0;
  z-index: 1;
  user-select: none;
  pointer-events: none;             /* only the icons themselves are targets */
}
html.mac-os .mac-desktop-icons[hidden] { display: none; }
html.mac-os .mac-icon {
  position: absolute;
  pointer-events: auto;
  width: 104px; text-align: center; cursor: default;
  background: none; border: 0; padding: 0; color: inherit;
}
html.mac-os .mac-icon svg { display: block; margin: 0 auto 2px; }
html.mac-os .mac-icon .label {
  font-family: var(--mac-geneva); font-size: 11px; line-height: 1.2;
  color: var(--mac-black); background: var(--mac-white);
  padding: 0 3px; display: inline-block;
  white-space: normal;
  /* Measured at 11px Verdana: "Recommendations" is one unbreakable 108px word.
     The label is allowed to be WIDER than the 104px icon box — it's a centred
     inline-block and nothing clips it — so long names stay on one line without
     the whole icon grid having to grow. Multi-word names still wrap normally.
     layoutIcons() keeps a matching margin at the right screen edge. */
  max-width: 112px;
  overflow-wrap: break-word;        /* last resort for anything even longer */
}
html.mac-os .mac-icon.selected .label { background: var(--mac-hi); }
html.mac-os .mac-icon.selected svg { filter: brightness(.86); }
html.mac-os .mac-icon.dragging { z-index: 9; opacity: .7; }
/* Finder dimmed the icon of a folder whose window was already open. */
html.mac-os .mac-icon.open svg { opacity: .42; }

/* ---- [ABOUT BOX] --------------------------------------------------------- */
html.mac-os .mac-about {
  position: fixed; top: 96px; left: 50%; transform: translateX(-50%);
  width: 340px; z-index: 2200;
  background: var(--mac-white);
  border: 1px solid var(--mac-black);
  box-shadow: 2px 2px 0 rgba(0,0,0,.45);
}
html.mac-os .mac-about[hidden] { display: none; }
html.mac-os .mac-about .body { padding: 14px 16px; font-family: var(--mac-geneva); font-size: 12px; line-height: 1.5; }
html.mac-os .mac-about .body p { margin-bottom: 8px; }
html.mac-os .mac-about .ok {
  font-family: var(--mac-ui); font-size: var(--mac-ui-size); font-weight: 700; line-height: 1;
  display: block; margin: 4px auto 14px;
  padding: 5px 20px; background: var(--mac-white);
  border: 1px solid var(--mac-black); border-radius: 7px;
  box-shadow: 0 0 0 2px var(--mac-black); cursor: pointer;
}

/* ---- [SMALL SCREENS] ------------------------------------------------------
   Dragging windows with a thumb is miserable, so on a phone the metaphor
   simplifies: the icon grid IS the navigation, and tapping a folder fills the
   screen with that window. Closing it drops you back on the desktop.

   These use !important because js/mac-windows.js writes left/top/width/height
   as inline styles, and an author !important declaration is the one thing that
   outranks an inline one. */
@media (max-width: 820px) {
  html.mac-os .mac-desktop-icons {
    pointer-events: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 14px 4px;
    align-content: start;
    padding: 16px 8px;
    overflow-y: auto;
  }
  html.mac-os .mac-icon {
    position: static !important;    /* inline left/top become inert */
    width: auto;
  }
  html.mac-os .mac-window {
    left: 0 !important; top: 0 !important;
    width: 100% !important; height: 100% !important;
    border: 0; box-shadow: none;
  }
  html.mac-os .mac-window.shaded { height: auto !important; }
  html.mac-os .mac-grow { display: none !important; }
  html.mac-os .mac-win-body { padding: 10px 10px 14px; }
  html.mac-os .mac-win-body #home img { width: 104px !important; height: 104px !important; }
  html.mac-os .mac-titlebar .title { max-width: 52%; }
}

/* ---- [PRINT] ---------------------------------------------------------------
   The skin follows a visitor across the whole site, so someone who switched it
   on can land on cv.html and hit Print or Save as PDF. Without this they get a
   single clipped viewport with a fake Apple menu bar across the top — on the
   one page this site exists to hand to an employer. Printing unwinds the
   desktop back into an ordinary document instead of trying to reproduce it. */
@media print {
  html.mac-os,
  html.mac-os body {
    height: auto !important;
    overflow: visible !important;
    background: #fff !important;
  }
  html.mac-os .mac-menubar,
  html.mac-os .mac-desktop-icons,
  html.mac-os .mac-titlebar,
  html.mac-os .mac-grow,
  html.mac-os .mac-about,
  html.mac-os .mac-dropdown { display: none !important; }

  html.mac-os main {
    position: static !important;
    overflow: visible !important;
    height: auto !important;
  }
  /* Content that never made it into a window (or whose window was closed) must
     still print — the desktop's hide-everything rule is screen-only. */
  html.mac-os main > :not(.mac-desktop-icons) { display: block !important; }

  html.mac-os .mac-window {
    position: static !important;
    left: auto !important; top: auto !important;
    width: auto !important; height: auto !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  /* A rolled-up window must not print as an empty stub. */
  html.mac-os .mac-window.shaded .mac-win-body { display: block !important; }
  html.mac-os .mac-win-body {
    overflow: visible !important;
    padding: 0 !important;
  }
  /* The title bar is gone, so the heading it was standing in for must come back. */
  html.mac-os .mac-win-body h1.mac-dup,
  html.mac-os .mac-win-body h2.mac-dup { display: block !important; }
}

/* ============================================================================
   [TOGGLE] the button injected into the NORMAL header (unskinned site).
   ========================================================================== */
/* Icon-only, with a 44px square target around the period-sized artwork. The
   label is carried by aria-label + title, not visible text. */
.mac-skin-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px;
  padding: 8px; margin: 0;
  border: 0; border-radius: 9999px;
  background: transparent; color: inherit; cursor: pointer;
  transition: background-color .15s;
}
.mac-skin-toggle:hover { background-color: rgb(229 231 235); }
html.dark .mac-skin-toggle:hover { background-color: rgb(55 65 81); }
.mac-skin-toggle img { display: block; }
