@font-face {
  font-family: Manrope;
  src: url("/assets/fonts/manrope.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans Armenian";
  src: url("/assets/fonts/noto-sans-armenian.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #f5f2e9;
  --work: #e8e4d9;
  --ink: #251e27;
  --muted: #59535a;
  --line: #c9c2bb;
  --accent: #84433b;
  --studio: #221e26;
  --studio-line: #5d535d;
  --on-studio: #f6f1e7;
  --phosphor: #ffbd8e;
  --gutter: clamp(1.25rem, 5.3vw, 5.5rem);
  --sans: Manrope, "Noto Sans Armenian", Arial, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, "Noto Sans Armenian", monospace;
  /* Menlo has no Armenian glyphs, so Armenian labels use the text face. */
  --label: var(--mono);
}
html:lang(hy) { --sans: "Noto Sans Armenian", Manrope, Arial, sans-serif; --label: var(--sans); }

/* Base */
* { box-sizing: border-box; }
html { scroll-padding-block-start: 1rem; }
body { margin: 0; background: var(--studio); color: var(--ink); font: 400 1rem/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, figure, dl, dd, ul { margin: 0; }
ul { list-style: none; padding: 0; }
address { font-style: normal; }
a { color: inherit; text-underline-offset: .22em; }
a:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, dt, dd, p { overflow-wrap: break-word; }
h1, h2, h3, .service dt { text-wrap: balance; }
.lead, .services-intro p, .service dd, .projects p, .company-record dd, .error-text { text-wrap: pretty; }
::selection { background: #ffc7a1; color: #251c26; }
main:focus { outline: none; }
.shell { width: min(calc(100% - 2 * var(--gutter)), 90rem); margin-inline: auto; }

.skip {
  position: fixed; top: .75rem; left: var(--gutter); z-index: 10;
  max-width: calc(100% - 2 * var(--gutter)); padding: .6rem 1rem;
  background: #fff; color: #101010; transform: translateY(-210%);
}
.skip:focus { transform: none; }
.skip:focus-visible { outline-color: var(--phosphor); outline-offset: 2px; }

/* Masthead */
.masthead {
  display: flex; align-items: center; gap: clamp(1rem, 4vw, 4rem);
  min-height: 5rem; padding-block: 1.25rem;
  color: var(--on-studio); border-bottom: 1px solid var(--studio-line);
}
.brand { display: inline-flex; align-items: center; min-height: 2.75rem; flex-shrink: 0; }
.brand img { width: 10rem; filter: invert(1); }
.main-nav, .languages { display: flex; align-items: center; font: 500 .88rem/1.35 var(--label); }
.main-nav { margin-left: auto; gap: clamp(1rem, 2.7vw, 2.6rem); }
.languages { gap: .6rem; font-family: var(--mono); }
.masthead nav a { display: inline-flex; min-height: 2.75rem; align-items: center; text-decoration: none; }
.masthead nav a:hover { text-decoration: underline; color: var(--phosphor); }
.masthead .languages [aria-current] { text-decoration: underline; text-underline-offset: .3em; }

/* Hero */
.hero { color: var(--on-studio); padding: clamp(2.3rem, 4.3vw, 4.8rem) 0 clamp(2rem, 3.5vw, 3.5rem); }
.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, .85fr);
  column-gap: clamp(1.8rem, 5.7vw, 6rem);
  align-items: start;
}
.hero h1 {
  grid-row: span 2;
  max-width: 17ch;
  font-size: clamp(3.6rem, 5.9vw, 6.3rem);
  line-height: .99;
  letter-spacing: -.052em;
  font-weight: 510;
}
.lead { max-width: 43ch; color: #e0dadd; font-size: clamp(1.05rem, 1.35vw, 1.4rem); line-height: 1.5; }
.actions { margin-top: 1.5rem; }
.button {
  display: inline-flex; align-items: center; min-height: 2.75rem;
  padding: .7rem 1.3rem; border-radius: 2px;
  background: var(--phosphor); color: var(--studio);
  font-weight: 680; text-decoration: none;
}
.button:hover { background: #fff; }
.button:focus-visible { outline-color: var(--phosphor); }
.hero-art { margin-block-start: clamp(2rem, 3.2vw, 3.5rem); }

/* Paper sections */
.services, .company, .footer {
  background: var(--paper);
  width: 100%;
  padding-inline: max(var(--gutter), calc((100% - 90rem) / 2));
}
.services { padding-block: clamp(2.8rem, 4.8vw, 5.5rem); }
h2 { font-weight: 530; font-size: clamp(2.15rem, 3.45vw, 3.9rem); line-height: 1.08; letter-spacing: -.047em; }
.services-intro p { max-width: 49ch; margin-top: 1rem; color: var(--muted); }
.service-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  /* Each service spans a title row and a text row, so texts start on one line. */
  grid-template-rows: auto auto;
  row-gap: .75rem;
  margin-top: clamp(1.7rem, 2.7vw, 3rem);
  padding-top: 1.65rem;
  border-top: 1px solid var(--ink);
}
.service {
  display: grid; grid-template-rows: subgrid; grid-row: span 2;
  padding-inline: clamp(1rem, 2vw, 2.3rem); border-left: 1px solid var(--line);
}
.service:first-child { padding-left: 0; border: none; }
.service:last-child { padding-right: 0; }
.service dt, .projects h3 { font-size: clamp(1.25rem, 1.59vw, 1.75rem); letter-spacing: -.027em; font-weight: 645; line-height: 1.22; }
.service dd, .projects p, .note { color: var(--muted); }

.work { background: var(--work); padding-block: clamp(2.8rem, 4.5vw, 5rem); }
.work .shell { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.8fr); column-gap: clamp(2rem, 4vw, 4.5rem); }
.projects li {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.15fr);
  gap: .5rem 1.8rem;
  align-items: baseline;
  padding-block: 1.2rem;
  border-top: 1px solid #b2abb0;
}
.projects li:first-child { border: 0; padding-top: .15rem; }
.projects li:last-child { border-bottom: 1px solid #b2abb0; }
.note { grid-column: 2; margin-top: .9rem; font-size: .88rem; }

/* Contact and company details */
.contact-sheet { position: relative; isolation: isolate; background: var(--paper); }
.contact-sheet::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: url("/assets/harmonics/selvedge.svg") repeat right top / clamp(8rem, 13vw, 12rem) auto;
  opacity: .11;
  mask-image: linear-gradient(105deg, rgb(0 0 0 / .13), rgb(0 0 0 / .38) 43%, black 92%);
}
.contact-sheet .company { background: transparent; }
.contact { padding-block: clamp(3rem, 5vw, 5.5rem) 2.5rem; }
.contact .shell { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.8fr); gap: clamp(2rem, 4vw, 4.5rem); }
.details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.85rem 2rem; }
.details > p { display: grid; justify-items: start; align-content: start; }
.detail-label, .company-record dt { font: .9rem/1.45 var(--label); color: var(--muted); }
.detail-label { margin-bottom: .15rem; }
.details a {
  display: inline-flex; align-items: center; min-height: 2.75rem;
  font-size: clamp(1.1rem, 1.45vw, 1.55rem); font-weight: 590; overflow-wrap: anywhere;
}
.details a:hover { color: var(--accent); }
.small { font-size: .88rem; color: var(--muted); }
.details > p:last-child {
  grid-column: 1 / -1;
  justify-self: start;
  padding-left: .95rem;
  border-left: 2px solid var(--accent);
}
.details > p:last-child .detail-label { margin-bottom: .4rem; }
.company { padding-block: 1.3rem 2.5rem; }
.company h2 { padding-top: 1.6rem; border-top: 1px solid var(--line); font-size: 1.4rem; letter-spacing: -.02em; }
.company-record {
  margin-top: 1.1rem; display: grid; gap: 0 1.4rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, .62fr) minmax(0, 1.4fr);
  /* Labels share one row and values another, whatever their line count. */
  grid-template-rows: auto auto;
}
.company-record > div { display: grid; grid-template-rows: subgrid; grid-row: span 2; row-gap: .4rem; }
.company-record dd { font-variant-numeric: tabular-nums; }

.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
  padding-block: 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem;
}
.footer a { display: inline-flex; align-items: center; min-height: 1.5rem; }
.footer a:hover { color: var(--accent); }

/* 404 */
.error-page { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; color: var(--on-studio); }
.error { flex: 1; padding-block: clamp(4rem, 8vw, 8rem); }
.error-code { font-family: var(--mono); color: var(--phosphor); }
.error h1 { font-size: clamp(2.5rem, 4vw, 5rem); line-height: 1.1; margin: .5rem 0 1rem; font-weight: 530; letter-spacing: -.047em; }
.error-text { max-width: 43ch; margin-bottom: 1.75rem; color: #e0dadd; }
.error-page .footer { background: transparent; border-top-color: var(--studio-line); color: #c9c0c6; }
.error-page .footer a:hover { color: var(--phosphor); }

/* Armenian setting: Noto Sans Armenian needs looser tracking and taller lines than Manrope. */
html:lang(hy) .hero h1 { font-size: clamp(3.1rem, 4.8vw, 5.6rem); line-height: 1.12; letter-spacing: -.02em; }
html:lang(hy) h2 { letter-spacing: -.025em; }
html:lang(hy) .error h1 { letter-spacing: -.02em; }
/* Long Armenian words must fit the narrow heading column whole. */
html:lang(hy) :is(.work, .contact) h2 { font-size: clamp(1.6rem, 2.6vw, 3rem); }
html:lang(hy) h2, html:lang(hy) .projects h3, html:lang(hy) .service dt { line-height: 1.34; }
html:lang(hy) .projects h3, html:lang(hy) .service dt { letter-spacing: -.01em; }
html:lang(hy) .detail-label, html:lang(hy) .company-record dt { letter-spacing: .01em; }

/* Harmonics: the fine traces recede towards the middle of the sum; all use the same scale. */
.harmonic-plot {
  display: block;
  width: 100%;
  height: clamp(9rem, 17.5vw, 16rem);
  border-block: 1px solid #4d444e;
}
.harmonic-guides { stroke: #413941; stroke-width: 1; }
.harmonic-part { stroke: #b997a7; stroke-width: 1; stroke-dasharray: 2 4; }
.harmonic-part:nth-child(2n) { stroke: #a8b8b8; }
.harmonic-part:nth-child(n+4) { opacity: .5; }
.harmonic-output { stroke: #ffdaa5; stroke-width: 2.6; }

@media (max-width: 1080px) {
  .service-list { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto auto auto; }
  .service:nth-child(odd) { padding-left: 0; border-left: 0; }
  .service:nth-child(even) { padding-right: 0; }
  .service:nth-child(n+3) { margin-top: 1.25rem; }
  .work .shell, .contact .shell { grid-template-columns: minmax(0, .66fr) minmax(0, 1.75fr); gap: 1.5rem; }
  .company-record { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto auto auto; row-gap: 0; }
  .company-record > div:nth-child(n+3) { margin-top: 1.1rem; }
}
@media (max-width: 790px) {
  .masthead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 1rem; padding-block: .6rem .35rem; }
  .brand { grid-area: 1 / 1; justify-self: start; }
  .languages { grid-area: 1 / 2; }
  .main-nav { grid-column: 1 / -1; grid-row: 2; margin-left: 0; flex-wrap: wrap; gap: 0 clamp(.75rem, 3.6vw, 1.4rem); }
  .intro { grid-template-columns: minmax(0, 1.1fr) minmax(0, .85fr); column-gap: 1.5rem; }
  .hero h1 { font-size: clamp(2.8rem, 6.7vw, 3.6rem); }
  html:lang(hy) .hero h1 { font-size: clamp(2.6rem, 6vw, 3.2rem); }
  .work .shell, .contact .shell { display: block; }
  .projects, .details { margin-top: 1.6rem; }
}
@media (max-width: 650px) {
  .brand img { width: min(8.5rem, 100%); }
}
@media (max-width: 360px) {
  /* Keeps the three Armenian section links on one line at 320 px. */
  .main-nav { justify-content: space-between; gap: 0 .5rem; }
}
@media (max-width: 600px) {
  .intro { display: block; }
  .hero h1 { max-width: 14ch; font-size: clamp(2.65rem, 10.7vw, 4rem); }
  html:lang(hy) .hero h1 { font-size: clamp(2.45rem, 9vw, 3.25rem); }
  .lead { margin-top: 1.25rem; }
  .actions { margin-top: 1.25rem; }
  .service-list { display: block; padding-top: 0; }
  .service, .service:nth-child(n) { display: block; border: 0; padding: 1.05rem 0; margin: 0; }
  .service + .service { border-top: 1px solid var(--line); }
  .service dd { margin-top: .5rem; }
  .projects li, .details { grid-template-columns: minmax(0, 1fr); }
  .company-record { display: block; }
  .company-record > div { display: block; margin-top: 1.1rem; }
  .company-record dt { margin-bottom: .3rem; }
  .contact-sheet::before { background-size: 7.5rem auto; opacity: .085; }
  .harmonic-part { stroke-width: .9; }
  .harmonic-output { stroke-width: 2.1; }
}

@media (forced-colors: active) {
  /* Keep the supplied logo legible in light and dark contrast themes. */
  .brand img { filter: none; forced-color-adjust: none; background: #fff; padding: .2rem; border-radius: .2rem; }
  .button { border: 1px solid; }
  .languages [aria-current] { text-decoration: underline; }
  .contact-sheet::before { display: none; }
  .harmonic-guides, .harmonic-part { stroke: GrayText; }
  .harmonic-output { stroke: CanvasText; }
}

@media print {
  body, .error-page, .masthead, .hero, .lead, .error-text { background: #fff; color: #000; }
  .brand img { filter: none; }
  .skip, .main-nav, .languages, .actions, .hero-art, .contact-sheet::before { display: none; }
  .services, .work, .company, .footer, .contact-sheet { background: none; }
  .masthead { border-bottom-color: #999; }
  .service, .projects li, .details > p, .company-record > div { break-inside: avoid; }
  .details a[href^="https://wa.me/"]::after { content: " (" attr(href) ")"; font-size: .8em; font-weight: 400; }
}
