:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --menu-height: 30px;
  --dock-size: 60px;
  --dock-gap: 8px;
  --gaelic-green: #2d835b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: #000;
  color: #fff;
  overflow: hidden;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.desktop {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: #000;
}

.desktop::before,
.desktop::after {
  display: none;
}

.menu-bar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--menu-height);
  padding: 0 15px;
  color: #1c1c1c;
  background: linear-gradient(180deg, #eeeeee 0%, #c7c7c7 100%);
  border-bottom: 1px solid #8d8d8d;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.8),
    0 1px 4px rgba(0, 0, 0, 0.45);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  user-select: none;
}

.menu-bar__left,
.menu-bar__right {
  display: flex;
  align-items: center;
  gap: 21px;
  height: 100%;
}

.menu-bar a {
  color: inherit;
  text-decoration: none;
}

.menu-bar__name {
  font-weight: 700;
}

.menu-bar__name:hover {
  color: var(--gaelic-green);
}

.menu-bar__right {
  gap: 13px;
  font-weight: 600;
}

.desktop-content {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100svh - var(--menu-height));
  padding: 3rem 10vw 9rem;
}

.welcome-copy {
  width: min(760px, 100%);
  color: var(--gaelic-green);
  font-family: "Press Start 2P", monospace;
  text-align: center;
  text-shadow: 0 2px 30px rgba(24, 11, 73, 0.26);
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--gaelic-green);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4.8vw, 4.6rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 1.12;
}

h1 span {
  color: var(--gaelic-green);
}

.intro {
  margin: 27px auto 0;
  color: var(--gaelic-green);
  font-size: clamp(0.62rem, 0.9vw, 0.78rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.9;
}

.window-layer {
  position: fixed;
  z-index: 30;
  inset: var(--menu-height) 0 0;
  overflow: hidden;
  pointer-events: none;
}

.app-window {
  position: absolute;
  display: flex;
  flex-direction: column;
  width: min(760px, calc(100vw - 40px));
  height: min(500px, calc(100svh - 150px));
  min-width: 320px;
  min-height: 260px;
  color: #242424;
  background: rgba(244, 244, 244, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.32);
  border-radius: 12px;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.55),
    0 3px 12px rgba(0, 0, 0, 0.4),
    inset 0 1px rgba(255, 255, 255, 0.9);
  overflow: hidden;
  pointer-events: auto;
  transform-origin: 50% 100%;
  transition: opacity 180ms ease, transform 180ms ease;
}

.app-window.is-opening {
  opacity: 0;
  transform: translateY(24px) scale(0.92);
}

.app-window.is-minimized {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(55vh) scale(0.08);
}

.app-window.is-maximized {
  inset: 8px 10px 104px !important;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  border-radius: 10px;
}

.app-window:not(.is-active) {
  filter: saturate(0.82) brightness(0.96);
}

.window-titlebar {
  position: relative;
  display: flex;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;
  padding: 0 74px;
  background: linear-gradient(180deg, #f5f5f5 0%, #d8d8d8 100%);
  border-bottom: 1px solid #b1b1b1;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.9);
  cursor: default;
  user-select: none;
  touch-action: none;
}

.window-title {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.window-controls {
  position: absolute;
  left: 14px;
  display: flex;
  gap: 8px;
}

.window-control {
  position: relative;
  width: 13px;
  height: 13px;
  padding: 0;
  background: #aaa;
  border: 0.5px solid rgba(0, 0, 0, 0.18);
  border-radius: 50%;
  box-shadow: inset 0 0.5px rgba(255, 255, 255, 0.45);
  cursor: default;
}

.window-control--close {
  background: #ff5f57;
}

.window-control--minimize {
  background: #febc2e;
}

.window-control--maximize {
  background: #28c840;
}

.window-controls:hover .window-control::before,
.window-controls:hover .window-control::after {
  position: absolute;
  top: 50%;
  left: 50%;
  content: "";
  background: rgba(59, 38, 28, 0.72);
  transform: translate(-50%, -50%);
}

.window-controls:hover .window-control--close::before,
.window-controls:hover .window-control--close::after {
  width: 7px;
  height: 1px;
}

.window-controls:hover .window-control--close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.window-controls:hover .window-control--close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.window-controls:hover .window-control--minimize::before {
  width: 7px;
  height: 1px;
}

.window-controls:hover .window-control--maximize::before {
  width: 6px;
  height: 6px;
  background: none;
  border: 1px solid rgba(26, 79, 34, 0.78);
}

.window-body {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-columns: 180px 1fr;
  background: #fff;
}

.window-sidebar {
  padding: 18px 12px;
  background: rgba(228, 228, 228, 0.92);
  border-right: 1px solid #c8c8c8;
}

.window-sidebar-title {
  margin: 0 8px 9px;
  color: #737373;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.window-sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 29px;
  padding: 5px 9px;
  color: #303030;
  border-radius: 6px;
  font-size: 13px;
}

.window-sidebar-item.is-selected {
  color: #fff;
  background: #0a84ff;
}

.sidebar-symbol {
  width: 17px;
  color: #0a84ff;
  font-size: 15px;
  text-align: center;
}

.window-sidebar-item.is-selected .sidebar-symbol {
  color: inherit;
}

.window-content {
  min-width: 0;
  padding: clamp(24px, 5vw, 54px);
  overflow: auto;
}

.window-content h2 {
  margin: 0 0 12px;
  color: #1f1f1f;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  letter-spacing: -0.045em;
}

.window-content p {
  max-width: 570px;
  margin: 0 0 16px;
  color: #626262;
  font-size: 15px;
  line-height: 1.6;
}

.window-empty-state {
  display: grid;
  min-height: 100%;
  color: #777;
  text-align: center;
  place-content: center;
}

.window-empty-icon {
  display: block;
  margin-bottom: 14px;
  color: #9c9c9c;
  font-size: 44px;
}

.window-empty-state strong {
  display: block;
  margin-bottom: 7px;
  color: #333;
  font-size: 17px;
}

.window-empty-state span {
  max-width: 360px;
  font-size: 13px;
  line-height: 1.5;
}

.window-card {
  max-width: 520px;
  margin-top: 26px;
  padding: 20px;
  background: #f4f4f4;
  border: 1px solid #dedede;
  border-radius: 12px;
}

.window-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.window-card span {
  color: #6f6f6f;
  font-size: 13px;
  line-height: 1.5;
}

.mobile-title {
  display: none;
}

.blog-loading { color: #777; }
.blog-list { display: grid; gap: 14px; }
.blog-card { width: 100%; padding: 22px; border: 1px solid rgba(64,52,111,.14); border-radius: 14px; background: rgba(255,255,255,.75); color: inherit; text-align: left; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.blog-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(40,32,77,.1); }
.blog-card time,.blog-article time { color: #77718c; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.blog-card h2 { margin: 7px 0 6px; }
.blog-card p { margin: 0 0 12px; color: #625d6e; }
.blog-card>span { color: #5943bd; font-size: 13px; font-weight: 700; }
.blog-article { max-width: 720px; margin: 0 auto; line-height: 1.7; }
.blog-article h1 { margin: 8px 0 24px; font-size: clamp(30px,5vw,48px); line-height: 1.12; }
.blog-article h2 { margin-top: 28px; }
.blog-article p { color: #403b49; }
.blog-article code { padding: 2px 5px; border-radius: 4px; background: #eeeaf6; }
.blog-back { display: block; margin: 0 0 24px; padding: 0; border: 0; background: none; color: #5943bd; font: inherit; font-weight: 700; cursor: pointer; }

.dock-wrap {
  position: fixed;
  z-index: 50;
  bottom: 10px;
  left: 50%;
  display: flex;
  align-items: flex-end;
  height: 128px;
  max-width: calc(100vw - 20px);
  transform: translateX(-50%);
}

.dock {
  display: flex;
  align-items: flex-end;
  gap: var(--dock-gap);
  height: 78px;
  padding: 8px 11px 10px;
  background: linear-gradient(180deg, rgba(247, 244, 255, 0.43), rgba(220, 213, 241, 0.3));
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 22px;
  box-shadow:
    0 18px 40px rgba(25, 13, 65, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
  -webkit-backdrop-filter: saturate(145%) blur(28px);
  backdrop-filter: saturate(145%) blur(28px);
  user-select: none;
}

.dock-item {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: var(--dock-size);
  height: var(--dock-size);
  color: #fff;
  text-decoration: none;
  transform-origin: 50% 100%;
  will-change: width, height, transform;
  place-items: center;
}

.app-icon {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 13px;
  filter: drop-shadow(0 5px 6px rgba(23, 13, 56, 0.28));
  overflow: hidden;
  transform: translateZ(0);
}

.app-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.dock-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  width: max-content;
  max-width: 180px;
  padding: 5px 10px 6px;
  color: #1c1630;
  background: rgba(249, 247, 255, 0.91);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 7px;
  box-shadow: 0 4px 16px rgba(20, 12, 50, 0.25);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 5px) scale(0.96);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: nowrap;
}

.dock-item:hover .dock-tooltip,
.dock-item:focus-visible .dock-tooltip {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.dock-item:focus-visible {
  outline: none;
}

.dock-item:focus-visible .app-icon {
  outline: 3px solid rgba(255, 255, 255, 0.95);
  outline-offset: 3px;
}

.active-dot {
  position: absolute;
  bottom: -7px;
  left: 50%;
  width: 4px;
  height: 4px;
  background: rgba(37, 27, 54, 0.72);
  border-radius: 50%;
  opacity: 0;
  transform: translateX(-50%);
}

.dock-item.is-open .active-dot {
  opacity: 1;
}

.dock-divider {
  align-self: stretch;
  width: 1px;
  margin: 3px 1px 1px 3px;
  background: rgba(73, 60, 103, 0.3);
  box-shadow: 1px 0 rgba(255, 255, 255, 0.3);
}

.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;
}

/* Tablet and phone home screen */
@media (max-width: 900px) {
  :root {
    --dock-size: clamp(64px, 12vw, 84px);
    --dock-gap: clamp(22px, 5vw, 46px);
  }

  .menu-bar {
    padding-inline: 11px;
  }

  .menu-bar__left {
    gap: 14px;
  }

  .menu-bar__right {
    gap: 0;
  }

  .desktop-content {
    display: block;
    min-height: 0;
    padding: clamp(48px, 9svh, 88px) 24px 0;
  }

  .welcome-copy {
    width: 100%;
  }

  .eyebrow {
    margin: 0;
    font-size: clamp(1.05rem, 3.2vw, 1.55rem);
    letter-spacing: 0.16em;
    text-transform: none;
  }

  .desktop-title {
    display: none;
  }

  .mobile-title {
    display: inline;
  }

  .welcome-copy h4,
  .welcome-copy .intro {
    display: none;
  }

  .app-window,
  .app-window.is-maximized {
    inset: 8px 8px 88px !important;
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    border-radius: 10px;
  }

  .window-body {
    display: block;
  }

  .window-sidebar {
    display: none;
  }

  .window-content {
    height: 100%;
    padding: 28px 22px;
  }

  h1 {
    font-size: clamp(1.6rem, 7.8vw, 2.7rem);
    line-height: 1.25;
  }

  .intro br {
    display: none;
  }

  .dock-wrap {
    position: absolute;
    inset: clamp(126px, 21svh, 190px) 0 auto;
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
    padding: 0 clamp(22px, 7vw, 70px) calc(28px + env(safe-area-inset-bottom));
    overflow-y: auto;
    transform: none;
    transition: opacity 160ms ease, visibility 160ms ease;
  }

  body.has-active-window .dock-wrap,
  body.has-active-window .desktop-content {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }

  .dock {
    display: grid;
    width: min(100%, 650px);
    height: auto;
    margin: 0 auto;
    padding: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--dock-gap) clamp(14px, 5vw, 48px);
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .dock-item {
    width: var(--dock-size) !important;
    height: calc(var(--dock-size) + 24px) !important;
    justify-self: center;
    align-content: start;
    transform: none !important;
  }

  .app-icon {
    width: var(--dock-size);
    height: var(--dock-size);
    border-radius: clamp(14px, 2.5vw, 19px);
    filter: drop-shadow(0 7px 8px rgba(0, 0, 0, 0.32));
  }

  .dock-tooltip {
    position: static;
    display: block;
    width: max-content;
    max-width: 120px;
    margin-top: 8px;
    padding: 0;
    overflow: hidden;
    color: var(--gaelic-green);
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font-family: "Press Start 2P", monospace;
    font-size: clamp(0.43rem, 1.4vw, 0.58rem);
    line-height: 1.35;
    opacity: 1;
    transform: none;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .active-dot {
    bottom: 17px;
    background: var(--gaelic-green);
  }

  .dock-divider {
    display: none;
  }
}

@media (max-width: 600px) {
  :root {
    --dock-size: clamp(58px, 17vw, 72px);
    --dock-gap: clamp(22px, 5svh, 38px);
  }

  .menu-bar {
    height: 29px;
    font-size: 11px;
  }

  .desktop-content {
    padding-top: clamp(38px, 7svh, 62px);
  }

  .eyebrow {
    font-size: clamp(0.9rem, 4.2vw, 1.15rem);
  }

  .dock-wrap {
    inset-block-start: clamp(105px, 17svh, 142px);
    padding-inline: clamp(12px, 4vw, 24px);
  }

  .dock {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: clamp(4px, 2vw, 14px);
  }

  .dock-tooltip {
    max-width: 100px;
    font-size: clamp(0.4rem, 1.8vw, 0.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
