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

:root {
  --white: ghostwhite;
  --black: #000000;
  --bg: var(--white);
  --fg: var(--black);
  --primary-red: #ff6b6b;
  --primary-blue: #00f;
  --primary-grey: #262626;
  --secondary-grey: #666666;
  --tertiary-grey: #8f8f8f;
  --sidebar-width: clamp(12rem, 18vw, 20rem);
}

/* ==========================================================================
   Global Elements
   ========================================================================== */

html {
  overflow-x: hidden;
}

body {
  position: relative;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: auto 1fr;
  align-items: start;
  font-size: 0.8rem;
  margin: 0.5rem;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  font-family: "Actosk", sans-serif;
  overflow-x: hidden;
  max-width: 100vw;
}

body.home {
  overflow: hidden;
}

a {
  color: var(--primary-grey);
  text-decoration: none;
}

a:hover {
  color: var(--tertiary-grey);
}

.header,
.header__nav {
  position: sticky;
  top: 0;
  z-index: 10;
  font-weight: 300;
  white-space: nowrap;
  color: var(--primary-grey);
  cursor: default;
}

.header {
  grid-column: 1;
  grid-row: 1;
}

.header__about {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  z-index: 10;
  font-weight: 300;
  color: var(--primary-grey);
  cursor: default;
}

.header__name {
  font-weight: 400;
}

.header__contact {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.header__nav {
  grid-column: 2;
  grid-row: 1;
}

.header__nav-list {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2rem;
}

.header__nav-list li {
  list-style: none;
}

.content {
  grid-column: 2;
  grid-row: 2;
  margin-top: 2.5rem;
}

/* ==========================================================================
   About Panel (revealed in place of .header__contact — see js/script.js)
   ========================================================================== */

.header__about {
  max-width: 14rem;
  line-height: 1.5;
  white-space: normal;
}

.header__about .header__about-intro {
  margin-bottom: 1rem;
}

.header__about .header__about-links {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* ==========================================================================
   Glyph Editor (index.html hero — interactive point editor, js/script.js)
   ========================================================================== */

.hero__editor {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

svg#canvas {
  background: var(--bg);
  cursor: crosshair;
  touch-action: none;
}

.hero__glyph-fill {
  fill: var(--fg);
  fill-rule: evenodd;
}

.hero__handle-line {
  stroke: var(--tertiary-grey);
  stroke-width: 1;
  pointer-events: none;
  opacity: 0.6;
}

/* on-curve point (square) */

.hero__point--oncurve {
  fill: var(--tertiary-grey);
  stroke: var(--secondary-grey);
  stroke-width: 1;
  cursor: move;
}

.hero__point--oncurve:hover {
  fill: var(--secondary-grey);
  stroke: var(--tertiary-grey);
}

/* off-curve point (circle) */

.hero__point--offcurve {
  fill: transparent;
  stroke: var(--tertiary-grey);
  stroke-width: 1;
  cursor: move;
}

.hero__point--offcurve:hover {
  fill: var(--tertiary-grey);
  stroke: var(--secondary-grey);
}

.hero__point--selected {
  fill: var(--primary-red) !important;
  stroke: var(--fg) !important;
}

/* ==========================================================================
   Access Gate (js/access-gate.js) — pre-launch password prompt for pages
   not ready for public viewing. See the comment at the top of that file for
   what this can and can't actually protect.
   ========================================================================== */

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.access-gate__form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.access-gate__form input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-family: "Actosk", sans-serif;
  font-weight: 300;
  font-size: max(0.9rem, 16px);
  width: 14rem;
  padding: 0 0 0.4rem;
  border: none;
  border-bottom: 1px solid var(--fg);
  border-radius: 0;
  background: none;
  color: var(--fg);
  text-align: center;
  box-shadow: none;
}

.access-gate__form input:focus {
  outline: none;
  border-bottom-color: var(--tertiary-grey);
}

.access-gate__form input::placeholder {
  color: var(--tertiary-grey);
  opacity: 1;
}

.access-gate__form button {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-family: "Actosk", sans-serif;
  font-weight: 300;
  font-size: 0.8rem;
  background: none;
  border: none;
  border-radius: 0;
  color: var(--fg);
  cursor: pointer;
}

.access-gate__form button:hover {
  color: var(--tertiary-grey);
}

.access-gate__error {
  font-size: 0.75rem;
  color: var(--tertiary-grey);
}

@media (max-width: 768px) {
  body {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .header,
  .header__nav,
  .header__about {
    font-size: 0.8rem;
    top: 0.5rem;
    grid-column: 1;
    grid-row: 1;
  }

  .header,
  .header__about {
    justify-self: start;
    margin-left: 0.5rem;
  }

  .header__nav {
    justify-self: end;
    margin-right: 0.5rem;
  }

  .header__about {
    max-width: calc(100vw - 7rem);
  }

  .header__nav-list {
    gap: 1rem;
    flex-direction: column;
    align-items: flex-end;
  }

  .header__about-links a {
    margin-bottom: 0.5rem;
  }

  .content {
    grid-column: 1;
    grid-row: 2;
    margin-top: 6rem;
    padding: 0 0.5rem;
    max-width: 100vw;
  }
}
