@font-face {
  font-family: "Playfair Display";
  src: url("assets/fonts/playfair-display-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lato";
  src: url("assets/fonts/lato-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #F5F7FA;
  --header-grad-start: rgb(45, 57, 69);
  --header-grad-end: rgb(20, 27, 43);
  --gold: #CEA027;
  --text-name: #141B2B;
  --text-body: #212D48;
  --font-heading: "Playfair Display", serif;
  --font-body: "Lato", sans-serif;
}

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

html, body {
  height: 100%;
  width: 100%;
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-body);
}

.branded-header {
  flex: 0 0 18%;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(to bottom, var(--header-grad-start), var(--header-grad-end));
  display: flex;
  align-items: center;
  justify-content: center;
}

.branded-logo {
  max-height: 70%;
  max-width: 80%;
  object-fit: contain;
}

@media (orientation: landscape) {
  .branded-header {
    flex: 0 0 25%;
  }
}

#input-view,
#display-view {
  display: none;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  opacity: 0;
}

#input-view.is-active,
#display-view.is-active {
  display: flex;
  opacity: 1;
  animation: view-fade-in 0.25s ease;
}

@keyframes view-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

#display-name {
  flex: 1 1 auto;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#name-display {
  font-family: var(--font-heading);
  color: var(--text-name);
  font-size: clamp(4rem, 18vw, 16.5rem);
  text-align: center;
  padding: 0 5%;
  white-space: normal;
  width: 100%;
  line-height: 1.15;
}

#display-stripe {
  flex: 0 0 12px;
  background: var(--gold);
  position: relative;
}

#back-link {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0 0.75rem 1px;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.7rem;
  line-height: 12px;
  color: rgba(20, 27, 43, 0.35);
  cursor: pointer;
  white-space: nowrap;
}

#back-link:hover,
#back-link:focus-visible {
  color: rgba(20, 27, 43, 0.7);
}

#input-form-area {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 2rem;
}

#name-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.25rem;
  width: 100%;
  max-width: 28rem;
}

#name-input {
  font-family: var(--font-body);
  font-size: 1.25rem;
  color: var(--text-body);
  background: #FFFFFF;
  border: 1px solid rgba(20, 27, 43, 0.15);
  border-radius: 0.5rem;
  padding: 0.9rem 1.1rem;
  box-shadow: 0 1px 3px rgba(20, 27, 43, 0.08);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#name-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(206, 160, 39, 0.15);
}

#show-button {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 700;
  color: #FFFFFF;
  background: var(--header-grad-end);
  border: none;
  border-radius: 0.5rem;
  padding: 0.9rem 1.1rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

#show-button:hover {
  background: var(--header-grad-start);
}

#show-button:active {
  transform: scale(0.98);
}
