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

body,
h1, h2, h3, p, dl, dd, ul, figure, blockquote { margin: 0; padding: 0; }

button { font: inherit; color: inherit; }

[hidden] { display: none !important; }

:root {
  --ink: #000000;
  --ink-soft: #111111;
  --glass: rgba(255, 255, 255, 0.88);
  --pill: rgba(202, 202, 202, 0.5);
  --highlight: rgba(255, 212, 84, 0.5);
  --window-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.25);
  --icon-size: 48px;
  --close: #FF4546;
  --control: #EDEDED;
  --sans: "Montserrat", system-ui, sans-serif;
  --serif: "Merriweather", Georgia, serif;
}

body {
  min-height: 100vh;
  background: #1a1a1a url("assets/background.jpg") center / cover no-repeat fixed;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.desktop {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Window */

.window {
  position: absolute;
  left: 180px;
  width: min(880px, calc(100vw - 300px));
  display: flex;
  flex-direction: column;
  background: var(--glass);
  border-radius: 8px;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: var(--window-shadow);
}

/* Stacking (set up in main.js): background windows look inactive, like macOS. */

.window:not(.is-front) .window__title { opacity: 0.5; }
.window:not(.is-front) .control--close { background: var(--control); }
.window--jammin:not(.is-front) .control--close { background: rgba(255, 255, 255, 0.2); }
.window:not(.is-front) .control--close:hover { background: var(--close); }

/* The first press on a background window's embed brings the window forward instead of reaching the embed. */
[data-window]:not(.is-front) iframe { pointer-events: none; }

/* Moving and resizing (set up in main.js) */

.window__bar,
.testimonials__head { cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; }

.is-dragging,
.is-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }

/* Keep embeds from swallowing the pointer mid-drag. */
.is-dragging iframe,
.is-resizing iframe { pointer-events: none; }

.resize { position: absolute; z-index: 2; touch-action: none; }
.resize--e { top: 8px; right: 0; bottom: 8px; width: 6px; cursor: ew-resize; }
.resize--s { left: 8px; right: 8px; bottom: 0; height: 6px; cursor: ns-resize; }
.resize--se { right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; }

.window--hello {
  top: 56px;
  gap: 32px;
  padding: 16px 16px 40px;
}

.window--work {
  top: 76px;
  height: min(600px, calc(100vh - 200px));
  padding-top: 16px;
  gap: 16px;
  overflow: hidden;
}

.window__bar { display: flex; align-items: center; padding: 0 16px; }
.window--hello .window__bar { padding: 0; }

.window__controls,
.window__controls-spacer { width: 64px; flex-shrink: 0; }

.window__controls { display: flex; gap: 8px; }

.control {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 100px;
  background: var(--control);
}

.control--close { background: var(--close); cursor: pointer; }

.window__title {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
}

.window__body {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 0 40px;
}

/* Hello */

.hero { display: flex; flex-direction: column; gap: 20px; }

.identity { display: flex; align-items: center; gap: 16px; }
.identity img { flex-shrink: 0; }

.identity__name,
.identity__role { font-size: 16px; line-height: 20px; }
.identity__name { font-weight: 700; }
.identity__role { font-weight: 500; }

.headline {
  max-width: 720px;
  font-size: 40px;
  font-weight: 700;
  line-height: 48px;
  letter-spacing: -0.02em;
}

.bio {
  max-width: 680px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 16px;
  line-height: 24px;
}

.divider {
  margin: 0;
  border: 0;
  border-top: 3px dotted var(--ink-soft);
}

.facts { display: flex; gap: 48px; }

.stats {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat { display: flex; align-items: center; gap: 12px; }

.stat dt {
  width: 56px;
  flex-shrink: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 28px;
}

.stat dd { font-size: 14px; font-weight: 500; line-height: 18px; }

.industries { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.industries h3 { font-size: 14px; font-weight: 700; line-height: 18px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }

.tags li {
  padding: 4px 12px;
  background: var(--pill);
  border-radius: 1000px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 0;
  border-radius: 1000px;
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.button:hover { transform: translateY(-1px); }
.button--primary { background: var(--ink-soft); color: #FFFFFF; }
.button--secondary { background: var(--pill); color: var(--ink-soft); }

/* Work experience */

.jobs {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 24px;
  outline: none;
  scrollbar-width: thin;
}

.job {
  display: flex;
  gap: 16px;
  padding: 12px 40px;
  scroll-margin-top: 0;
  transition: background-color 0.2s ease;
}

.job + .job { position: relative; margin-top: 24px; }

.job + .job::before {
  content: "";
  position: absolute;
  top: -13px;
  left: 40px;
  right: 40px;
  border-top: 3px dotted var(--ink);
}

.job.is-active { background: var(--highlight); }

.job__logo { flex-shrink: 0; border-radius: 8px; }

.job__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
}

.job__head { display: flex; justify-content: space-between; gap: 16px; }
.job__head p:last-child { flex-shrink: 0; }

.job ul { list-style: none; }
.job li::before { content: "• "; }

.achievement {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  background: rgba(202, 202, 202, 0.25);
  border-radius: 1000px;
}

.achievement svg { flex-shrink: 0; }

/* Embedded apps */

.window--app { padding-bottom: 16px; }

.window--jammin { background: rgba(17, 17, 17, 0.88); }

.window--jammin .window__title { color: #FFFFFF; }
.window--jammin .control:not(.control--close) { background: rgba(255, 255, 255, 0.2); }

.embed {
  flex: 1;
  width: auto;
  margin: 0 16px;
  border: 0;
  border-radius: 6px;
  background: #000000;
}

.embed--light { background: #FAFAFC; }

/* Apple Music's player is designed for up to ~660px wide, so this window is narrower. */
.window--music { width: min(680px, calc(100vw - 300px)); }
.embed--music { background: transparent; }

/* Testimonials */

.testimonials {
  position: absolute;
  top: 30px;
  left: 40px;
  width: 400px;
  /* Same shadow as the windows, but follows the tilted card stack's outline. */
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.25));
}

.testimonials::before,
.testimonials::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 16px;
  transform-origin: 0 0;
}

.testimonials::before { translate: 13.74px -14.2px; rotate: 4.21deg; }
.testimonials::after { translate: -9.84px 11.55px; rotate: -3.23deg; }

.testimonials__card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  background: #FFFFFF;
  border-radius: 16px;
}

.testimonials__head { display: flex; align-items: center; gap: 16px; }

.testimonials__head h2 {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
  line-height: 20px;
}

.pager { display: flex; align-items: center; gap: 8px; }

.pager button {
  display: flex;
  padding: 2px;
  border: 0;
  border-radius: 100px;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
}

.pager button:hover { background: var(--pill); }

.pager__count { font-size: 16px; font-weight: 500; line-height: 20px; }

.quote { display: flex; flex-direction: column; gap: 16px; }

.quote blockquote {
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 16px;
  line-height: 20px;
}

.quote figcaption { display: flex; align-items: center; gap: 16px; }

.quote figcaption img,
.initials {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 1000px;
  object-fit: cover;
}

.initials {
  display: grid;
  place-items: center;
  background: #DDDDDD;
  font-size: 14px;
  font-weight: 700;
}

.quote figcaption > span:last-child {
  display: flex;
  flex-direction: column;
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
}

.quote strong { font-weight: 700; }

/* Rail */

.rail {
  position: absolute;
  top: 36px;
  right: 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.app {
  position: relative;
  display: block;
  width: var(--icon-size);
  height: var(--icon-size);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  cursor: pointer;
}

.app img,
.app svg { display: block; width: var(--icon-size); height: var(--icon-size); border-radius: 10px; }

.app.is-active { box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px var(--ink-soft); }

.app::after {
  content: attr(data-label);
  position: absolute;
  top: 50%;
  right: calc(100% + 12px);
  translate: 0 -50%;
  padding: 4px 6px;
  background: #FFFFFF;
  border-radius: 6px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.app:hover::after,
.app:focus-visible::after,
.app.is-active::after { opacity: 1; }

/* Dock */

.dock {
  position: fixed;
  z-index: 10000;
  bottom: 8px;
  left: 50%;
  translate: -50% 0;
  display: flex;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 16px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.dock__item {
  display: block;
  padding: 0;
  border: 0;
  background: none;
}

.dock__item img,
.dock__item svg { display: block; width: var(--icon-size); height: var(--icon-size); }

.dock__item--phone { display: none; }

/* Grow from the bottom edge, like the macOS dock, without shifting neighbours. */
button.dock__item,
a.dock__item {
  cursor: pointer;
  transform-origin: 50% 100%;
  transition: transform 0.15s ease;
}

button.dock__item:focus-visible,
a.dock__item:focus-visible { transform: scale(1.1667); } /* 48px → 56px */

/* Only on real pointers; on touch, a tap would leave the icon stuck enlarged. */
@media (hover: hover) {
  button.dock__item:hover,
  a.dock__item:hover { transform: scale(1.1667); }
}

/* Responsive */

@media (max-width: 1100px) {
  .window { left: 40px; width: calc(100vw - 160px); }
}

@media (max-width: 760px) {
  /*
   * Phone spacing: a 16px gutter around everything, a compact dock floating
   * 16px above the bottom edge, and 16px between the window and the dock.
   * Dock height = icon 36 + padding 2×8 + border 2 = 54px.
   */
  :root {
    --icon-size: 36px;
    --gutter: 16px;
    --dock-height: 54px;
    --dock-bottom: calc(var(--gutter) + env(safe-area-inset-bottom, 0px));
  }

  body { background-attachment: scroll; }
  .rail { display: none; }

  /* Phones get floating sheets: no moving or resizing. */
  .window,
  .testimonials {
    position: fixed;
    top: calc(var(--gutter) + env(safe-area-inset-top, 0px)) !important;
    left: var(--gutter) !important;
    right: var(--gutter);
    bottom: calc(var(--dock-bottom) + var(--dock-height) + var(--gutter));
    width: auto !important;
    height: auto !important;
    overflow-y: auto;
    border-radius: 14px;
  }

  .resize { display: none; }
  .window__bar,
  .testimonials__head { cursor: auto; touch-action: auto; }

  .dock {
    bottom: var(--dock-bottom);
    gap: 8px;
    padding: 8px;
    border-radius: 16px;
  }

  .dock__item--phone { display: block; }

  .window--hello { padding: 16px 16px 32px; gap: 28px; }
  .window--hello .window__body { padding: 0 4px; gap: 28px; }
  .headline { font-size: 30px; line-height: 36px; }
  .facts { flex-direction: column; gap: 24px; }
  .stats { width: auto; }

  .job { padding: 12px 16px; }
  .job + .job::before { left: 16px; right: 16px; }
  .job__head { flex-direction: column; gap: 4px; }

  .testimonials::before,
  .testimonials::after { display: none; }
  .testimonials__card { min-height: 100%; }
}
