/* ==========================================================================
   Alexander Arutiunian.info — Static Recreation of WordPress Twenty Seventeen
   ========================================================================== */

:root {
  --bg: #ffffff;
  --surface: #fafafa;
  --text: #333333;
  --text-heading: #222222;
  --text-muted: #666666;
  --border: #eeeeee;
  --border-strong: #dddddd;
  --link: #222222;
  --link-hover: #000000;
  --focus-ring: #222222;
  --wrap-max: 62.5rem; /* 1000px — Twenty Seventeen wrap */
  --content-max: 46.25rem; /* 740px — Twenty Seventeen one-column content */
  --font-sans: "Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.66;
  -webkit-font-smoothing: antialiased;
}

/* Skip link */
.skip-link {
  position: absolute;
  inset-block-start: -100%;
  inset-inline-start: 1rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--text-heading);
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0.25rem;
}

.skip-link:focus {
  inset-block-start: 1rem;
}

/* Accessible focus rings */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Shared container */
.wrap {
  inline-size: min(100% - 3rem, var(--wrap-max));
  margin-inline: auto;
}

.wrap--narrow {
  inline-size: min(100% - 3rem, var(--content-max));
  margin-inline: auto;
}

/* ==========================================================================
   Hero Header (Twenty Seventeen custom-header)
   ========================================================================== */

.hero-banner {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-block-size: clamp(13rem, 28dvh, 19rem);
  overflow: hidden;
  background-color: #1f1f1f;
  color: #ffffff;
}

.is-home .hero-banner {
  min-block-size: clamp(22rem, 68dvh, 42rem);
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  object-position: center 28%;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.05) 0%,
    rgba(0, 0, 0, 0.25) 60%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

.site-branding {
  position: relative;
  z-index: 1;
  padding-block: clamp(1.75rem, 4dvh, 3.25rem);
}

.site-title {
  margin: 0;
  font-size: clamp(1.375rem, 1rem + 1.8vw, 2.25rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.site-title a {
  color: #ffffff;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.site-title a:hover,
.site-title a:focus-visible {
  opacity: 0.85;
}

.site-title a:focus-visible {
  outline-color: #ffffff;
}

/* ==========================================================================
   Sticky Top Navigation Bar (Modern Popover + Anchor Positioning + Inline)
   ========================================================================== */

.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 20;
  background-color: var(--bg);
  border-block-end: 1px solid var(--border);
}

.site-header.is-measuring * {
  transition: none !important;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-block-size: 3.75rem;
}

/* Keep the row's natural width measurable */
.header-inner > * {
  flex-shrink: 0;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  inline-size: 100%;
  justify-content: flex-start;
}

.menu-button {
  anchor-name: --menu-button;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.25rem;
  background: var(--bg);
  color: var(--text-heading);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.menu-button:hover {
  background: var(--surface);
}

.menu-icon {
  inline-size: 1.125rem;
  block-size: 1.125rem;
  flex-shrink: 0;
}

/* Collapsed popover navigation */
.site-menu {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  position: fixed;
  inset: auto;
  /* Fallback offset for browsers without CSS Anchor Positioning */
  inset-block-start: 4rem;
  inset-block-start: anchor(--menu-button bottom);
  inset-inline-start: 1.5rem;
  inline-size: min(85dvw, 22rem);
  max-inline-size: calc(100dvw - 2rem);
  block-size: fit-content;
  max-block-size: calc(100dvh - 6rem);
  margin-block-start: 0.5rem;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 0.375rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

.site-menu[popover]:not(:is(:popover-open, .\:popover-open)) {
  display: none;
}

.site-menu[popover]:is(:popover-open, .\:popover-open) {
  display: block;
}

.site-menu a {
  display: block;
  padding: 0.75rem 1.25rem;
  color: var(--text-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border-inline-start: 3px solid transparent;
}

.site-menu a:hover {
  background: var(--surface);
  color: var(--link-hover);
}

.site-menu a[aria-current="page"] {
  color: var(--text-heading);
  font-weight: 700;
  border-inline-start-color: var(--text-heading);
  background: var(--surface);
}

/* Wide inline navigation */
.site-header.is-wide .menu-button {
  display: none;
}

.site-header.is-wide .site-menu {
  position: static;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  inline-size: auto;
  max-inline-size: none;
  block-size: auto;
  max-block-size: none;
  overflow: visible;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.site-header.is-wide .site-menu::backdrop {
  display: none;
}

.site-header.is-wide .site-menu a {
  padding: 1.125rem 1rem;
  font-size: 0.875rem;
  border-inline-start: 0;
  border-block-end: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.site-header.is-wide .site-menu li:first-child a {
  padding-inline-start: 0;
}

.site-header.is-wide .site-menu a:hover {
  background: transparent;
  color: var(--text-muted);
}

.site-header.is-wide .site-menu a[aria-current="page"] {
  background: transparent;
  color: var(--text-heading);
  border-block-end-color: var(--text-heading);
}

/* Scroll-down cue on home page */
.scroll-down-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  margin-inline-start: auto;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.scroll-down-link:hover {
  color: var(--text-heading);
}

.scroll-down-link svg {
  inline-size: 1.125rem;
  block-size: 1.125rem;
}

/* ==========================================================================
   Main Content (Twenty Seventeen one-column typography)
   ========================================================================== */

.site-main {
  padding-block: clamp(2.5rem, 6dvh, 4.5rem) clamp(3.5rem, 8dvh, 5.5rem);
}

.entry-header {
  margin-block-end: 2rem;
}

.entry-meta {
  margin-block-end: 0.625rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.entry-title {
  margin: 0;
  color: var(--text-heading);
  font-size: clamp(1.375rem, 1.1rem + 0.9vw, 1.75rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.entry-content h2 {
  margin-block: 2.5rem 1rem;
  color: var(--text-heading);
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  font-weight: 400;
  line-height: 1.35;
}

.entry-content h2:first-child {
  margin-block-start: 0;
}

.entry-content p {
  margin-block: 0 1.5rem;
}

.entry-content a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: #767676;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.entry-content a:hover {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
  text-decoration-thickness: 2px;
}

.entry-content strong {
  color: var(--text-heading);
  font-weight: 700;
}

.work-item {
  margin-block-end: 2.25rem;
}

.work-title {
  margin-block: 0 0.75rem;
  color: var(--text-heading);
  font-weight: 700;
}

.work-caption {
  margin-block: 0.625rem 0;
  color: var(--text);
}

.movements {
  margin-block: 0 1.25rem;
  padding-inline-start: 0;
  list-style: none;
}

/* Responsive YouTube embeds with zero CLS */
.video-embed {
  position: relative;
  inline-size: 100%;
  aspect-ratio: 16 / 9;
  margin-block: 0.75rem;
  background-color: #111111;
  border-radius: 0.125rem;
  overflow: hidden;
}

.video-embed--4x3 {
  aspect-ratio: 4 / 3;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  border: 0;
}

.pdf-link {
  font-weight: 600;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-block-start: 1px solid var(--border);
  padding-block: 2rem 2.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.site-footer a:hover {
  color: var(--text-heading);
}

/* ==========================================================================
   Forced Colors / High Contrast Mode
   ========================================================================== */

@media (forced-colors: active) {
  .site-header {
    border-block-end: 1px solid CanvasText;
  }

  .site-menu {
    border: 1px solid CanvasText;
  }

  .site-menu a[aria-current="page"] {
    border-color: Highlight;
  }

  .menu-button {
    border: 1px solid ButtonText;
  }
}
