/*
 * cohn.io — one stylesheet for the whole site.
 * Colors and sizes are variables at the top; change them here and they change everywhere.
 *
 *  1. Fonts and colors
 *  2. Basics
 *  3. Header and menu
 *  4. Shared section pieces (labels, headings, the "+" icon)
 *  5. Home: banner
 *  6. Home: about + "My Approach" tabs
 *  7. Tabs (used by "My Approach" and the case studies)
 *  8. Home: work (video gallery + case studies)
 *  9. Home: quote band
 * 10. Home: articles
 * 11. Home: contact form
 * 12. Blog page and blog posts
 * 13. Footer
 * Screen sizes: "tablet" = up to 975px wide, "phone" = up to 575px wide.
 */

/* 1. Fonts and colors ---------------------------------------------------- */
@font-face {
  font-family: "Montserrat";
  src: url("/assets/fonts/montserrat-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Franklin";
  src: url("/assets/fonts/libre-franklin-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --dark: #201f1f;        /* page background */
  --gray: #343333;        /* header, work section */
  --light: #f6f6f6;       /* text */
  --accent: #da9605;      /* orange */
  --code-bg: #f0f2f1;     /* file-name examples in blog posts */
  --gallery-active: #e63946;

  --font-text: "Montserrat", Arial, sans-serif;
  --font-head: "Libre Franklin", Arial, sans-serif;

  --side: 80px;           /* space at the left and right of the page */
  --section-y: 80px;      /* space above and below sections */
  --header-h: 80px;
}
@media (max-width: 975px) {
  :root { --side: 48px; --section-y: 64px; --header-h: 78px; }
}
@media (max-width: 575px) {
  :root { --side: 32px; --section-y: 32px; }
}

/* 2. Basics -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--dark);
  color: var(--light);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); font-weight: 600; margin: 0; }
p { margin: 0; }
button { font: inherit; color: inherit; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--accent); color: var(--dark); padding: 8px 16px; }
.skip-link:focus { left: 8px; top: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container { padding-left: var(--side); padding-right: var(--side); }
.section { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.bg-dark { background: var(--dark); }
.bg-gray { background: var(--gray); }

/* 3. Header and menu ----------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--gray);
  height: var(--header-h);
}
.site-header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 64px 0 var(--side);
}
.site-name {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 32px;
  line-height: 48px;
  text-decoration: none;
  color: var(--light);
}
.site-menu { display: flex; gap: 32px; }
.site-menu a {
  text-decoration: none;
  text-transform: uppercase;
  font-size: 16px;
  line-height: 24px;
  color: var(--light);
  transition: color .2s;
}
.site-menu a:hover,
.site-menu a[aria-current="page"],
.site-menu a.is-active { color: var(--accent); }
.menu-toggle { display: none; }

@media (max-width: 975px) {
  .site-header-inner { padding: 0 32px; }
  .site-name { font-size: 28.8px; line-height: 43.2px; }
  .menu-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    z-index: 2;
    background: none;
    border: 0;
    padding: 4px 0;
    cursor: pointer;
  }
  .menu-toggle-label { font-size: 11px; line-height: 1; text-transform: uppercase; letter-spacing: .02em; }
  .menu-toggle-bars,
  .menu-toggle-bars::before,
  .menu-toggle-bars::after {
    display: block;
    width: 30px;
    height: 3px;
    background: var(--light);
    transition: transform .25s, background .25s;
  }
  .menu-toggle-bars { position: relative; margin: 10px 0 9px; }
  .menu-toggle-bars::before, .menu-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .menu-toggle-bars::before { top: -9px; }
  .menu-toggle-bars::after { top: 9px; }
  .menu-open .menu-toggle-bars { background: transparent; }
  .menu-open .menu-toggle-bars::before { transform: translateY(9px) rotate(45deg); }
  .menu-open .menu-toggle-bars::after { transform: translateY(-9px) rotate(-45deg); }

  .site-menu {
    position: fixed;
    inset: 0;
    background: var(--dark);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 42px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
  }
  .site-menu a { background: var(--gray); }
  .menu-open .site-menu { opacity: 1; visibility: visible; }
  .menu-open { overflow: hidden; }
}

/* 4. Shared section pieces ----------------------------------------------- */
.label {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 17.6px;
  line-height: 26.4px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}
.big-heading {
  font-size: 64px;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 32px;
}
.big-heading .plus-icon { width: 40px; height: 40px; flex: none; }
.heading-right { justify-content: flex-end; text-align: right; }
.text-right { text-align: right; }
@media (max-width: 975px) {
  .big-heading { font-size: 38.4px; }
}
@media (max-width: 575px) {
  .heading-right.heading-wrap { flex-direction: column; align-items: flex-end; gap: 16px; }
}

/* 5. Home: banner -------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 90vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  overflow: hidden;
  background: #000;
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-width: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, .275) 1%, rgba(0, 0, 0, .984) 55%);
}
.hero-text {
  position: relative;
  z-index: 1;
  grid-column: 2;
  text-align: center;
  padding: 280px 16px 40px;   /* sits a little below the middle, like the old site */
}
.hero h1 {
  font-size: 96px;
  line-height: 1.2;
  color: var(--accent);
  text-transform: uppercase;
}
.hero-role {
  margin-top: 80px;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 17.6px;
  line-height: 26.4px;
  text-transform: uppercase;
}
@media (max-width: 975px) {
  .hero { grid-template-columns: 1fr; }
  .hero-text { grid-column: 1; padding-top: 260px; }
  .hero h1 { font-size: 80px; }
}
@media (max-width: 400px) {
  .hero h1 { font-size: 72px; }
}

/* 6. Home: about + "My Approach" ----------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 493fr) minmax(0, 755fr);
  gap: 32px;
}
.about-intro .big-heading { margin-bottom: 20px; }
.about-approach h3 { font-size: 32px; line-height: 48px; margin-top: 4px; }
.rule { border: 0; height: 2px; background: var(--light); margin: 40px 0 8px; }
@media (max-width: 975px) {
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .about-approach h3 { font-size: 28.8px; line-height: 43.2px; }
  .about-approach .rule { margin-top: 32px; }
}

/* 7. Tabs ---------------------------------------------------------------- */
.tabs {
  display: grid;
  grid-template-columns: var(--tab-width, 228px) minmax(0, 1fr);
  /* one row per tab name, then a stretchy row that takes any extra height */
  grid-template-rows: repeat(var(--tab-count), auto) 1fr;
  row-gap: 0;
}
.tab {
  grid-column: 1;
  grid-row: var(--tab-row);
  align-self: start;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-bottom: 16px;
  padding: 16px;
  border: 0;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 19.2px;
  line-height: 28.8px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--tab-bg);
  transition: color .2s, background .2s;
}
.tab:hover, .tab[aria-expanded="true"] { color: var(--light); background: var(--tab-bg-open); }
/* Thin "+" that turns into an "x" when open */
.tab-icon { position: relative; width: 19px; height: 19px; flex: none; transition: transform .3s; }
.tab-icon::before, .tab-icon::after {
  content: "";
  position: absolute;
  background: currentColor;
  left: 50%; top: 50%;
}
.tab-icon::before { width: 100%; height: 1.5px; transform: translate(-50%, -50%); }
.tab-icon::after { width: 1.5px; height: 100%; transform: translate(-50%, -50%); }
.tab[aria-expanded="true"] .tab-icon { transform: rotate(45deg); }
.tab-panel {
  grid-column: 2;
  grid-row: 1 / -1;
  padding: 16px;
  background: var(--panel-bg);
}
.tab-panel[hidden] { display: none; }
@media (max-width: 975px) {
  .tabs { grid-template-columns: 1fr; grid-template-rows: none; }
  .tab, .tab-panel { grid-column: 1; grid-row: auto; }
  .tab-panel { margin-bottom: 16px; }
}

.approach-tabs { --tab-bg: var(--dark); --tab-bg-open: var(--gray); --panel-bg: var(--dark); }
.case-tabs { --tab-width: 320px; --tab-bg: var(--gray); --tab-bg-open: var(--dark); --panel-bg: var(--dark); }
.case-tabs .tab-panel { margin-bottom: 0; }
@media (max-width: 975px) { .case-tabs .tab-panel { margin: -16px 0 16px; } }

/* 8. Home: work ---------------------------------------------------------- */
.work .section-head { margin-bottom: 32px; }
.vimeo-gallery { padding: 0 16px; }
.vimeo-gallery .main-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}
.vimeo-gallery .main-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.thumb-strip { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.thumb-item {
  flex: 0 0 auto;
  width: 20vw;
  max-width: 120px;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  transition: border-color .2s;
}
.thumb-item[aria-pressed="true"] { border-color: var(--gallery-active); }
.thumb-item img { width: 100%; height: 100%; object-fit: cover; }

.case-studies { margin-top: 100px; }
.case-studies .rule { margin: 0 0 24px; }
.case-studies .big-heading { margin-bottom: 16px; }
.case-videos { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 20px; }
.case-videos video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.case-title {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 17.6px;
  line-height: 26.4px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.case-part { border-top: 1px solid var(--gray); margin-top: 24px; padding-top: 26px; }
.case-part h5, .case-part h6 { color: var(--accent); }
.case-part h5 { font-size: 16px; line-height: 24px; }
.case-part h6 { font-size: 18px; line-height: 27px; }
.case-part .indent, .indent { padding-left: 20px; }
.gap { margin-top: 24px; }
@media (max-width: 975px) {
  .case-studies { margin-top: 64px; }
  .work .container { padding-left: 16px; padding-right: 16px; }
  .work .section-head, .vimeo-gallery { padding-left: 16px; padding-right: 16px; }
}

/* 9. Home: quote band ---------------------------------------------------- */
.quote-band { display: grid; grid-template-columns: 40% 60%; }
.quote-band-image { background: url("/assets/img/clapperboard.jpg") center / cover no-repeat; min-height: 100px; }
.quote-band-text {
  background: var(--accent);
  padding: 120px 118px;
  font-size: 30px;
  line-height: 45px;
}
.quote-band-text p { max-width: 570px; }
@media (max-width: 975px) {
  .quote-band { grid-template-columns: 1fr; }
  .quote-band-text { padding: 64px 24px; }
  .quote-band-text p { margin: 0 auto; }
}
@media (max-width: 575px) {
  .quote-band-text { padding: 40px 34px; }
}

/* 10. Home: articles ----------------------------------------------------- */
.articles .section-head { margin-bottom: 40px; }
.article-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 2 * 32px) / 3);
  gap: 32px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.article-track::-webkit-scrollbar { display: none; }
.article-card { scroll-snap-align: start; display: flex; flex-direction: column; }
.article-card img { width: 100%; height: 200px; object-fit: cover; }
.article-card h3 {
  margin-top: 18px;
  font-weight: 500;
  font-size: 17.6px;
  line-height: 26.4px;
  text-transform: uppercase;
}
.article-card h3 a { text-decoration: none; }
.article-card h3 a:hover { color: var(--accent); }
.article-card time { display: block; margin-top: auto; padding-top: 16px; text-align: right; }
.article-pager { display: flex; justify-content: space-between; margin-top: 32px; min-height: 24px; }
.article-pager button {
  background: var(--gray);
  border: 0;
  padding: 0 2px;
  cursor: pointer;
  font-size: 16px;
  line-height: 24px;
}
.article-pager button:hover { color: var(--accent); }
.article-pager [data-next] { margin-left: auto; }
.article-pager button[hidden] { display: none; }
@media (max-width: 975px) {
  .article-track { grid-auto-columns: calc((100% - 32px) / 2); }
}
@media (max-width: 575px) {
  .article-track { grid-auto-columns: 100%; }
}

/* 11. Home: contact ------------------------------------------------------ */
.contact { background: var(--accent); color: var(--dark); padding: 72px 72px 80px; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
.contact .label { color: var(--dark); }
.contact .big-heading { margin-bottom: 26px; }
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-form input,
.contact-form textarea {
  grid-column: 1 / -1;
  width: 100%;
  background: var(--accent);
  border: 2px solid var(--dark);
  border-radius: 32px;
  padding: 12px 24px;
  font: inherit;
  color: var(--dark);
}
.contact-form textarea { height: 148px; resize: vertical; padding-top: 22px; }
.contact-form ::placeholder { color: var(--dark); opacity: 1; }
.contact-form .half { grid-column: auto; }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--dark); outline-offset: 2px; }
.contact-form .form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.contact-form button {
  width: 184px;
  height: 56px;
  border: 0;
  border-radius: 32px;
  background: var(--gray);
  color: var(--light);
  cursor: pointer;
  transition: background .2s;
}
.contact-form button:hover { background: var(--dark); }
.contact-form button:disabled { opacity: .6; cursor: wait; }
.form-status { grid-column: 1 / -1; min-height: 24px; text-align: right; font-weight: 500; }
.form-status.is-error { color: #5c0d0d; }
.form-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 975px) {
  .contact { padding: 32px 20px 40px; }
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .contact-form .half { grid-column: 1 / -1; }
  .contact-form button { width: 100%; }
  .form-status { text-align: center; }
}

/* Thank-you page (only shown when JavaScript is off) */
.form-result { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; gap: 24px; }
.form-result a { color: var(--accent); }

/* 12. Blog page and blog posts ------------------------------------------- */
.post-page { padding: 64px 10% 40px; }
.post-page > * { max-width: 1152px; margin-left: auto; margin-right: auto; }
.post + .post { margin-top: 64px; }
.post-title { font-size: 32px; line-height: 48px; }
.post-title a { text-decoration: none; }
.post-title a:hover { color: var(--accent); }
.post-page-single .post-title { text-align: center; }
.post-meta { display: flex; justify-content: space-between; gap: 16px; margin: 20px 0 20px; }
.post-cover { width: 100%; margin-bottom: 40px; }
.post-body h3 { font-size: 32px; line-height: 48px; margin: 16px 0 32px; }
.post-body h5 { font-size: 20px; line-height: 30px; }
.post-body h6 { font-size: 18px; line-height: 27px; }
.post-body pre {
  background: var(--code-bg);
  color: var(--dark);
  padding: 24px 48px;
  margin: 0 0 48px;
  font-size: 16px;
  line-height: 24px;
  overflow-x: auto;
  white-space: pre;
}
.post-body .post-bullets { margin: 0; padding-left: 20px; list-style: none; }
.post-body .post-bullets li::before { content: "• "; }
.post-body .indent { padding-left: 20px; }
.post-figure { margin: 0 auto; max-width: 828px; }
.post-figure figcaption { text-align: center; }
.back-link { display: inline-block; margin-top: 40px; background: var(--gray); text-decoration: none; }
.back-link:hover { color: var(--accent); }
@media (max-width: 575px) {
  .post-page { padding: 40px 20px 32px; }
  .post-title, .post-body h3 { font-size: 26px; line-height: 36px; }
  .post-body pre { padding: 20px; font-size: 14px; }
}

/* 13. Footer ------------------------------------------------------------- */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 32px;
  padding: 32px 48px;
  background: var(--dark);
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.footer-name { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 20px; }
.footer-links { display: flex; list-style: none; margin: 0; padding: 0; }
.footer-links li + li::before { content: "|"; margin: 0 16px; }
@media (max-width: 975px) {
  .site-footer { flex-direction: column; justify-content: center; text-align: center; padding: 24px 20px; gap: 0; }
  .footer-name { gap: 0 20px; }
}
